aromat 1.4.2 → 1.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/aromat.rb +1 -0
- data/lib/aromat/dmerge.rb +15 -0
- data/lib/aromat/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 49fb645b2169ba9a8e3c931bf96d0be5a65de967479b7ce9f2114326f562be8e
|
4
|
+
data.tar.gz: cb1328bf4d51399c91cf6431818de38e28516bf26ffc40e1ab9e3649455b3be4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ea29b3ff67fe5825359c370e806e6edaa0f3768eaf619965e5eb73ca9cf3c9c0b0d8d1d37a83a61825501b6234b1e8ab9aa01363696dc34db43abf89dae165b
|
7
|
+
data.tar.gz: 1a37cd012990169bb3e25072ee1ea433ecd3dc70e3e5f5a42a65cd6ce11634663efb92d83cadb160170110214c6ad3b3faa168057d843af11d861c36163a4775
|
data/lib/aromat.rb
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
# Aromat
|
2
|
+
# by Eresse <eresse@eresse.net>
|
3
|
+
|
4
|
+
# Monkey-patch Hash Class
|
5
|
+
class Hash
|
6
|
+
|
7
|
+
# Deep-Merge:
|
8
|
+
# Recursively merges every level of the Hash.
|
9
|
+
# @param [Hash] a Hash to merge with
|
10
|
+
# @return [Hash] A deep combination of this and a.
|
11
|
+
def dmerge a
|
12
|
+
m = proc { |k, v1, v2| Hash === v1 && Hash === v2 ? v1.merge(v2, &m) : Array === v1 && Array === v2 ? v1 | v2 : [:undefined, nil, :nil].include?(v2) ? v1 : v2 }
|
13
|
+
self.merge(a.to_h, &m)
|
14
|
+
end
|
15
|
+
end
|
data/lib/aromat/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aromat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eresse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -69,6 +69,7 @@ files:
|
|
69
69
|
- lib/aromat/case.rb
|
70
70
|
- lib/aromat/date.rb
|
71
71
|
- lib/aromat/dclone.rb
|
72
|
+
- lib/aromat/dmerge.rb
|
72
73
|
- lib/aromat/duration.rb
|
73
74
|
- lib/aromat/module.rb
|
74
75
|
- lib/aromat/nstr.rb
|
@@ -97,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
98
|
version: '0'
|
98
99
|
requirements: []
|
99
100
|
rubyforge_project:
|
100
|
-
rubygems_version: 2.
|
101
|
+
rubygems_version: 2.7.7
|
101
102
|
signing_key:
|
102
103
|
specification_version: 4
|
103
104
|
summary: Small extensions to Ruby core libraries to make your life easier
|