aws-cfn-compiler 0.9.16 → 0.9.17
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/lib/aws/cfn/compiler/base.rb +3 -0
- data/lib/aws/cfn/compiler/mixins/parse.rb +36 -10
- data/lib/aws/cfn/compiler/version.rb +1 -1
- 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: c2105a3aa92d4cdb15dabc7291f32a9e713ed005
|
4
|
+
data.tar.gz: 272bb57033e267313b23d2c7a1994f3b2ae9c7fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd87a92ddf6f11014474efd1ed29c2437a120dc6124eb642f530c9cf08b4ac13ee9ec888d9aa311c945f65802e30ba6ad9f6d49fab38936f0d2b5c11d0f7252d
|
7
|
+
data.tar.gz: f9759dfd8f0705f55b10e24bb8ed221b97e6561ed86fe07a65a1e95b65a8af03499d77892aa632f7752d755a383e8af5846e22bd9c060cb2bfd70b7d640964e3
|
@@ -113,7 +113,26 @@ module Aws
|
|
113
113
|
next if content.size==0
|
114
114
|
|
115
115
|
if filename =~ /\.(rb|ruby)\z/i
|
116
|
-
|
116
|
+
dict = parse_rb_file(base, section, filename)
|
117
|
+
# Ruby bricks can now define resources across section boundaries!
|
118
|
+
dict.each do |sect, itmh|
|
119
|
+
# Simply merge all the items in the section we are working in as before
|
120
|
+
if sect == section
|
121
|
+
item.merge! itmh
|
122
|
+
else
|
123
|
+
# And for items in other sections define the section or check for dups
|
124
|
+
if @items.has_key?(sect)
|
125
|
+
itmh.each { |key|
|
126
|
+
if @items[sect].has_key?(key)
|
127
|
+
abort! " !! error: Duplicate item: #{sect}/#{key}"
|
128
|
+
end
|
129
|
+
}
|
130
|
+
else
|
131
|
+
@items[sect] ||= {}
|
132
|
+
end
|
133
|
+
@items[sect].merge! itmh
|
134
|
+
end
|
135
|
+
end
|
117
136
|
elsif filename =~ /\.js(|on)\z/i
|
118
137
|
item.merge! JSON.parse(content)
|
119
138
|
elsif filename =~ /\.ya?ml\z/i
|
@@ -151,21 +170,28 @@ module Aws
|
|
151
170
|
@items[section].merge! item
|
152
171
|
|
153
172
|
unless @items[section].keys.count == (spec[section].count + @dynamic_items[section].keys.count)
|
154
|
-
|
173
|
+
@logger.error "#{section} section check failed! \nRequested: #{spec[section]}\n Found: #{@items[section].keys}\n Dynamic: #{@dynamic_items[section].keys}\n"+
|
174
|
+
" !! Suspect that a #{section} item was missed, duplicated or not properly named (Brick name and file name mismatch?)!"
|
175
|
+
@dynamic_items[section].each do |k,_|
|
176
|
+
if @items.has_key?(k)
|
177
|
+
@logger.error "Dynamic #{section}/#{k} duplicates a static resource!"
|
178
|
+
end
|
179
|
+
end
|
180
|
+
abort! 'Cannot continue'
|
155
181
|
end
|
156
182
|
end
|
157
183
|
|
158
184
|
end
|
159
185
|
|
160
186
|
def parse_rb_file(base, section, filename)
|
161
|
-
Aws::Cfn::Compiler.binding
|
162
|
-
Aws::Cfn::Compiler.binding[section]
|
187
|
+
Aws::Cfn::Compiler.binding ||= {}
|
188
|
+
Aws::Cfn::Compiler.binding[section] ||= {}
|
163
189
|
Aws::Cfn::Compiler.binding[section][base] ||= {
|
164
|
-
brick_path
|
165
|
-
brick_path_list
|
166
|
-
template
|
167
|
-
logger
|
168
|
-
compiler
|
190
|
+
:brick_path => @config[:brick_path],
|
191
|
+
:brick_path_list => @config[:brick_path_list],
|
192
|
+
:template => @dsl,
|
193
|
+
:logger => @logger,
|
194
|
+
:compiler => self
|
169
195
|
}
|
170
196
|
source_file = File.expand_path(filename)
|
171
197
|
begin
|
@@ -176,7 +202,7 @@ module Aws
|
|
176
202
|
unless @dsl.dict[section.to_sym]
|
177
203
|
abort! "Unable to compile/expand #{filename} for #{section}/#{base}"
|
178
204
|
end
|
179
|
-
sym_to_s(@dsl.dict
|
205
|
+
sym_to_s(@dsl.dict)
|
180
206
|
end
|
181
207
|
|
182
208
|
def sym_to_s(hash)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-cfn-compiler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PKinney
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|