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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 24de33678fbd6f0ac1937b1991ec6fefd9114b7c
4
- data.tar.gz: b8536e1717fc59ad4478ce3d33f8d1f239ea9fab
2
+ SHA256:
3
+ metadata.gz: 49fb645b2169ba9a8e3c931bf96d0be5a65de967479b7ce9f2114326f562be8e
4
+ data.tar.gz: cb1328bf4d51399c91cf6431818de38e28516bf26ffc40e1ab9e3649455b3be4
5
5
  SHA512:
6
- metadata.gz: 16aff7fccca97e53ec3a386384d15c6403d4046f59185d42aba58ac2d0bc3890ea451d9d399d7cc423342de22fa45d5911b01a33686b3c99be1d0fef0b5f719a
7
- data.tar.gz: 7eb5a80a17b0fc9d1d5e2e3ee330af55e416eaf2fbce6f907d162eefe317bd00f82b5c9ad3a11544958ded169d4c55cc2891c91fe5c6ac32cbea036d4517f101
6
+ metadata.gz: 1ea29b3ff67fe5825359c370e806e6edaa0f3768eaf619965e5eb73ca9cf3c9c0b0d8d1d37a83a61825501b6234b1e8ab9aa01363696dc34db43abf89dae165b
7
+ data.tar.gz: 1a37cd012990169bb3e25072ee1ea433ecd3dc70e3e5f5a42a65cd6ce11634663efb92d83cadb160170110214c6ad3b3faa168057d843af11d861c36163a4775
@@ -7,6 +7,7 @@ require 'aromat/sym_keys'
7
7
  require 'aromat/str_keys'
8
8
  require 'aromat/duration'
9
9
  require 'aromat/dclone'
10
+ require 'aromat/dmerge'
10
11
  require 'aromat/module'
11
12
  require 'aromat/case'
12
13
  require 'aromat/date'
@@ -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
@@ -5,5 +5,5 @@
5
5
  module Aromat
6
6
 
7
7
  # Version
8
- VERSION = '1.4.2'
8
+ VERSION = '1.4.3'
9
9
  end
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.2
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: 2018-11-04 00:00:00.000000000 Z
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.6.14
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