Class: Floe::CLI
Instance Method Summary collapse
-
#initialize ⇒ CLI
constructor
A new instance of CLI.
- #run(args = ARGV) ⇒ Object
Methods included from Logging
Constructor Details
Instance Method Details
#run(args = ARGV) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/floe/cli.rb', line 16 def run(args = ARGV) workflows_inputs, opts = (args) credentials = create_credentials(opts) workflows = workflows_inputs.each_slice(2).map do |workflow, input| create_workflow(workflow, opts[:context], input, credentials) end output_streams = create_loggers(workflows, opts[:segment_output]) logger.info("Checking #{workflows.count} workflows...") ready = Floe::Workflow.wait(workflows, &:run_nonblock) logger.info("Checking #{workflows.count} workflows...Complete - #{ready.count} ready") # Display status workflows.each do |workflow| if workflows.size > 1 logger.info("") logger.info("#{workflow.name}#{" (#{workflow.status})" unless workflow.context.success?}") logger.info("===") end logger.info(output_streams[workflow].string) if output_streams[workflow] logger.info(workflow.output) end workflows.all? { |workflow| workflow.context.success? } rescue Floe::Error => err abort(err.) end |