Class: Semaph::Shells::Pipeline::JobsPollCommand
- Inherits:
-
Object
- Object
- Semaph::Shells::Pipeline::JobsPollCommand
- Defined in:
- lib/semaph/shells/pipeline/jobs_poll_command.rb
Instance Attribute Summary collapse
-
#help ⇒ Object
readonly
Returns the value of attribute help.
-
#job_collection ⇒ Object
readonly
Returns the value of attribute job_collection.
-
#usage ⇒ Object
readonly
Returns the value of attribute usage.
Instance Method Summary collapse
- #execute(_whatever = nil) ⇒ Object
-
#initialize(job_collection, list_command) ⇒ JobsPollCommand
constructor
A new instance of JobsPollCommand.
Constructor Details
#initialize(job_collection, list_command) ⇒ JobsPollCommand
Returns a new instance of JobsPollCommand.
9 10 11 12 13 14 |
# File 'lib/semaph/shells/pipeline/jobs_poll_command.rb', line 9 def initialize(job_collection, list_command) @job_collection = job_collection @list_command = list_command @help = "poll jobs" @can_notify = !`which terminal-notifier`.chomp.empty? end |
Instance Attribute Details
#help ⇒ Object (readonly)
Returns the value of attribute help.
7 8 9 |
# File 'lib/semaph/shells/pipeline/jobs_poll_command.rb', line 7 def help @help end |
#job_collection ⇒ Object (readonly)
Returns the value of attribute job_collection.
7 8 9 |
# File 'lib/semaph/shells/pipeline/jobs_poll_command.rb', line 7 def job_collection @job_collection end |
#usage ⇒ Object (readonly)
Returns the value of attribute usage.
7 8 9 |
# File 'lib/semaph/shells/pipeline/jobs_poll_command.rb', line 7 def usage @usage end |
Instance Method Details
#execute(_whatever = nil) ⇒ Object
16 17 18 19 20 |
# File 'lib/semaph/shells/pipeline/jobs_poll_command.rb', line 16 def execute(_whatever = nil) puts "Polling #{job_collection.pipeline.workflow.description}:" report_and_reload(15) while job_collection.incomplete.count.positive? && job_collection.failed.count.zero? report_final end |