Class: Semaph::Shells::Pipeline::JobDebugCommand
- Inherits:
-
Object
- Object
- Semaph::Shells::Pipeline::JobDebugCommand
- Defined in:
- lib/semaph/shells/pipeline/job_debug_command.rb
Instance Attribute Summary collapse
-
#help ⇒ Object
readonly
Returns the value of attribute help.
-
#usage ⇒ Object
readonly
Returns the value of attribute usage.
Instance Method Summary collapse
- #execute(index_string) ⇒ Object
-
#initialize(job_collection) ⇒ JobDebugCommand
constructor
A new instance of JobDebugCommand.
Constructor Details
#initialize(job_collection) ⇒ JobDebugCommand
Returns a new instance of JobDebugCommand.
7 8 9 10 11 |
# File 'lib/semaph/shells/pipeline/job_debug_command.rb', line 7 def initialize(job_collection) @job_collection = job_collection @usage = "<job index>" @help = "debug job" end |
Instance Attribute Details
#help ⇒ Object (readonly)
Returns the value of attribute help.
5 6 7 |
# File 'lib/semaph/shells/pipeline/job_debug_command.rb', line 5 def help @help end |
#usage ⇒ Object (readonly)
Returns the value of attribute usage.
5 6 7 |
# File 'lib/semaph/shells/pipeline/job_debug_command.rb', line 5 def usage @usage end |
Instance Method Details
#execute(index_string) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/semaph/shells/pipeline/job_debug_command.rb', line 13 def execute(index_string) index = index_string.to_i - 1 job = @job_collection.all[index] unless job puts "There is no job at position #{index}" return end puts "Debugging #{job.description}" system("sem debug job #{job.id}") end |