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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6c4a334512da7885f29d7a253125d28b695c3114
4
- data.tar.gz: 99367e21389c1bdd4de0cec19c8d5a123a11d52c
3
+ metadata.gz: 9c9d0cbe52d313a9ad01e52ecdcafe2aea23d6d8
4
+ data.tar.gz: 163eb98e0ba9964272923a0cf2e662a71e1e7cb4
5
5
  SHA512:
6
- metadata.gz: bb9daf71849f2ff43f46a2fe6404dd640d988eed6c9bad189174ae4d5e3e74b10f4d2202d944c657f6223306b6cfe9b4426a9ae5080fde0e5bd294b38f3442a2
7
- data.tar.gz: 1f5151bb1eed01ff870bec7710db39243a30d80cc3938defa3b8cfee12fec209ebb01b964d1d1181f9256f3c20e0d51222c9da7f86f342c1c927c45d7224d880
6
+ metadata.gz: b5b824056d0f90dc64ce89855bbdfdb2adee551b3a1808484f7b4b0493959933fe229215a536d95d7b6ac1ef95c94efefc2f8b25ea0d80f9fa39a95005e9a61a
7
+ data.tar.gz: e71264d5300ae3a771c05cb21ff4bcce9ca46fff6aff9794eeeeef8fb909aa5599104240255f572888aa434eef6609e284ccaf463d88579e9c05d65f36b8164e
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.0.3 (2016-12-19)
2
+
3
+ * Support "!GetAtt" with an array (rather than dotted string).
4
+
1
5
  ## 1.0.2 (2016-12-19)
2
6
 
3
7
  * Add `tags` subcommand.
@@ -1,5 +1,5 @@
1
1
  module Stackup
2
2
 
3
- VERSION = "1.0.2"
3
+ VERSION = "1.0.3"
4
4
 
5
5
  end
@@ -48,7 +48,7 @@ module Stackup
48
48
  when "!Ref"
49
49
  { "Ref" => super }
50
50
  when "!GetAtt"
51
- { "Fn::GetAtt" => super.split(".") }
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
@@ -52,29 +52,57 @@ describe Stackup::YAML do
52
52
 
53
53
  describe "!GetAtt" do
54
54
 
55
- let(:input) do
56
- <<-YAML
57
- Outputs:
58
- Foo: !GetAtt Bar.Baz
59
- YAML
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
- it "expands to Fn::GetAtt" do
63
- expect(data).to eql(
64
- "Outputs" => {
65
- "Foo" => {
66
- "Fn::GetAtt" => [
67
- "Bar",
68
- "Baz"
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 "!GetAtt" do
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.2
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-18 00:00:00.000000000 Z
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