sdiff (Diff::LCS)

         # File lib/diff/lcs.rb, line 291
    291:     def sdiff(seq1, seq2, callbacks = nil, &block) #:yields diff changes:
    292:       callbacks ||= Diff::LCS::SDiffCallbacks
    293:       if callbacks.kind_of?(Class)
    294:         cb = callbacks.new rescue callbacks
    295:         callbacks = cb
    296:       end
    297:       traverse_balanced(seq1, seq2, callbacks)
    298:       callbacks.finish if callbacks.respond_to?(:finish)
    299:
    300:       if block_given?
    301:         res = callbacks.diffs.map do |hunk|
    302:           if hunk.kind_of?(Array)
    303:             hunk = hunk.map { |block| yield block }
    304:           else
    305:             yield hunk
    306:           end
    307:         end
    308:         res
    309:       else
    310:         callbacks.diffs
    311:       end
    312:     end