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
#added ⇒ Object
22 23 24 |
# File 'lib/grit/ext/diff.rb', line 22 def added hunks_lines {|h| h.added } end |
#full_a_path ⇒ Object
14 15 16 |
# File 'lib/grit/ext/diff.rb', line 14 def full_a_path full(a_path) end |
#full_b_path ⇒ Object
18 19 20 |
# File 'lib/grit/ext/diff.rb', line 18 def full_b_path full(b_path) end |
#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 |
#removed ⇒ Object
26 27 28 |
# File 'lib/grit/ext/diff.rb', line 26 def removed hunks_lines {|h| h.removed } end |