Sha256: 95d9a612392f8133be0e8a3c3b3e277ad54db85a3f3d57618e7b5acac759fdcf

Contents?: true

Size: 877 Bytes

Versions: 54

Compression:

Stored size: 877 Bytes

Contents

module Eco
  class CLI

    def initialize
      @config = nil
    end

    def args
      ARGV
    end

    def options
      @options ||= {}
    end

    def config
      @config ||= Eco::CLI::Config.new(cli: self)
      @config.tap do |cnf|
        yield(cnf) if block_given?
      end
    end

    def run(session:)
      io = Eco::API::UseCases::BaseIO.new(session: session, options: options)
      #session.workflow.run(io: io)
      session.workflow(io: io) do |wf, io|
        io = wf.run(:options, io: io)
        io = wf.run(:load, io: io)
        io = wf.run(:usecases, io: io)
        io = wf.run(:launch_jobs, io: io)
        io = wf.run(:post_launch, io: io)
        io = wf.run(:end, io: io)
        io = wf.run(:close, io: io)
      end
    end

  end
end

require_relative 'cli/scripting'
require_relative 'cli/config'

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
eco-helpers-2.0.11 lib/eco/cli.rb
eco-helpers-2.0.10 lib/eco/cli.rb
eco-helpers-2.0.9 lib/eco/cli.rb
eco-helpers-2.0.8 lib/eco/cli.rb
eco-helpers-2.0.7 lib/eco/cli.rb
eco-helpers-2.0.6 lib/eco/cli.rb
eco-helpers-2.0.5 lib/eco/cli.rb
eco-helpers-2.0.4 lib/eco/cli.rb
eco-helpers-2.0.3 lib/eco/cli.rb
eco-helpers-2.0.2 lib/eco/cli.rb
eco-helpers-1.5.15 lib/eco/cli.rb
eco-helpers-1.5.14 lib/eco/cli.rb
eco-helpers-1.5.13 lib/eco/cli.rb
eco-helpers-1.5.12 lib/eco/cli.rb
eco-helpers-1.5.11 lib/eco/cli.rb
eco-helpers-1.5.10 lib/eco/cli.rb
eco-helpers-1.5.9 lib/eco/cli.rb
eco-helpers-1.5.8 lib/eco/cli.rb
eco-helpers-1.5.7 lib/eco/cli.rb
eco-helpers-1.5.6 lib/eco/cli.rb