class ActionView::SyntaxErrorInTemplate

:nodoc:

def annotated_source_code

def annotated_source_code
  @offending_code_string.split("\n").map.with_index(1) { |line, index|
    indentation = " " * 4
    "#{index}:#{indentation}#{line}"
  }
end

def initialize(template, offending_code_string)

:nodoc:
def initialize(template, offending_code_string)
  @offending_code_string = offending_code_string
  super(template)
end

def message

def message
  if template.is_a?(Template::Inline)
    <<~MESSAGE
      Encountered a syntax error while rendering template: check #{@offending_code_string}
    MESSAGE
  else
    "Encountered a syntax error while rendering template located at: #{template.short_identifier}"
  end
end