Class: Git::Parsers::Diff::Patch::PatchFileParser Private
- Inherits:
-
Object
- Object
- Git::Parsers::Diff::Patch::PatchFileParser
- Includes:
- PatchMetadataParser
- Defined in:
- lib/git/parsers/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.
Stateful parser for unified diff patch output
Instance Method Summary collapse
-
#initialize(patch_text, numstat_map = {})
constructor
private
Initializes parser state for a patch text block.
-
#parse ⇒ Array<Git::DiffFilePatchInfo>
private
Parses patch text into file patch info objects.
Constructor Details
#initialize(patch_text, numstat_map = {})
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.
Initializes parser state for a patch text block
675 676 677 678 679 680 |
# File 'lib/git/parsers/diff.rb', line 675 def initialize(patch_text, numstat_map = {}) @patch_text = patch_text @numstat_map = numstat_map @files = [] @current_file = nil end |
Instance Method Details
#parse ⇒ Array<Git::DiffFilePatchInfo>
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 patch text into file patch info objects
686 687 688 689 690 |
# File 'lib/git/parsers/diff.rb', line 686 def parse @patch_text.split("\n").each { |line| process_line(line) } finalize_current_file @files end |