Class: Pcrd::Output::PreflightPrinter
- Inherits:
-
Object
- Object
- Pcrd::Output::PreflightPrinter
- Defined in:
- lib/pcrd/output/preflight_printer.rb
Constant Summary collapse
- PASTEL =
Pastel.new
- ICONS =
{ pass: PASTEL.green("✓"), fail: PASTEL.red("✗"), warn: PASTEL.yellow("⚠"), info: PASTEL.dim("·") }.freeze
Instance Method Summary collapse
-
#initialize(output: $stdout) ⇒ PreflightPrinter
constructor
A new instance of PreflightPrinter.
- #print(result) ⇒ Object
Constructor Details
#initialize(output: $stdout) ⇒ PreflightPrinter
Returns a new instance of PreflightPrinter.
17 18 19 |
# File 'lib/pcrd/output/preflight_printer.rb', line 17 def initialize(output: $stdout) @out = output end |
Instance Method Details
#print(result) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/pcrd/output/preflight_printer.rb', line 21 def print(result) @out.puts @out.puts PASTEL.bold("Preflight check") @out.puts PASTEL.dim("─" * 70) @out.puts result.items.each { |item| print_item(item) } @out.puts print_ddl_section(result.ddl_map) if result.ddl_map.any? print_estimate_section(result.row_counts, result) if result.row_counts.any? print_summary(result) end |