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" }.freeze
- STYLES =
{ ok: :success, warning: :warning, error: :failure, info: :muted }.freeze
- COMMAND_LABELS =
{ review: 'Review', format: 'Format', prepare: 'Prepare', install: 'Install' }.freeze
- CONFIGURATION_STATES =
{ valid: [:success, "\u2713", 'is valid'], missing: [:muted, "\u00b7", 'not found'], invalid: [:failure, "\u2717", 'is invalid'] }.freeze
- LABEL_WIDTH =
15
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
33 34 35 36 |
# File 'lib/reviewer/doctor/formatter.rb', line 33 def initialize(output) @output = output @printer = output.printer end |
Instance Method Details
#print(report) ⇒ Object
Renders a full diagnostic report
40 41 42 43 44 |
# File 'lib/reviewer/doctor/formatter.rb', line 40 def print(report) print_header print_sections(report) print_summary(report) end |