Class: RubyLint::Presenter::Syntastic
- Defined in:
- lib/ruby-lint/presenter/syntastic.rb
Overview
Presenter that formats output that can be easily used in Syntastic plugins.
Constant Summary
- FORMAT =
The format to use for each entry.
'%{file}:%{level}:%{line}:%{column}: %{message}'
Instance Method Summary collapse
-
#initialize(format = FORMAT.dup) ⇒ Syntastic
constructor
A new instance of Syntastic.
-
#present(report) ⇒ String
Methods inherited from Base
Constructor Details
#initialize(format = FORMAT.dup) ⇒ Syntastic
Returns a new instance of Syntastic
20 21 22 |
# File 'lib/ruby-lint/presenter/syntastic.rb', line 20 def initialize(format = FORMAT.dup) @format = format end |
Instance Method Details
#present(report) ⇒ String
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/ruby-lint/presenter/syntastic.rb', line 28 def present(report) entries = [] report.entries.sort.each do |entry| attributes = entry.attributes attributes[:level] = attributes[:level][0].upcase entries << @format % attributes end return entries.join("\n") end |