nice_hash 1.15.3 → 1.15.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/nice/hash/add_to_ruby.rb +7 -1
  3. metadata +10 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e1518b1eb83a00333a4051d91aa0b40fb9fe58e4b0b3ad229fcc78b0f86eb56
4
- data.tar.gz: 69c215835f068a459dfc0e01605c45c42a5447e4e818eeabfac3f90a746c6012
3
+ metadata.gz: 7f0aad640f99683aac5af41fb02fd259e7babed5c61ef52e71b1b1f5210c7be4
4
+ data.tar.gz: 4badbdcb7fa2d8d6f1a17588e2373a8491fa86b7b4f527619a8f9a5bd25f9825
5
5
  SHA512:
6
- metadata.gz: f61c5845665e7dcddf367e2850afb0d83b95bef3d39c8931be7bce5f27ffc24d6352b5c13d9a600f0d128fc25b1ff8332a2796943abf7f6fe647c4ac9739830e
7
- data.tar.gz: 6f5ae2c245b192ee7ee331bf6d1a990551dd5e57e93997d168e83a3acfa2d471649ca83e06efdc0a3e18f4f948b1a7e594a6bdd5a2de916745bc9339e2228994
6
+ metadata.gz: afd06af350171b1c6726d08cfbf116c8a09ecd25d796f748468880360f8a783d6454195bd18de4dfca79dd5c3e699e0e9a5e8271ffc8d67afd1673afff813824
7
+ data.tar.gz: d5ddbd2b11a098e05a5e729fd75f11d72c0e163644e6f7b7a3eab3f2870622f2a26aaf1ce80f8e3dfd9416702bc7c4d5924b467b87ea77bf80698a4b1ee77784
@@ -159,8 +159,14 @@ class Hash
159
159
  m = m[1..-1].to_sym if m[0] == "_"
160
160
  if key?(m)
161
161
  self[m]
162
+ elsif key?(m.to_s)
163
+ self[m.to_s]
162
164
  elsif m.to_s[-1] == "="
163
- self[m.to_s.chop.to_sym] = arguments[0]
165
+ if key?(m.to_s.chop)
166
+ self[m.to_s.chop] = arguments[0]
167
+ else
168
+ self[m.to_s.chop.to_sym] = arguments[0]
169
+ end
164
170
  else
165
171
  nil
166
172
  end
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.15.3
4
+ version: 1.15.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mario Ruiz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-09 00:00:00.000000000 Z
11
+ date: 2019-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: string_pattern
@@ -34,22 +34,22 @@ dependencies:
34
34
  name: rspec
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - ">="
38
- - !ruby/object:Gem::Version
39
- version: 3.8.0
40
37
  - - "~>"
41
38
  - !ruby/object:Gem::Version
42
39
  version: '3.8'
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 3.8.0
43
43
  type: :development
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - ">="
48
- - !ruby/object:Gem::Version
49
- version: 3.8.0
50
47
  - - "~>"
51
48
  - !ruby/object:Gem::Version
52
49
  version: '3.8'
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 3.8.0
53
53
  description: 'NiceHash creates hashes following certain patterns so your testing will
54
54
  be much easier. Parse and filter JSON. You can easily generate all the hashes you
55
55
  want following the criteria you specify. Many other features coming to Hash class
@@ -101,7 +101,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  - !ruby/object:Gem::Version
102
102
  version: '0'
103
103
  requirements: []
104
- rubygems_version: 3.0.3
104
+ rubyforge_project:
105
+ rubygems_version: 2.7.6
105
106
  signing_key:
106
107
  specification_version: 4
107
108
  summary: NiceHash creates hashes following certain patterns so your testing will be