Class: Reviewer::Doctor::Formatter
- Inherits:
-
Object
- Object
- Reviewer::Doctor::Formatter
- Includes:
- Output::Formatting
- Defined in:
- lib/reviewer/doctor/formatter.rb
Overview
Display logic for diagnostic reports
Constant Summary collapse
- SYMBOLS =
{ ok: "\u2713", warning: '!', error: "\u2717", info: "\u00b7", muted: "\u00b7" }.freeze
- STYLES =
{ ok: :success, warning: :warning, error: :failure, info: :muted, muted: :muted }.freeze
- SECTION_LABELS =
{ configuration: 'Configuration', tools: 'Tools', opportunities: 'Opportunities', environment: 'Environment' }.freeze
Constants included from Output::Formatting
Output::Formatting::CHECKMARK, Output::Formatting::XMARK
Instance Method Summary collapse
-
#initialize(output) ⇒ Formatter
constructor
Creates a formatter for diagnostic report display.
-
#print(report) ⇒ Object
Renders a full diagnostic report.
Constructor Details
#initialize(output) ⇒ Formatter
Creates a formatter for diagnostic report display
28 29 30 31 |
# File 'lib/reviewer/doctor/formatter.rb', line 28 def initialize(output) @output = output @printer = output.printer end |
Instance Method Details
#print(report) ⇒ Object
Renders a full diagnostic report
35 36 37 38 39 40 41 42 |
# File 'lib/reviewer/doctor/formatter.rb', line 35 def print(report) output.newline Doctor::Report::SECTIONS.each do |section| findings = report.section(section) print_section(section, findings) if findings.any? end print_summary(report) end |