Class: Factor::CLI::WorkflowTask
- Defined in:
- lib/cli/workflow_task.rb
Instance Method Summary collapse
-
#add(name, filename) ⇒ Object
method_option :key, :alias=>“-k”, :type=>:string, :desc=>“key reference” method_option :value, :alias=>“-v”, :type=>:string, :desc=>“values”.
- #call(workflow_name) ⇒ Object
-
#list ⇒ Object
method_option :key, :alias=>“-k”, :type=>:string, :desc=>“key reference”.
- #remove(name) ⇒ Object
Instance Method Details
#add(name, filename) ⇒ Object
method_option :key, :alias=>“-k”, :type=>:string, :desc=>“key reference” method_option :value, :alias=>“-v”, :type=>:string, :desc=>“values”
30 31 32 33 |
# File 'lib/cli/workflow_task.rb', line 30 def add(name,filename) contents=File.open(File.(filename), "rb") {|f| f.read} puts @client.add_workflow(name,contents) end |
#call(workflow_name) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/cli/workflow_task.rb', line 10 def call(workflow_name) puts "starting workflow #{workflow_name} with options #{.parameters.to_s}" engine = Factor::Runtime::Engine.new(get_config[:email],get_config[:token]) id = engine.launch(workflow_name,.parameters) puts "workflow executed with id #{id}" end |
#list ⇒ Object
method_option :key, :alias=>“-k”, :type=>:string, :desc=>“key reference”
23 24 25 |
# File 'lib/cli/workflow_task.rb', line 23 def list puts @client.get_workflows end |
#remove(name) ⇒ Object
36 37 38 |
# File 'lib/cli/workflow_task.rb', line 36 def remove(name) puts @client.remove_workflow(name) end |