Class: Evostream::Runner
- Inherits:
-
Object
- Object
- Evostream::Runner
- Defined in:
- lib/evostream/cli/runner.rb
Overview
Execute CLI with this gem
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize ⇒ Runner
constructor
A new instance of Runner.
-
#run(args = ARGV) ⇒ Object
rubocop:disable Metrics/MethodLength.
Constructor Details
#initialize ⇒ Runner
29 30 31 32 |
# File 'lib/evostream/cli/runner.rb', line 29 def initialize CLI::Config.instance = CLI::Options.new end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
27 28 29 |
# File 'lib/evostream/cli/runner.rb', line 27 def end |
Instance Method Details
#run(args = ARGV) ⇒ Object
rubocop:disable Metrics/MethodLength
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/evostream/cli/runner.rb', line 35 def run(args = ARGV) .parse access_evostream? execute_runner(two_last_arg(args)) if args.count >= 1 rescue CodeError::Evostream::ConnectionFailed 201 rescue CodeError::Evostream::NoResult 200 rescue CodeError::Syntax::CommandInvalid 101 rescue CodeError::Syntax::OptionInvalid 100 rescue Evostream::Commands::Errors::MissingMandatory => error $stdout.puts error..red 50 rescue CodeError::Finished 0 end |