nice_hash 1.16.2 → 1.16.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e8ce4fa95c6481ad79af110829275f7e3947d9a845445225a0455426f61f206d
4
- data.tar.gz: 35cd93c366b1275dc592abacd26f7f3709003f29f8435d194a1c3f658a09a6e3
3
+ metadata.gz: 5937a8d8101c07c797a59ab099b79f2b34402f8a225ec3fb171b258e395ed69c
4
+ data.tar.gz: 942f8d0f81e5098837ce027c0797f86f15de4981d5945ce7ce6ec3d1539c97b6
5
5
  SHA512:
6
- metadata.gz: b06d9c334c128cbde3b550da19140ab20f810534cd53f66f62da738e77ecd7d6df370b75ebff629e0a5817ef9d8ab653beeeb9b553a6c71b170d81ed2bc81497
7
- data.tar.gz: 7a1e75ef935ab10bd6d3906f6670fb1a050d1a7fbaeff812566a7eed872668838814f4ac912c8beef2e5fbdc6ea64579a6b2ade6389eae20e1310a20e5a49d45
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.2
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-08 00:00:00.000000000 Z
11
+ date: 2020-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: string_pattern