Class: Semaph::Shells::Project::WorkflowsListCommand
- Inherits:
-
Object
- Object
- Semaph::Shells::Project::WorkflowsListCommand
- Defined in:
- lib/semaph/shells/project/workflows_list_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(branch) ⇒ Object
-
#initialize(workflow_collection) ⇒ WorkflowsListCommand
constructor
A new instance of WorkflowsListCommand.
Constructor Details
#initialize(workflow_collection) ⇒ WorkflowsListCommand
Returns a new instance of WorkflowsListCommand.
9 10 11 12 13 |
# File 'lib/semaph/shells/project/workflows_list_command.rb', line 9 def initialize(workflow_collection) @workflow_collection = workflow_collection @usage = "<branch>" @help = "list available workflows" end |
Instance Attribute Details
#help ⇒ Object (readonly)
Returns the value of attribute help.
7 8 9 |
# File 'lib/semaph/shells/project/workflows_list_command.rb', line 7 def help @help end |
#usage ⇒ Object (readonly)
Returns the value of attribute usage.
7 8 9 |
# File 'lib/semaph/shells/project/workflows_list_command.rb', line 7 def usage @usage end |
Instance Method Details
#execute(branch) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/semaph/shells/project/workflows_list_command.rb', line 15 def execute(branch) @workflow_collection.reload @workflow_collection.all.slice(0..9).each_with_index do |workflow, index| next unless workflow.branch.include?(branch) pipelines = workflow.pipeline_collection.reload puts content(index, pipelines, workflow) end end |