Class: Themigrator::MigrationProgress
- Inherits:
-
Object
- Object
- Themigrator::MigrationProgress
- Includes:
- Logger
- Defined in:
- lib/themigrator/migration_progress.rb
Overview
MigrationProgress takes the main log fails and parse it.
Constant Summary
Constants included from Logger
Instance Attribute Summary collapse
-
#actions ⇒ Object
readonly
Returns the value of attribute actions.
-
#cbks ⇒ Object
writeonly
Sets the attribute cbks.
-
#current_action ⇒ Object
readonly
Returns the value of attribute current_action.
-
#pid ⇒ Object
readonly
Returns the value of attribute pid.
-
#roles ⇒ Object
readonly
Returns the value of attribute roles.
-
#run_id ⇒ Object
readonly
Returns the value of attribute run_id.
-
#start_time ⇒ Object
readonly
Returns the value of attribute start_time.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(dir, run_id) ⇒ MigrationProgress
constructor
:has_roles :start_action :start_role_action :end_action :end_role_action :start_migration :end_migration.
- #log_file(role, action) ⇒ Object
- #start ⇒ Object
Methods included from Logger
#close_logger, #init_logger, #log, #log_dir, #log_path, #logger, #main_log_path
Constructor Details
#initialize(dir, run_id) ⇒ MigrationProgress
:has_roles :start_action :start_role_action :end_action :end_role_action :start_migration :end_migration
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/themigrator/migration_progress.rb', line 24 def initialize(dir, run_id) @dir = dir @run_id = run_id @log_file_path = main_log_path(dir, run_id) @roles = [] @current_action = nil @cbks = {} @actions = Hash.new do |h, k| h[k] = { start_time: nil, roles: Hash.new { |rh, rk| rh[rk] = {} }, end_time: nil } end end |
Instance Attribute Details
#actions ⇒ Object (readonly)
Returns the value of attribute actions.
9 10 11 |
# File 'lib/themigrator/migration_progress.rb', line 9 def actions @actions end |
#cbks=(value) ⇒ Object (writeonly)
Sets the attribute cbks
11 12 13 |
# File 'lib/themigrator/migration_progress.rb', line 11 def cbks=(value) @cbks = value end |
#current_action ⇒ Object (readonly)
Returns the value of attribute current_action.
9 10 11 |
# File 'lib/themigrator/migration_progress.rb', line 9 def current_action @current_action end |
#pid ⇒ Object (readonly)
Returns the value of attribute pid.
9 10 11 |
# File 'lib/themigrator/migration_progress.rb', line 9 def pid @pid end |
#roles ⇒ Object (readonly)
Returns the value of attribute roles.
9 10 11 |
# File 'lib/themigrator/migration_progress.rb', line 9 def roles @roles end |
#run_id ⇒ Object (readonly)
Returns the value of attribute run_id.
9 10 11 |
# File 'lib/themigrator/migration_progress.rb', line 9 def run_id @run_id end |
#start_time ⇒ Object (readonly)
Returns the value of attribute start_time.
9 10 11 |
# File 'lib/themigrator/migration_progress.rb', line 9 def start_time @start_time end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
9 10 11 |
# File 'lib/themigrator/migration_progress.rb', line 9 def status @status end |
Instance Method Details
#log_file(role, action) ⇒ Object
40 41 42 |
# File 'lib/themigrator/migration_progress.rb', line 40 def log_file(role, action) log_path(@dir, @run_id, role, action) end |
#start ⇒ Object
44 45 46 |
# File 'lib/themigrator/migration_progress.rb', line 44 def start start_log_parser end |