hashdiff
hashdiff copied to clipboard
Hashdiff is a ruby library to to compute the smallest difference between two hashes
So looking at [compare_hashes.rb](https://github.com/liufengyun/hashdiff/blob/master/lib/hashdiff/compare_hashes.rb) there's some sorting to make sure the results are stable and deterministic independent of the ordering of the keys. Is that true for all of the...
Hello. I find the following behavior (using Hashdiff 1.0.1) somewhat unexpected: ```ruby Hashdiff.diff(%w[a b c], %w[a b d]) => [["-", "[2]", "c"], ["+", "[2]", "d"]] ``` Would not it be...
just found that strangeness ... I think the default should "exact", if anyone wants "fuzzy" they can add that ...
Tried with `1.0.0` release and below is against `master` branch: **script** ```ruby require 'awesome_print' require 'hashdiff' a = {"order"=>1, "index_patterns"=>["logstash-cloudtrail*"], "settings"=>{"index"=>{"lifecycle"=>{"name"=>"logging_policy", "rollover_alias"=>"logstash-cloudtrail-write"}, "routing"=>{"allocation"=>{"require"=>{"node_type"=>"hot"}}}, "mapping"=>{"total_fields"=>{"limit"=>8000}, "ignore_malformed"=>"true"}, "refresh_interval"=>"30s", "number_of_shards"=>2, "merge"=>{"scheduler"=>{"max_thread_count"=>1}}, "number_of_replicas"=>2}}, "mappings"=>{"_doc"=>{"dynamic_templates"=>[{"message_field"=>{"path_match"=>"message",...
``` a = {a:'car', b:['truck', 'plane'] } b = {a:'bus', b:['truck', ' plan'] } diff = HashDiff.diff(a, b) do |path, obj1, obj2| case path when 'b[*]' true end end =>...
I have 2 hashes, both with a "created_at" attribute, they are the same, however, that's the behavior I get from the gem when I try to compare both: ``` [1]...
I have inputs ``` a = [1, 2, 3] b = [1, 10, 3] ``` and expect a diff of ``` [["~", "[1]", 2, 10 ]] ``` but instead I...
Hi, When debugging an issue with [octocatalog-diff](https://github.com/github/octocatalog-diff/blob/master/lib/octocatalog-diff/catalog-diff/differ.rb#L525) we narrowed down the problem to HashDiff unable to compare a couple of arrays when LCS is used. Here's a reproducer: ```ruby require...
It would be great if there where a way to use RegEx to ignore certain nodes. I am using this to compare the results of an API call, and need...