lib/aws/cfn/compiler/mixins/parse.rb in aws-cfn-compiler-0.9.9 vs lib/aws/cfn/compiler/mixins/parse.rb in aws-cfn-compiler-0.9.12
- old
+ new
@@ -77,10 +77,11 @@
logStep "Parsing #{section}..."
if spec and spec[section]
@items ||= {}
@items[section] ||= {}
+ @dynamic_items[section] ||= {}
get = {}
item = {}
spec[section].each do |rsrc|
@logger.debug "\tUsing #{section}::#{rsrc}"
refp,sub,base,rel = map_resource_reference(rsrc)
@@ -123,20 +124,25 @@
rescue
abort! " !! error: #{$!}"
end
else
- abort! " !! error: #{section}/#{base} not found!"
+ pm = []
+ set.map { |r,f|
+ b = File.basename(f).gsub( %r(\..*?$), '' )
+ pm << b if b.downcase == rsrc.downcase
+ }
+ abort! " !! error: #{section}/#{base} not found! Possible matches: #{pm}"
end
end
item.keys.each { |key|
if @items[section].has_key?(key)
abort! " !! error: Duplicate item: #{section}/#{key}"
end
}
@items[section].merge! item
- unless @items[section].keys.count == spec[section].count
+ unless @items[section].keys.count == (spec[section].count + @dynamic_items[section].keys.count)
abort! " !! error: Suspect that a #{section} item was missed or not properly named (Brick name and file name mismatch?)! \nRequested: #{spec[section]}\n Found: #{@items[section].keys}"
end
end
end