Class: Qtrix::CLI::Base

Inherits:
Object
  • Object
show all
Includes:
Mixlib::CLI
Defined in:
lib/qtrix/cli.rb

Direct Known Subclasses

ConfigSets, Overrides, Queues

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stdout = STDOUT, stderr = STDERR) ⇒ Base

Returns a new instance of Base.



10
11
12
13
14
# File 'lib/qtrix/cli.rb', line 10

def initialize(stdout=STDOUT, stderr=STDERR)
  super()
  @stdout = stdout
  @stderr = stderr
end

Instance Attribute Details

#stderrObject (readonly)

Returns the value of attribute stderr.



8
9
10
# File 'lib/qtrix/cli.rb', line 8

def stderr
  @stderr
end

#stdoutObject (readonly)

Returns the value of attribute stdout.



8
9
10
# File 'lib/qtrix/cli.rb', line 8

def stdout
  @stdout
end

Instance Method Details

#execObject



16
17
18
19
20
21
22
23
24
25
# File 'lib/qtrix/cli.rb', line 16

def exec
  Qtrix.connection_config(config)
  unless exec_behavior
    msg = "no appropriate combination of options.\n\n"
    msg += "Type 'bundle exec [command] --help' for usage"
    error(msg)
  end
rescue StandardError => e
  error("Failure: #{e}")
end