77[ hound-badge ] : https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg
88[ hound ] : https://houndci.com
99
10- SuperDiff is a tool that displays the differences between two data structures of
11- any type in Ruby.
10+ SuperDiff is a Ruby gem that intelligently displays the differences between two
11+ data structures of any type.
12+
13+ 📢 ** [ See what's changed in the latest version (0.1.0)] [ changelog ] .**
14+
15+ [ changelog ] : CHANGELOG.md
1216
1317## Introduction
1418
@@ -17,8 +21,8 @@ capabilities. Sometimes, whenever you use a matcher such as `eq`, `match`,
1721` include ` , or ` have_attributes ` , you will get a diff of the two data structures
1822you are trying to match against. This is really helpful for strings, but not so
1923helpful for other, more "real world" kinds of values, such as arrays, hashes,
20- and full-scale objects. The reason this doesn't work is because [ RSpec will
21- naively run your ` expected ` and ` actual ` values through Ruby's PrettyPrinter
24+ and full-scale objects. The reason this doesn't work is because [ all RSpec does
25+ is run your ` expected ` and ` actual ` values through Ruby's PrettyPrinter
2226library] [ rspec-differ-fail ] and then perform a diff of these strings.
2327
2428For instance, let's say you wanted to compare these two hashes:
@@ -77,9 +81,9 @@ You would get output that looks like:
7781
7882Not great.
7983
80- This library provides a sophisticated set of comparators that know how to
81- intelligent compute the differences between two data structures and display them
82- in a way that makes sense. Using the example above, you'd get this instead:
84+ This library provides a diff engine that knows how to figure out the differences
85+ between any two data structures and display them in a sensible way. Using the
86+ example above, you'd get this instead:
8387
8488![ After super_diff] ( doc/after_super_diff.png )
8589
@@ -131,9 +135,9 @@ your test helper file (either `rails_helper` or `spec_helper`):
131135
132136``` ruby
133137SuperDiff ::RSpec .configure do |config |
134- config.extra_differ_classes << YourDiffer
135- config.extra_operational_sequencer_classes << YourOperationalSequencer
136- config.extra_diff_formatter_classes << YourDiffFormatter
138+ config.add_extra_differ_class( YourDiffer )
139+ config.add_extra_operational_sequencer_class( YourOperationalSequencer )
140+ config.add_extra_diff_formatter_class( YourDiffFormatter )
137141end
138142```
139143
@@ -143,16 +147,17 @@ and diff formatter. Also explanations on what these are.)*
143147## Contributing
144148
145149If you encounter a bug or have an idea for how this could be better, feel free
146- to create an issue.
150+ to [ create an issue] ( https://github.com/mcmire/super_diff/issues ) .
147151
148152If you'd like to submit a PR instead, here's how to get started. First, fork
149- this repo and then run:
153+ this repo. Then, when you've cloned your fork, run:
150154
151155```
152156bundle install
153157```
154158
155- This will install dependencies. From here you can run all of the tests:
159+ This will install various dependencies. After this, you can run all of the
160+ tests:
156161
157162```
158163bundle exec rake
@@ -188,7 +193,7 @@ Thank you so much!
188193
189194[ original-version ] : https://github.com/mcmire/super_diff/tree/old-master
190195[ diff-lcs ] : https://github.com/halostatue/diff-lcs
191- [ pretty-printer ] : https://github.com/ruby/ruby/tree/master/lib
196+ [ pretty-printer ] : https://github.com/ruby/ruby/tree/master/lib/prettyprint.rb
192197[ awesome-print ] : https://github.com/awesome-print/awesome_print
193198[ inspection-tree ] : https://github.com/mcmire/super_diff/blob/master/lib/super_diff/object_inspection/inspection_tree.rb
194199
0 commit comments