Class: Railbow::Status::Printer
- Inherits:
-
Object
- Object
- Railbow::Status::Printer
- Defined in:
- lib/railbow/status/printer.rb
Overview
Turns collected sections into output. The only place db:migrate:status writes to stdout, which is what lets a multi-database run share column widths and print a single header.
A run holding one database renders exactly as it did before multi-database support existed: no overview line, no section rule, nothing new.
Constant Summary collapse
- RULE =
"─"- COLLAPSED =
"⋯"- PURPLE =
Table::Themes::PURPLE
- RESET =
Formatters::Base::RESET
- DEFAULT_RULE_WIDTH =
60
Instance Method Summary collapse
-
#initialize(sections, skipped: []) ⇒ Printer
constructor
A new instance of Printer.
- #print ⇒ Object
Constructor Details
#initialize(sections, skipped: []) ⇒ Printer
Returns a new instance of Printer.
26 27 28 29 30 |
# File 'lib/railbow/status/printer.rb', line 26 def initialize(sections, skipped: []) @sections = Array(sections) @skipped = skipped @formatter = Formatters::Base.new end |
Instance Method Details
#print ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/railbow/status/printer.rb', line 32 def print return print_solo(sections.first) if solo? print_overview Railbow::Params.db_inline? ? print_inline : print_sections print_skipped end |