soar_xt 0.0.2 → 0.0.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
2
  SHA1:
3
- metadata.gz: a63b7998ae8fd91a721ee65c5a472c74db493057
4
- data.tar.gz: 82e75d0a54da9598193ee11c46b49f2d1ae2f982
3
+ metadata.gz: 25af9d72347cdf3329b070c8ea7b3abc712b4d66
4
+ data.tar.gz: 08773559ff64e489767df343cb73c09185b9efac
5
5
  SHA512:
6
- metadata.gz: 0ae7a7a2a5ee2320e1d2b3436688e2d1bda84fa1d7b8dd4afa85463ee296917412ab76e840b459b1efcaabc3b0f4a9e034912fc20228599046749f28fc31e01a
7
- data.tar.gz: 9fab66eb595e25f52132cbb5eeb81983121cb05de021b3ac9598e9697b9fd72eb30050a193ef09f7c81de1ae3b33d581c84b502279ed1bda1f613b7d910a1600
6
+ metadata.gz: d8ab982055a4ce8695a92574b3a0d8023ce38961f4cb18f9611f983187053e7b28eabede9b1e0b54be93dc4423d673bca3293f5d1ece356cec6e3f8e87d10ace
7
+ data.tar.gz: d35a50ec02233eb8663c58487bc77e0372e27a569ae5bccf2beeffe83664d34cae70178b9e551febfec2cbfe79d22f276824998de3a04dd26e3845dcc0aed127
@@ -1,36 +1,13 @@
1
1
  class ::Hash
2
- def self.deep_merge(first, second)
3
- # result = first
4
- if first.is_a?(Hash) and (second.is_a?(Hash))
5
- result = first.merge(second)
6
- # elsif first.is_a?(Array) and second.is_a?(Array)
7
- # return first + second
8
- # else
9
- # return second
10
- end
11
- first.each do |first_key, first_value|
12
- second.each do |second_key, second_value|
13
- if (first_key == second_key)
14
- if first_value.is_a?(Hash) and (second_value.is_a?(Hash))
15
- result[first_key] = Hash::deep_merge(first_value, second_value)
16
- elsif first_value.is_a?(Array) and (second_value.is_a?(Array))
17
- result[first_key] = first_value + second_value
18
- else
19
- puts "tbd"
20
- # result[first_key] = second_value
21
- end
22
- end
2
+ def self.deep_merge(a, b)
3
+ a.dup.merge(b) do |_,x,y|
4
+ if (x.is_a?(Hash) && y.is_a?(Hash))
5
+ deep_merge(x,y)
6
+ elsif x.is_a?(Array) && (y.is_a?(Array))
7
+ x + y
8
+ else
9
+ y
23
10
  end
24
- end
25
- result
11
+ end
26
12
  end
27
-
28
- # def self.value_has_hash?(value)
29
- # return nil if not value.is_a?(Hash)
30
- # keys = []
31
- # value.each do |k, v|
32
- # keys << k if v.is_a?(Hash)
33
- # end
34
- # keys
35
- # end
36
13
  end
@@ -1,3 +1,3 @@
1
1
  module SoarXt
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soar_xt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ernst van Graan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-01-25 00:00:00.000000000 Z
11
+ date: 2016-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler