stackup 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES.md +4 -0
- data/lib/stackup/version.rb +1 -1
- data/lib/stackup/yaml.rb +9 -1
- data/spec/stackup/yaml_spec.rb +44 -16
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c9d0cbe52d313a9ad01e52ecdcafe2aea23d6d8
|
4
|
+
data.tar.gz: 163eb98e0ba9964272923a0cf2e662a71e1e7cb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5b824056d0f90dc64ce89855bbdfdb2adee551b3a1808484f7b4b0493959933fe229215a536d95d7b6ac1ef95c94efefc2f8b25ea0d80f9fa39a95005e9a61a
|
7
|
+
data.tar.gz: e71264d5300ae3a771c05cb21ff4bcce9ca46fff6aff9794eeeeef8fb909aa5599104240255f572888aa434eef6609e284ccaf463d88579e9c05d65f36b8164e
|
data/CHANGES.md
CHANGED
data/lib/stackup/version.rb
CHANGED
data/lib/stackup/yaml.rb
CHANGED
@@ -48,7 +48,7 @@ module Stackup
|
|
48
48
|
when "!Ref"
|
49
49
|
{ "Ref" => super }
|
50
50
|
when "!GetAtt"
|
51
|
-
{ "Fn::GetAtt" => super
|
51
|
+
{ "Fn::GetAtt" => array_or_dotted_string(super) }
|
52
52
|
when "!GetAZs"
|
53
53
|
{ "Fn::GetAZs" => (super || "") }
|
54
54
|
when /^!(\w+)$/
|
@@ -58,6 +58,14 @@ module Stackup
|
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
61
|
+
def array_or_dotted_string(arg)
|
62
|
+
if arg.respond_to?(:split)
|
63
|
+
arg.split(".")
|
64
|
+
else
|
65
|
+
arg
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
61
69
|
end
|
62
70
|
|
63
71
|
end
|
data/spec/stackup/yaml_spec.rb
CHANGED
@@ -52,29 +52,57 @@ describe Stackup::YAML do
|
|
52
52
|
|
53
53
|
describe "!GetAtt" do
|
54
54
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
55
|
+
context "with an array" do
|
56
|
+
|
57
|
+
let(:input) do
|
58
|
+
<<-YAML
|
59
|
+
Outputs:
|
60
|
+
Foo: !GetAtt [Bar, Baz]
|
61
|
+
YAML
|
62
|
+
end
|
63
|
+
|
64
|
+
it "expands to Fn::GetAtt" do
|
65
|
+
expect(data).to eql(
|
66
|
+
"Outputs" => {
|
67
|
+
"Foo" => {
|
68
|
+
"Fn::GetAtt" => [
|
69
|
+
"Bar",
|
70
|
+
"Baz"
|
71
|
+
]
|
72
|
+
}
|
73
|
+
}
|
74
|
+
)
|
75
|
+
end
|
76
|
+
|
60
77
|
end
|
61
78
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
79
|
+
context "with a string" do
|
80
|
+
|
81
|
+
let(:input) do
|
82
|
+
<<-YAML
|
83
|
+
Outputs:
|
84
|
+
Foo: !GetAtt Bar.Baz
|
85
|
+
YAML
|
86
|
+
end
|
87
|
+
|
88
|
+
it "split on dot" do
|
89
|
+
expect(data).to eql(
|
90
|
+
"Outputs" => {
|
91
|
+
"Foo" => {
|
92
|
+
"Fn::GetAtt" => [
|
93
|
+
"Bar",
|
94
|
+
"Baz"
|
95
|
+
]
|
96
|
+
}
|
70
97
|
}
|
71
|
-
|
72
|
-
|
98
|
+
)
|
99
|
+
end
|
100
|
+
|
73
101
|
end
|
74
102
|
|
75
103
|
end
|
76
104
|
|
77
|
-
describe "!
|
105
|
+
describe "!GetAZs" do
|
78
106
|
|
79
107
|
context "with an argument" do
|
80
108
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stackup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Williams
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-12-
|
12
|
+
date: 2016-12-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: aws-sdk-resources
|