Class: MotherBrain::CliClient
- Inherits:
-
Object
- Object
- MotherBrain::CliClient
- Defined in:
- lib/mb/cli_client.rb
Overview
A class for encapsulating view behavior for a user of the CLI.
Constant Summary collapse
- SPACE =
" "
- TICK =
0.1
Instance Attribute Summary collapse
-
#current_status ⇒ Object
Returns the value of attribute current_status.
-
#job ⇒ Object
readonly
Returns the value of attribute job.
-
#last_spun ⇒ Object
Returns the value of attribute last_spun.
Instance Method Summary collapse
-
#display ⇒ Object
Block and wait for all jobs to be completed, while displaying the status of each job.
-
#initialize(job) ⇒ CliClient
constructor
A new instance of CliClient.
Constructor Details
#initialize(job) ⇒ CliClient
Returns a new instance of CliClient.
17 18 19 |
# File 'lib/mb/cli_client.rb', line 17 def initialize(job) @job = job end |
Instance Attribute Details
#current_status ⇒ Object
Returns the value of attribute current_status.
13 14 15 |
# File 'lib/mb/cli_client.rb', line 13 def current_status @current_status end |
#job ⇒ Object (readonly)
Returns the value of attribute job.
14 15 16 |
# File 'lib/mb/cli_client.rb', line 14 def job @job end |
#last_spun ⇒ Object
Returns the value of attribute last_spun.
13 14 15 |
# File 'lib/mb/cli_client.rb', line 13 def last_spun @last_spun end |
Instance Method Details
#display ⇒ Object
Block and wait for all jobs to be completed, while displaying the status of each job.
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/mb/cli_client.rb', line 23 def display if debugging? wait_for_jobs else display_jobs end if job_failed? display_log_location if log_location abort end end |