Class: Chamber::Commands::Secure

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

Instance Attribute Summary

Attributes inherited from Base

#chamber, #dry_run, #rootpath, #shell

Instance Method Summary collapse

Methods inherited from Base

call

Constructor Details

#initialize(**args) ⇒ Secure

Returns a new instance of Secure.



11
12
13
# File 'lib/chamber/commands/secure.rb', line 11

def initialize(**args)
  super(**args.merge(namespaces: ['*']))
end

Instance Method Details

#callObject



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

def call
  disable_warnings do
    insecure_environment_variables.each_key do |key|
      color = dry_run ? :blue : :green

      shell.say_status 'encrypt', key, color
    end
  end

  chamber.secure unless dry_run
end