diff (Diff::LCS)

         # File lib/diff/lcs.rb, line 254
    254:     def diff(seq1, seq2, callbacks = nil, &block) # :yields diff changes:
    255:       callbacks ||= Diff::LCS::DiffCallbacks
    256:       if callbacks.kind_of?(Class)
    257:         cb = callbacks.new rescue callbacks
    258:         callbacks = cb
    259:       end
    260:       traverse_sequences(seq1, seq2, callbacks)
    261:       callbacks.finish if callbacks.respond_to?(:finish)
    262:
    263:       if block_given?
    264:         res = callbacks.diffs.map do |hunk|
    265:           if hunk.kind_of?(Array)
    266:             hunk = hunk.map { |block| yield block }
    267:           else
    268:             yield hunk
    269:           end
    270:         end
    271:         res
    272:       else
    273:         callbacks.diffs
    274:       end
    275:     end