Class: Git::Diff::FullDiffParser Private
- Inherits:
-
Object
- Object
- Git::Diff::FullDiffParser
- Defined in:
- lib/git/diff.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Private parser for git diff output
Instance Method Summary collapse
-
#initialize(base, patch_text)
constructor
private
Creates a new FullDiffParser.
-
#parse ⇒ Array<Array(String, Git::Diff::DiffFile)>
private
Parses the diff text into a list of filename/DiffFile pairs.
Constructor Details
#initialize(base, patch_text)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Creates a new FullDiffParser
411 412 413 414 415 416 417 |
# File 'lib/git/diff.rb', line 411 def initialize(base, patch_text) @base = base @patch_text = patch_text @final_files = {} @current_file_data = nil @defaults = { mode: '', src: '', dst: '', type: 'modified', binary: false } end |
Instance Method Details
#parse ⇒ Array<Array(String, Git::Diff::DiffFile)>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Parses the diff text into a list of filename/DiffFile pairs
424 425 426 427 |
# File 'lib/git/diff.rb', line 424 def parse @patch_text.split("\n").each { |line| process_line(line) } @final_files.map { |filename, data| [filename, DiffFile.new(@base, data)] } end |