Class: Chamber::Commands::Secure

Inherits:
Base
  • Object
show all
Includes:
Securable
Defined in:
lib/chamber/commands/secure.rb

Instance Method Summary collapse

Methods inherited from Base

call

Constructor Details

#initialize(options = {}) ⇒ Secure

Returns a new instance of Secure.



8
9
10
# File 'lib/chamber/commands/secure.rb', line 8

def initialize(options = {})
  super(options.merge(namespaces: ['*']))
end

Instance Method Details

#callObject



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/chamber/commands/secure.rb', line 12

def call
  disable_warnings do
    insecure_environment_variables.each do |key, value|
      if dry_run
        shell.say_status 'encrypt', key, :blue
      else
        shell.say_status 'encrypt', key, :green
      end
    end
  end

  chamber.secure unless dry_run
end