liufengyun / hashdiff

Hashdiff is a ruby library to to compute the smallest difference between two hashes
MIT License
559 stars 63 forks source link

Add :indifferent option #80

Closed matpowel closed 4 years ago

matpowel commented 4 years ago

Added an option :indifferent to allow ignoring differences between strings and symbols as keys. This behaves similarly to the Rails/ActiveSupport Hash#with_indifferent_access modifier.

Included a spec and documentation.

matpowel commented 4 years ago

@liufengyun Hashdiff is a great tool we use mainly for Rails test cases. We found though that we really wanted to tell it to ignore the difference between symbols and strings in keys without having to be in an ActiveSupport environment where with_indifferent_access is available (and sometimes just to avoid having to call that all the time). Hopefully you find the addition useful.

liufengyun commented 4 years ago

I just pushed to rubygems.org.

matpowel commented 4 years ago

Great, thanks @liufengyun, will switch our project to point back to Rubygems at v1.0.1

liufengyun commented 4 years ago

It's done now. Thanks a lot @matpowel .

grosser commented 4 years ago

np, was just looking through the diff for what bug was fixed :D

On Wed, Mar 25, 2020 at 10:07 AM Matt Powell notifications@github.com wrote:

@matpowel commented on this pull request.

In changelog.md https://github.com/liufengyun/hashdiff/pull/80#discussion_r398022585:

@@ -1,5 +1,9 @@

Change Log

+## v1.0.1 2020-02-25

Sorry I didn't see guidance anywhere, feel free to correct it

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/liufengyun/hashdiff/pull/80#discussion_r398022585, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAACYZ4R6KYB26Y3OOZYLXTRJI25VANCNFSM4K3YULHA .