Class: Rubocop::Report::PlainText

Inherits:
Report
  • Object
show all
Defined in:
lib/rubocop/report/plain_text.rb

Overview

Plain text report, suitable for display in terminals.

Direct Known Subclasses

EmacsStyle

Instance Attribute Summary

Attributes inherited from Report

#filename

Instance Method Summary collapse

Methods inherited from Report

#<<, #empty?, #entries, #initialize

Constructor Details

This class inherits a constructor from Rubocop::Report::Report

Instance Method Details

#display(stream = $stdout) ⇒ Object



13
14
15
# File 'lib/rubocop/report/plain_text.rb', line 13

def display(stream = $stdout)
  stream.puts generate
end

#generateObject

Generates a string representation of the report



8
9
10
11
# File 'lib/rubocop/report/plain_text.rb', line 8

def generate
  report = "== #{filename} ==\n".color(:yellow)
  report << entries.join("\n")
end