lib/aws/cfn/compiler.rb in aws-cfn-compiler-0.2.1 vs lib/aws/cfn/compiler.rb in aws-cfn-compiler-0.2.3

- old
+ new

@@ -123,18 +123,18 @@ end rescue # pass end if File.exists?(abs) - raise 'Unsupported specification file type' unless abs =~ /\.(json|ya?ml)\z/i + raise "Unsupported specification file type: #{spec}=>#{abs}\n\tSupported types are: json,yaml,jts,yts\n" unless abs =~ /\.(json|ya?ml|jts|yts)\z/i puts "Loading specification #{abs}..." spec = File.read(abs) case File.extname(File.basename(abs)).downcase - when /json/ + when /json|jts/ @spec = JSON.parse(spec) - when /yaml/ + when /yaml|yts/ @spec = YAML.load(spec) else raise "Unsupported file type for specification: #{spec}" end # @spec = spec