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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dcd0946386679f0615a194c4114df01e7b1c84f8
4
- data.tar.gz: 2020d0351371a98794d976daec63cea9784628f2
3
+ metadata.gz: 284b7371148ba31499e35fdfb3783faced5a8498
4
+ data.tar.gz: 3d902c91f2d00eb00df4cb96d27f5d6c242e9ee8
5
5
  SHA512:
6
- metadata.gz: 3ca84a8e6fd0309147c0ecf7e70cf844e43ac5568201bfd73c9f579761721fdd3fa927b824ac68262237e661aa6bdfe44ca31f8e7c8d7e9e622e5b502de20ec7
7
- data.tar.gz: 43f88705f7deca4b95b9cd438e46a8594e05872b33602d24c1166920665ff8b373ff75261a96d133620f6e36956b5d1df21d8b5310891620fbe24974e0e4c600
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?
@@ -1,5 +1,9 @@
1
1
  # Change Log
2
2
 
3
+ ## v0.3.4 2017-05-01
4
+
5
+ * performance improvement of HashDiff#similar? #31
6
+
3
7
  ## v0.3.2 2016-12-27
4
8
 
5
9
  * replace `Fixnum` by `Integer` #28
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module HashDiff
2
- VERSION = '0.3.2'
2
+ VERSION = '0.3.4'
3
3
  end
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.2
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: 2016-12-27 00:00:00.000000000 Z
11
+ date: 2017-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec