Showing the differences between 2 hashes

Hi,

Am looking for a module that supports showing graphically the
differences between 2 hashes in colour preferably. Does anybody know if
such a module exists?

Thanks.

On Tue, Dec 21, 2010 at 6:52 PM, Rick T. [email protected] wrote:

Am looking for a module that supports showing graphically the
differences between 2 hashes in colour preferably. Does anybody know if
such a module exists?

RSpec 1.3 had a --diff option:

$ irb

require ‘spec/runner/differs/default’
=> true

a = {:a => 2}; b = {:a => 3, :b => 5}
=> {:b=>5, :a=>3}

puts Spec::Expectations::Differs::Default.new(_).diff_as_hash(a, b)

Expected hash contains keys that target hash does not: [:b]
Expected the key :a to be 3, but was 2
Expected the key :b to be 5, but was nil

Are you thinking about diffing as a feature in a program or as a
debugging tool? Depending on your data, you may get decent results by
marshaling the objects to yaml and using any standard diff tool.