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.
A private parser class to process the output of git diff
Instance Method Summary collapse
-
#initialize(base, patch_text) ⇒ FullDiffParser
constructor
private
A new instance of FullDiffParser.
- #parse private
Constructor Details
#initialize(base, patch_text) ⇒ FullDiffParser
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.
Returns a new instance of FullDiffParser.
164 165 166 167 168 169 170 |
# File 'lib/git/diff.rb', line 164 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
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.
172 173 174 175 |
# File 'lib/git/diff.rb', line 172 def parse @patch_text.split("\n").each { |line| process_line(line) } @final_files.map { |filename, data| [filename, DiffFile.new(@base, data)] } end |