Class: TexLogParser::FileLineError
- Inherits:
-
Object
- Object
- TexLogParser::FileLineError
- Includes:
- LogParser::RegExpPattern
- Defined in:
- lib/tex_log_parser/patterns/file_line_error.rb
Overview
Matches messages of this form:
./plain.tex:31: Undefined control sequence.
l.31 ...t contains some \ref{warnings} and \errors
for testing.
Instance Method Summary collapse
-
#initialize ⇒ FileLineError
constructor
Creates a new instance.
-
#read(lines) ⇒ Array<(Message, Int)>
Reads a message from the given lines.
Methods included from LogParser::RegExpPattern
Methods included from LogParser::Pattern
Constructor Details
permalink #initialize ⇒ FileLineError
Creates a new instance.
13 14 15 |
# File 'lib/tex_log_parser/patterns/file_line_error.rb', line 13 def initialize super(%r{^(/?(?:.*?/)*[^/]+):(\d+):}) end |
Instance Method Details
permalink #read(lines) ⇒ Array<(Message, Int)>
Reads a message from the given lines.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/tex_log_parser/patterns/file_line_error.rb', line 18 def read(lines) # @type [Message] msg msg, consumed = super(lines) msg.source_file = @start_match[1] line = @start_match[2].to_i msg.source_lines = { from: line, to: line } msg.preformatted = true msg.level = :error msg..gsub!(@start, '') [msg, consumed] end |