Class: Grit::Diff
- Inherits:
-
Object
- Object
- Grit::Diff
- Defined in:
- lib/grit/ext/diff.rb
Instance Attribute Summary collapse
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
Instance Method Summary collapse
Instance Attribute Details
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
3 4 5 |
# File 'lib/grit/ext/diff.rb', line 3 def repo @repo end |
Instance Method Details
#hunks ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/grit/ext/diff.rb', line 5 def hunks header_lines.each_with_index .map { |header, index| next_header = header_lines[index + 1] next_line_number = next_header ? next_header[1] : lines.count DiffHunk.new(header[0], lines[header[1], next_line_number - 1]) } end |