hashdiff 0.3.2 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/changelog.md +4 -0
- data/lib/hashdiff/util.rb +1 -0
- data/lib/hashdiff/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 284b7371148ba31499e35fdfb3783faced5a8498
|
4
|
+
data.tar.gz: 3d902c91f2d00eb00df4cb96d27f5d6c242e9ee8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e80104dc13c931f44352337d0027fd774f8a54a67c2ae15b2870e05723c41aafbe00be06d5073078ccfcf44b320e3ae03693623f0d61cab95fa040671e708599
|
7
|
+
data.tar.gz: 8efef12e5b3ff1c9a78dfc7655f121211d91e6b7d62521d33a5376b202e31913da440e2754f5ae0a3f1cba7189e2006db033027786c7402410ecf5dac58d44f2
|
data/README.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
HashDiff is a ruby library to compute the smallest difference between two hashes.
|
4
4
|
|
5
|
+
It also supports comparing two arrays.
|
6
|
+
|
7
|
+
HashDiff does not monkey-patch any existing class. All features are contained inside the `HashDiff` module.
|
8
|
+
|
5
9
|
**Docs**: [Documentation](http://rubydoc.info/gems/hashdiff)
|
6
10
|
|
7
11
|
## Why HashDiff?
|
data/changelog.md
CHANGED
data/lib/hashdiff/util.rb
CHANGED
@@ -4,6 +4,7 @@ module HashDiff
|
|
4
4
|
#
|
5
5
|
# judge whether two objects are similar
|
6
6
|
def self.similar?(a, b, options = {})
|
7
|
+
return compare_values(a, b, options) unless a.is_a?(Array) || a.is_a?(Hash) || b.is_a?(Array) || b.is_a?(Hash)
|
7
8
|
opts = { :similarity => 0.8 }.merge(options)
|
8
9
|
|
9
10
|
count_a = count_nodes(a)
|
data/lib/hashdiff/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hashdiff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Liu Fengyun
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|