Class: AdLint::Postfilter::StderrContent

Inherits:
FilteringContent show all
Defined in:
lib/adlint/postfilter/content.rb

Instance Method Summary collapse

Constructor Details

#initialize(str) ⇒ StderrContent

Returns a new instance of StderrContent.



64
65
66
67
68
69
70
71
72
73
# File 'lib/adlint/postfilter/content.rb', line 64

def initialize(str)
  lines = str.lines.each_with_object([]) { |line, ary|
    if line =~ /:(?:warning|context):/
      ary.push(PlainMessageLine.new(line.chomp))
    else
      ary.push(OrdinaryLine.new(line.chomp))
    end
  }
  super(lines)
end

Instance Method Details

#overwrite!Object



75
76
77
# File 'lib/adlint/postfilter/content.rb', line 75

def overwrite!
  $stderr.puts self.compact
end