Class: Pcrd::Output::ReadinessPrinter
- Inherits:
-
Object
- Object
- Pcrd::Output::ReadinessPrinter
- Defined in:
- lib/pcrd/output/readiness_printer.rb
Overview
Renders a Readiness::Manifest::Result: a per-table checklist of secondary objects, followed by a single block of DDL to run on the target before cutover.
Constant Summary collapse
- PASTEL =
Pastel.new
- ICONS =
{ present: PASTEL.green("✓"), missing: PASTEL.yellow("+"), needs_review: PASTEL.red("!"), info: PASTEL.dim("·") }.freeze
Instance Method Summary collapse
-
#initialize(output: $stdout) ⇒ ReadinessPrinter
constructor
A new instance of ReadinessPrinter.
- #print(result) ⇒ Object
Constructor Details
#initialize(output: $stdout) ⇒ ReadinessPrinter
Returns a new instance of ReadinessPrinter.
20 21 22 |
# File 'lib/pcrd/output/readiness_printer.rb', line 20 def initialize(output: $stdout) @out = output end |
Instance Method Details
#print(result) ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/pcrd/output/readiness_printer.rb', line 24 def print(result) @out.puts @out.puts PASTEL.bold("Target readiness") @out.puts PASTEL.dim("─" * 70) result.tables.each { |table| print_table(table) } print_ddl_section(result) print_legend end |