Class: ConfigKit::Cli::Describe

Inherits:
Command
  • Object
show all
Defined in:
lib/config_kit/cli/commands/describe.rb

Instance Attribute Summary

Attributes inherited from Command

#leftover

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Command

inherited, run

Constructor Details

#initialize(args) ⇒ Describe

Returns a new instance of Describe.



5
6
7
8
9
10
# File 'lib/config_kit/cli/commands/describe.rb', line 5

def initialize(args)
  @app = 'idc'
  @output = nil
  args << ['-a', @app] unless args.include?('-a')
  super(args)
end

Class Method Details

.commandObject



3
# File 'lib/config_kit/cli/commands/describe.rb', line 3

def self.command; "describe"; end

Instance Method Details

#runObject



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/config_kit/cli/commands/describe.rb', line 12

def run
  begin
    @output = ConfigKit::Manager.describe(@app, @version)
    pp @output
  rescue ConfigKit::Cli::Command::CommandFailure
    raise
  rescue => e
    ConfigKit.logger.error "Unexpected error attempting to get config data #{@uri} in env #{@env} for #{@app.nil? ? 'all' : @app}"
    ConfigKit.logger.debug "#{e}: #{e.backtrace.join("\n   ")}"
    raise ConfigKit::Cli::Command::CommandFailure.new(e.to_s)
  end
end