lib/sub_diff/sub.rb in sub_diff-1.0.1 vs lib/sub_diff/sub.rb in sub_diff-1.0.2
- old
+ new
@@ -2,17 +2,17 @@
class Sub < Struct.new(:differ)
def diff(*args, &block)
# Ruby 1.8.7 does not support additional args after * (splat)
args.push(block)
- differ.diff(*args) do |builder, diff|
- diff!(builder, diff, args.first)
+ differ.each_diff(*args) do |builder, diff|
+ process(builder, diff, args.first)
end
end
private
- def diff!(builder, diff, search)
+ def process(builder, diff, search)
builder << prefix(diff)
builder.push(diff[:replacement], diff[:match])
builder << suffix(diff, search)
end