Class: MinceMigrator::StatusReport
- Inherits:
-
Object
- Object
- MinceMigrator::StatusReport
- Includes:
- CommandLineReporter
- Defined in:
- lib/mince_migrator/status_report.rb
Instance Attribute Summary collapse
-
#migration ⇒ Object
readonly
Returns the value of attribute migration.
Instance Method Summary collapse
-
#initialize(migration) ⇒ StatusReport
constructor
A new instance of StatusReport.
- #run ⇒ Object
Constructor Details
#initialize(migration) ⇒ StatusReport
Returns a new instance of StatusReport.
9 10 11 |
# File 'lib/mince_migrator/status_report.rb', line 9 def initialize(migration) @migration = migration end |
Instance Attribute Details
#migration ⇒ Object (readonly)
Returns the value of attribute migration.
7 8 9 |
# File 'lib/mince_migrator/status_report.rb', line 7 def migration @migration end |
Instance Method Details
#run ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/mince_migrator/status_report.rb', line 13 def run vertical_spacing 2 header title: "Migration Details for #{migration.name}", bold: true, rule: true, align: 'center', width: 70, timestamp: true table border: false do row do column 'Name', width: 15 column migration.name, width: 100 end row do column 'Status' if migration.status == 'not ran' column migration.status, color: 'red' else column migration.status, color: 'green' end end row do column 'Age' column migration.age end row do column 'Date Created' column migration.time_created.strftime("%m/%d/%Y") end end end |