Class: ZAWS::Command::Config

Inherits:
Thor
  • Object
show all
Defined in:
lib/zaws/command/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Config

Returns a new instance of Config.



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/zaws/command/config.rb', line 12

def initialize(*args)
  super
  shellout=ZAWS::Helper::Shell.new
  nessusapi = ZAWS::Nessusapi.new(shellout)
  sumoapi = ZAWS::Sumoapi.new(shellout)
  newrelicapi = ZAWS::Newrelicapi.new(shellout)
  awscli = ZAWS::AWSCLI.new(shellout)
  @config = ZAWS::Controllers::Config.new(shellout, nessusapi,sumoapi,newrelicapi,awscli)
  @out = $stdout
  @print_exit_code = false
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



8
9
10
# File 'lib/zaws/command/config.rb', line 8

def config
  @config
end

#outObject

Returns the value of attribute out.



9
10
11
# File 'lib/zaws/command/config.rb', line 9

def out
  @out
end

Returns the value of attribute print_exit_code.



10
11
12
# File 'lib/zaws/command/config.rb', line 10

def print_exit_code
  @print_exit_code
end

Instance Method Details

#remove_credsObject



26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/zaws/command/config.rb', line 26

def remove_creds
  @config.awscli.home=options[:home]
  @config.awscli.remove_creds()

  @config.nessusapi.home=options[:home]
  @config.nessusapi.remove_creds()

  @config.sumoapi.home=options[:home]
  @config.sumoapi.remove_creds()

  @config.newrelicapi.home=options[:home]
  @config.newrelicapi.remove_creds()
end