lib/aws/cfn/compiler/mixins/compile.rb in aws-cfn-compiler-0.9.12 vs lib/aws/cfn/compiler/mixins/compile.rb in aws-cfn-compiler-0.9.13

- old
+ new

@@ -31,34 +31,38 @@ when :Template File.basename(@config[:template]) when :DescriptionString v = nil begin - dependson = meta(:DependsOn) + dependson = meta(:DependsOn) || [] rescue dependson = [] end begin required = meta(:Require)['Template'] ok = true required.map { |e| ok = (ok and e.is_a?(Hash)) } if ok required = required.map { |e| e.keys }.flatten else - required = nil + required = {} end rescue - required = [] + required = {} end raise "Bad Require:Template: meta-data ...\n#{meta(:Require).ai}. Must resolve to a Hash!\nFor example:\nRequire:\n Template:\n - my-template: '>= 0.0.0'" unless required - if dependson or required - # noinspection RubyHashKeysTypesInspection - parents = {} - dependson.each { |i| parents[i] = true } - required.each { |i| parents[i] = true } - parents = "Parents: [#{parents.keys.join(',')}] " - else + begin + # if dependson or required + # noinspection RubyHashKeysTypesInspection + parents = {} + dependson.each { |i| parents[i] = true } + required.each { |i| parents[i] = true } + parents = "Parents: [#{parents.keys.join(',')}] " + # else + # parents = '' + # end + rescue parents = '' end # noinspection RubyExpressionInStringInspection template = '#{meta(:Project,:Description)}(#{meta(:Project,:Name)}) - #{meta(:Name)} v#{meta(:Version)}; #{parents} [Compiled with #{meta(:Compiler,:Name)} v#{meta(:Compiler,:Version)}]' begin @@ -72,10 +76,10 @@ end elsif args.is_a?(String) if spec[args] spec[args] else - raise "Meta:'#{args}' not set" + nil # raise "Meta:'#{args}' not set" end else nil end else