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 rubocop:disable Naming/RescuedExceptionsVariableName.
Constructor Details
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
27 28 29 |
# File 'lib/evostream/cli/runner.rb', line 27 def @options end |
Instance Method Details
#run(args = ARGV) ⇒ Object
rubocop:disable Metrics/MethodLength rubocop:disable Naming/RescuedExceptionsVariableName
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/evostream/cli/runner.rb', line 36 def run(args = ARGV) @options.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 |