Class: Lookout::Diff::Algorithms::Difflib::Position
- Defined in:
- lib/lookout-3.0/diff/algorithms/difflib/position.rb
Overview
Keeps track of a position into the two sequences currently being “diffed” of the difflib algorithm and generates matches and new positions based on this position.
Defined Under Namespace
Classes: New
Class Method Summary collapse
Instance Method Summary collapse
- #begin_after(match) ⇒ Object
- #begin_before?(match) ⇒ Boolean
- #end_after?(match) ⇒ Boolean
- #end_before(match) ⇒ Object
- #inspect ⇒ Object
- #match ⇒ Object
Class Method Details
Instance Method Details
#begin_after(match) ⇒ Object
23 |
# File 'lib/lookout-3.0/diff/algorithms/difflib/position.rb', line 23 def begin_after(match) self.class.new(old.begin_after(match.old), new.begin_after(match.new), junk) end |
#begin_before?(match) ⇒ Boolean
21 |
# File 'lib/lookout-3.0/diff/algorithms/difflib/position.rb', line 21 def begin_before?(match) old.begin_before? match.old and new.begin_before? match.new end |
#end_after?(match) ⇒ Boolean
22 |
# File 'lib/lookout-3.0/diff/algorithms/difflib/position.rb', line 22 def end_after?(match) old.end_after? match.old and new.end_after? match.new end |
#end_before(match) ⇒ Object
24 |
# File 'lib/lookout-3.0/diff/algorithms/difflib/position.rb', line 24 def end_before(match) self.class.new(old.end_before(match.old), new.end_before(match.new), junk) end |
#inspect ⇒ Object
25 |
# File 'lib/lookout-3.0/diff/algorithms/difflib/position.rb', line 25 def inspect; '#<%s %p,%p>' % [self.class, old, new] end |
#match ⇒ Object
20 |
# File 'lib/lookout-3.0/diff/algorithms/difflib/position.rb', line 20 def match; junk.empty? ? leftmost_longest : ((leftmost_longest, false), true) end |