Sha256: 6589fc61a8bddb7a7bfca376dc4c924a790dfdaa03e3ee8a5e7dbaa909ed77c6
Contents?: true
Size: 747 Bytes
Versions: 3
Compression:
Stored size: 747 Bytes
Contents
class RenderMePretty::Erb class SyntaxErrorHandler < BaseHandler # spec/fixtures/invalid/syntax.erb:2: syntax error, unexpected ';', expecting ']' # ); if ENV['TEST' ; _erbout.<<(-" missing ending... # ^ # spec/fixtures/invalid/syntax.erb:12: syntax error, unexpected keyword_end, expecting end-of-input # end;end;end;end # ^~~ # # We will only find the first line number for the error. def find_line_number pattern = Regexp.new("#{@path}:(\\\d+): syntax error") lines = @exception.message.split("\n") found_line = lines.find do |line| line.match(pattern) end md = found_line.match(pattern) md[1].to_i # line_number end end end
Version data entries
3 entries across 3 versions & 2 rubygems