meld 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fac5c1b8652001fe735a25c14c1b28cd67f401df
4
- data.tar.gz: a800d28e9b6541de6398d3463b9127964b2d89c0
3
+ metadata.gz: d28b02559c91c8dc55627f5ddbeca8c27d6accb6
4
+ data.tar.gz: 027e2e81e919e098d51eefc0465101e5af2e2e9e
5
5
  SHA512:
6
- metadata.gz: a0632aaf890b028e16de705a8ad4eb94c35f52f3f2b76f7c5bb712238b20316610063fc2635927b4c02d1885871a5d56ef79190dd3bdeaa928187fec1142c9ca
7
- data.tar.gz: b0cbcac640c05d0e37c1d750f73e903e412d53613cf5e5755802114ebb53df6a0b8c7ce5575855054eccfe8d4dfb3183445f320ce94e45b61ad5fc403cc245f4
6
+ metadata.gz: a6c8eb2a81ad1bc078ce6bea8b0585701045792747e534691aa676e6e7d2d3cc9fc2c192038452abc9fe5bf98657d0294fcc092dd52b10cf9a96231803ada0e0
7
+ data.tar.gz: 71720e7ce7e01ef288564df301bd043994a45941d96e356c9d26893ae8507f8c33328104b5df45ff0e76a171cf3aa7c2209dcbd94c9cf23538fb925462450bf8
@@ -1 +1 @@
1
- require 'meld/deep_hash_merge'
1
+ require 'meld/hash/deep_merge'
@@ -2,11 +2,15 @@ module Kernel
2
2
  # From https://gist.github.com/ku/e17e3d65ec4c37b60149
3
3
  # From http://stackoverflow.com/questions/9381553/ruby-merge-nested-hash
4
4
  class Hash
5
- def deep_merge(second)
5
+ def deep_merge!(second)
6
6
  merger = proc do |_, v1, v2|
7
7
  [v1, v2].all? { |x| x.is_a? Hash } ? v1.merge(v2, &merger) : v2
8
8
  end
9
- merge(second, &merger)
9
+ merge!(second, &merger)
10
+ end
11
+
12
+ def deep_merge(second)
13
+ dup.deep_merge! second
10
14
  end
11
15
  end
12
16
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'meld'
3
- s.version = '0.0.1'
3
+ s.version = '0.0.2'
4
4
  s.date = Time.now.strftime("%Y-%m-%d")
5
5
 
6
6
  s.summary = 'Utility library for combining objects'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meld
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Les Aker
@@ -95,7 +95,7 @@ files:
95
95
  - README.md
96
96
  - Rakefile
97
97
  - lib/meld.rb
98
- - lib/meld/deep_hash_merge.rb
98
+ - lib/meld/hash/deep_merge.rb
99
99
  - meld.gemspec
100
100
  - spec/meld_spec.rb
101
101
  - spec/spec_helper.rb