nice_hash 1.16.2 → 1.16.3
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/lib/nice/hash/compare_structure.rb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5937a8d8101c07c797a59ab099b79f2b34402f8a225ec3fb171b258e395ed69c
|
|
4
|
+
data.tar.gz: 942f8d0f81e5098837ce027c0797f86f15de4981d5945ce7ce6ec3d1539c97b6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '087841b5fc615183cb45eb9634bda722937da1292094cb833fca58d002337c84c6c18b8920a4f8b829c71eff9465fbe1606d3104ede3ee235285acb31e05536b'
|
|
7
|
+
data.tar.gz: 4e7f680d02059ecf90dee8ce828538f51af3f8dcbb454df447e187899af95647a0302ddf2437c3b72adf62b4214ef05e744b813560cf228fc2962b2c00d1b7dd
|
|
@@ -23,6 +23,7 @@ class NiceHash
|
|
|
23
23
|
# #>true
|
|
24
24
|
##################################################
|
|
25
25
|
def NiceHash.compare_structure(structure, replica, compare_only_if_exist_key = false, patterns = {})
|
|
26
|
+
patterns = {} if patterns.nil?
|
|
26
27
|
unless structure.class == replica.class or
|
|
27
28
|
((structure.is_a?(TrueClass) or structure.is_a?(FalseClass)) and (replica.is_a?(TrueClass) or replica.is_a?(FalseClass)))
|
|
28
29
|
puts "NiceHash.compare_structure: different object type #{structure.class} is not #{replica.class}. expected: #{structure.inspect}. found: #{replica.inspect}."
|
|
@@ -30,6 +31,7 @@ class NiceHash
|
|
|
30
31
|
end
|
|
31
32
|
success = true
|
|
32
33
|
if structure.is_a?(Hash)
|
|
34
|
+
patterns = {} unless patterns.is_a?(Hash)
|
|
33
35
|
structure.each do |key, value|
|
|
34
36
|
if patterns.key?(key) and replica.key?(key)
|
|
35
37
|
unless (patterns[key].is_a?(Array) and replica[key].is_a?(Array) and replica[key].empty?) or
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: nice_hash
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.16.
|
|
4
|
+
version: 1.16.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mario Ruiz
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-05-
|
|
11
|
+
date: 2020-05-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: string_pattern
|