Module: Reek::Report::Formatter Private
- Defined in:
- lib/reek/report/formatter.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Formatter handling the formatting of the report at large. Formatting of the individual warnings is handled by the passed-in warning formatter.
Class Method Summary collapse
- .format_list(warnings, formatter = SimpleWarningFormatter.new) ⇒ Object private
- .header(examiner) ⇒ Object private
Class Method Details
.format_list(warnings, formatter = SimpleWarningFormatter.new) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
12 13 14 15 16 |
# File 'lib/reek/report/formatter.rb', line 12 def self.format_list(warnings, formatter = SimpleWarningFormatter.new) warnings.map do |warning| " #{formatter.format warning}" end.join("\n") end |
.header(examiner) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
18 19 20 21 22 23 24 |
# File 'lib/reek/report/formatter.rb', line 18 def self.header(examiner) count = examiner.smells_count result = Rainbow("#{examiner.description} -- ").cyan + Rainbow("#{count} warning").yellow result += Rainbow('s').yellow unless count == 1 result end |