Module: Diffr
- Defined in:
- lib/diffr.rb,
lib/diffr/version.rb
Overview
:line=>5, :change=>:add, :string=>“Finally, a brand new line.” ]
Constant Summary collapse
- VERSION =
"0.0.1"
Instance Attribute Summary collapse
-
#diffs ⇒ Object
Returns the value of attribute diffs.
-
#sequences ⇒ Object
Returns the value of attribute sequences.
Class Method Summary collapse
-
.diffs(old, new) ⇒ Array
Returns an array of hashes that contain metadata about the differences between the two given strings.
Instance Attribute Details
#diffs ⇒ Object
Returns the value of attribute diffs.
31 32 33 |
# File 'lib/diffr.rb', line 31 def diffs @diffs end |
#sequences ⇒ Object
Returns the value of attribute sequences.
31 32 33 |
# File 'lib/diffr.rb', line 31 def sequences @sequences end |
Class Method Details
.diffs(old, new) ⇒ Array
Returns an array of hashes that contain metadata about the differences between the two given strings.
38 39 40 41 42 |
# File 'lib/diffr.rb', line 38 def self.diffs(old, new) new, old, @diffs = new.lines.to_a, old.lines.to_a, [] build_sequences(old, new) find_diffs(old, new, old.size, new.size) end |