class Stacker::Stack::TemplateSyntaxError

Attributes

path[R]

Public Class Methods

new(path) click to toggle source
# File lib/stacker/stack/errors.rb, line 53
def initialize(path)
  @path = path
end

Public Instance Methods

message() click to toggle source
# File lib/stacker/stack/errors.rb, line 57
      def message
        <<END_MSG
Syntax error(s) in template.
#{path}:
#{errors}
END_MSG
      end

Private Instance Methods

errors() click to toggle source
# File lib/stacker/stack/errors.rb, line 69
def errors
  @errors ||= begin
    linter.check path
    linter.errors.values.join "\n"
  end
end
linter() click to toggle source
# File lib/stacker/stack/errors.rb, line 76
def linter
  linter ||= if path.end_with? '.json'
    JsonLint::Linter.new
  else
    YamlLint::Linter.new
  end
end