Sha256: 8024999225109f6fa52cf180d5d634182c3f06005182c2222d34e3776a661d18

Contents?: true

Size: 655 Bytes

Versions: 2

Compression:

Stored size: 655 Bytes

Contents

require 'chamber/commands/base'

module  Chamber
module  Commands
class   Secure < Chamber::Commands::Base
  include Chamber::Commands::Securable

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

  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

  private

  def disable_warnings
    $stderr = ::File.open('/dev/null', 'w')

    yield

    $stderr = STDERR
  end
end
end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
chamber-2.8.0 lib/chamber/commands/secure.rb
chamber-2.7.1 lib/chamber/commands/secure.rb