Class: SecretKeysRails::Commands::SecretKeysCommand
- Inherits:
-
Thor
- Object
- Thor
- SecretKeysRails::Commands::SecretKeysCommand
- Includes:
- Thor::Actions
- Defined in:
- lib/secret_keys_rails/commands/secret_keys_command.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.exit_on_failure? ⇒ Boolean
13 14 15 |
# File 'lib/secret_keys_rails/commands/secret_keys_command.rb', line 13 def self.exit_on_failure? true end |
.rake_args ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/secret_keys_rails/commands/secret_keys_command.rb', line 17 def self.rake_args args = ARGV.dup if args[0] args[0] = args[0].sub(/\Asecret_keys:/, "") end if args[1] == "--" args.delete_at(1) end args end |
Instance Method Details
#edit ⇒ Object
39 40 41 42 43 44 45 46 47 |
# File 'lib/secret_keys_rails/commands/secret_keys_command.rb', line 39 def edit key = ensure_key(["environment"]) ensure_secrets(key, ["environment"]) edit_secrets(["environment"]) rescue SecretKeysRails::Error => e STDERR.puts e. exit 1 end |
#show ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/secret_keys_rails/commands/secret_keys_command.rb', line 29 def show SecretKeysRails.require_encryption_key = true secrets = SecretKeysRails.read(["environment"]) STDOUT.write(yaml_dump(secrets.to_h)) rescue SecretKeysRails::Error => e STDERR.puts e. exit 1 end |