Skip to content

Instantly share code, notes, and snippets.

@keithrbennett
Created September 2, 2014 18:36
Show Gist options
  • Save keithrbennett/00900d2e6ac555c7bfd4 to your computer and use it in GitHub Desktop.
Save keithrbennett/00900d2e6ac555c7bfd4 to your computer and use it in GitHub Desktop.
Diffy Sample
require 'diffy'
s1 = "apple\npear\npapaya\nmango\n"
s2 = "apple\npapaya\nmango\njackfruit\n"
diff = Diffy::Diff.new(s1, s2).to_s
puts diff
=begin
Output is:
apple
-pear
papaya
mango
+jackfruit
=end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment