HashDeepDiff
Find the exact difference between two Hash objects and build a report to visualize it
Installation
Add this line to your application's Gemfile:
gem 'hash_deep_diff'
And then execute:
$ bundle
Or install it yourself as:
$ gem install hash_deep_diff
Usage
Basic example
left = { a: :a }
right = { a: :b }
HashDeepDiff::Comparison.new(left, right).report
- left[a] = a
+ left[a] = b
please see Documentation for more information
Customization
You can implement and use your own reporting engines with the default HashDeepDiff::Delta objects as a source of the report. In order to do so implement your own version of the reporting engine (example can be found here) and inject it into a Comparison
left = { a: :a }
right = { a: :b }
HashDeepDiff::Comparison.new(left, right, reporting_engine: CustomEngine).report
Contributing
Bug reports and pull requests are welcome on GitHub at bpohoriletz.