Class: LintTrap::Parser::Line

Inherits:
Base
  • Object
show all
Defined in:
lib/lint_trap/parser/line.rb

Overview

Handles parsing line by line with regex

Direct Known Subclasses

CSSLint, Standard, VimQuickfix

Instance Method Summary collapse

Methods inherited from Base

#name

Instance Method Details

#parse(io, container) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/lint_trap/parser/line.rb', line 7

def parse(io, container)
  output = ''

  io.each_line do |line|
    if (violation = parse_line(line, container))
      yield violation
    else
      output << line
    end
  end

  output
end