Class: Git::Diff::FullDiffParser Private

Inherits:
Object
  • Object
show all
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

API:

  • private

Instance Method Summary collapse

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.

API:

  • private



133
134
135
136
137
138
139
# File 'lib/git/diff.rb', line 133

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.

API:

  • private



141
142
143
144
# File 'lib/git/diff.rb', line 141

def parse
  @patch_text.split("\n").each { |line| process_line(line) }
  @final_files.map { |filename, data| [filename, DiffFile.new(@base, data)] }
end