bosh-verifyconnections 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog.md +1 -0
- data/Guardfile +1 -0
- data/lib/bosh/cli/commands/verifyconnections.rb +1 -1
- data/lib/bosh/verifyconnections/models/deployment.rb +2 -2
- data/lib/bosh/verifyconnections/version.rb +1 -1
- data/lib/core-ext/{hash_deep_merge.rb → hash/deep_merge.rb} +0 -0
- data/lib/core-ext/{hash_to_dotted_notation.rb → hash/to_dotted_hash.rb} +10 -0
- data/spec/core-ext/hash/to_dotted_hash_spec.rb +12 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f25f5d50e5ee314d28693c880349f5c4deaaef8
|
4
|
+
data.tar.gz: 71bef84a3153e2e46d7e769abddb6bbf0028b6ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68cf9781479536c921fd33358508b445bc10302cbb5c658e82a6298f31a60d3b0ee895def00ef0370c62797c1a18942f9eee8d65896ee9b84a1bb142cad77858
|
7
|
+
data.tar.gz: 662baeee9ff26390bcc9796815a657c13dfecdbae52d328cf4512ed0ed930da055545ada4b5f242bd751519bdb5664771d840c05d0bdeb6fd4b565263f236408
|
data/ChangeLog.md
CHANGED
data/Guardfile
CHANGED
File without changes
|
@@ -5,6 +5,16 @@ class Hash
|
|
5
5
|
key = recursive_key + k.to_s
|
6
6
|
if v.is_a? Hash
|
7
7
|
ret.merge!(v.to_dotted_hash(key + "."))
|
8
|
+
elsif v.is_a?(Array)
|
9
|
+
if v.first.is_a?(Hash)
|
10
|
+
v.each_with_index do |item, index|
|
11
|
+
ret.merge!(item.to_dotted_hash(key + "[#{index}]."))
|
12
|
+
end
|
13
|
+
else
|
14
|
+
v.each_with_index do |item, index|
|
15
|
+
ret[key + "[#{index}]"] = item
|
16
|
+
end
|
17
|
+
end
|
8
18
|
else
|
9
19
|
ret[key] = v
|
10
20
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
describe "Hash#to_dotted_hash" do
|
2
|
+
it { expect({}.to_dotted_hash).to eq({}) }
|
3
|
+
it { expect({"foo" => "bar"}.to_dotted_hash).to eq({"foo" => "bar"}) }
|
4
|
+
it { expect({foo: "bar"}.to_dotted_hash).to eq({"foo" => "bar"}) }
|
5
|
+
it { expect({foo: {bar: "baz"}}.to_dotted_hash).to eq({"foo.bar" => "baz"}) }
|
6
|
+
|
7
|
+
context "arrays" do
|
8
|
+
it { expect({foo: {bar: []}}.to_dotted_hash).to eq({}) }
|
9
|
+
it { expect({foo: {bar: ["a", "b"]}}.to_dotted_hash).to eq({"foo.bar[0]" => "a", "foo.bar[1]" => "b"}) }
|
10
|
+
it { expect({foo: [{bar: "baz"}, {alpha: 123}]}.to_dotted_hash).to eq({"foo[0].bar" => "baz", "foo[1].alpha" => 123}) }
|
11
|
+
end
|
12
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bosh-verifyconnections
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dr Nic Williams
|
@@ -105,8 +105,9 @@ files:
|
|
105
105
|
- lib/bosh/verifyconnections/models/deployment_job.rb
|
106
106
|
- lib/bosh/verifyconnections/models/director.rb
|
107
107
|
- lib/bosh/verifyconnections/version.rb
|
108
|
-
- lib/core-ext/
|
109
|
-
- lib/core-ext/
|
108
|
+
- lib/core-ext/hash/deep_merge.rb
|
109
|
+
- lib/core-ext/hash/to_dotted_hash.rb
|
110
|
+
- spec/core-ext/hash/to_dotted_hash_spec.rb
|
110
111
|
- spec/fixtures/combination_of_correct_dns_and_static_ip_connections.yml
|
111
112
|
- spec/fixtures/job_with_static_ips_but_not_referenced.yml
|
112
113
|
- spec/fixtures/property_is_bosh_dns_but_not_for_bosh_job.yml
|
@@ -140,6 +141,7 @@ specification_version: 4
|
|
140
141
|
summary: Performs job interconnection verifications upon the target BOSH deployment
|
141
142
|
manifest file.
|
142
143
|
test_files:
|
144
|
+
- spec/core-ext/hash/to_dotted_hash_spec.rb
|
143
145
|
- spec/fixtures/combination_of_correct_dns_and_static_ip_connections.yml
|
144
146
|
- spec/fixtures/job_with_static_ips_but_not_referenced.yml
|
145
147
|
- spec/fixtures/property_is_bosh_dns_but_not_for_bosh_job.yml
|