stringify-hash 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/stringify-hash.rb +4 -4
- data/lib/stringify-hash/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZjcyNjJkOWM3OGQ0ZjljODQzMmQwOTQyZWM4NTNlZmEwODk2ZjM3MQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZjdhZTM4YTQxYjQ1ZDZhMDU1YjJiMjUzMmJiZjE3YTQyZjdlN2UwOA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZTU3OTVkYjc3OTExZDk0NjA0MTVlOWZiYzBjN2VhOGM0MWMwYTBlODU0OTQx
|
10
|
+
ZTViZWY4MDMyZjRhMWZlMTNjM2I3NDlmMjI0OTdhYzJkNTBlMTBiZDFlNTJj
|
11
|
+
OWNkMTY3YWQ3ZDM0MTg3NGU2ODI5MzIyNjViNjE5NzYyZTM5Mjg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZjI0NjgzYjdhOGViOGQ5ZGM0ZWRmZjlhNWYxMjQ5NDZhMmU0NGNiMzNhNWQy
|
14
|
+
M2ZhMjBkYzMwZWMzNzdhY2Y1M2I0MDFmNzg1OTUwZDE5NzgxOTdmM2U1MzFi
|
15
|
+
YzQ4YWZjNWZiZjc4NjAxYTQyOTlkOGY5YmE1ZjE4NmJkOGU5NzU=
|
data/lib/stringify-hash.rb
CHANGED
@@ -83,12 +83,12 @@ class StringifyHash < Hash
|
|
83
83
|
#
|
84
84
|
# @return [StringifyHash] The combined bash and hash
|
85
85
|
def rmerge base, hash
|
86
|
-
return base unless hash.is_a?(Hash) || hash.is_a?(
|
86
|
+
return base unless hash.is_a?(Hash) || hash.is_a?(self.class)
|
87
87
|
hash.each do |key, v|
|
88
|
-
if (base[key].is_a?(Hash) || base[key].is_a?(
|
88
|
+
if (base[key].is_a?(Hash) || base[key].is_a?(self.class)) && (hash[key].is_a?(Hash) || hash[key].is_a?(self.class))
|
89
89
|
rmerge(base[key], hash[key])
|
90
90
|
elsif hash[key].is_a?(Hash)
|
91
|
-
base[key] =
|
91
|
+
base[key] = self.class.new.merge(hash[key])
|
92
92
|
else
|
93
93
|
base[key]= hash[key]
|
94
94
|
end
|
@@ -112,7 +112,7 @@ class StringifyHash < Hash
|
|
112
112
|
# @return [StringifyHash] The combined hash
|
113
113
|
def merge hash
|
114
114
|
#make a deep copy into an empty hash object
|
115
|
-
merged_hash = rmerge(
|
115
|
+
merged_hash = rmerge(self.class.new, self)
|
116
116
|
rmerge(merged_hash, hash)
|
117
117
|
end
|
118
118
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stringify-hash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppetlabs
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-07-
|
12
|
+
date: 2015-07-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|