<p>How do I do a diff of two strings or arrays in Ruby?</p>

diff.rb is what you want, which is available at
http://users.cybercity.dk/~dsl8950/ruby/diff.html
via internet archive:
http://web.archive.org/web/20140421214841/http://users.cybercity.dk:80/~dsl8950/ruby/diff.html