Dirb - Easy Diffing With Ruby ============================ Need diffs in your ruby app? Dirb has you covered. It provides a convenient way to generate a diff from two strings. Instead of reimplementing the LCS diff algorithm Dirb uses battle tested Unix diff to generate diffs, and focuses on providing a convenient interface, and getting out of your way. It provides several built in format options. Pass `:text`, `:color`, or `:html` to `Dirb::Diff#to_s` to force that format, or set `Dirb::Diff.default_format` $ irb >> require 'rubygems' >> require 'dirb' => true >> string1 = <<-TXT >" Hello how are you >" I'm fine >" That's great >" TXT => "Hello how are you\nI'm fine\nThat's great\n" >> string2 = <<-TXT >" Hello how are you? >" I'm fine >" That's swell >" TXT => "Hello how are you?\nI'm fine\nThat's swell\n" >> puts Dirb::Diff.new(string1, string2) -Hello how are you +Hello how are you? I'm fine -That's great +That's swell => nil >> puts Dirb::Diff.new(string1, string2).to_s(:html)