lib/symmetric_encryption/cli.rb in symmetric-encryption-4.1.2 vs lib/symmetric_encryption/cli.rb in symmetric-encryption-4.1.3

- old
+ new

@@ -6,22 +6,22 @@ :decrypt, :random_password, :new_keys, :generate, :environment, :keystore, :re_encrypt, :version, :output_file_name, :compress, :environments, :cipher_name, :rolling_deploy, :rotate_keys, :rotate_kek, :prompt, :show_version, :cleanup_keys, :activate_key, :migrate, :regions - KEYSTORES = %i[heroku environment file].freeze + KEYSTORES = %i[aws heroku environment file].freeze def self.run!(argv) new(argv).run! end def initialize(argv) @version = current_version @environment = ENV['SYMMETRIC_ENCRYPTION_ENV'] || ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'development' @config_file_path = File.expand_path(ENV['SYMMETRIC_ENCRYPTION_CONFIG'] || 'config/symmetric-encryption.yml') @app_name = 'symmetric-encryption' - @key_path = '~/.symmetric-encryption' + @key_path = "#{ENV['HOME']}/.symmetric-encryption" @cipher_name = 'aes-256-cbc' @rolling_deploy = false @prompt = false @show_version = false @keystore = :file @@ -290,11 +290,11 @@ def decrypt_string begin require 'highline' rescue LoadError puts("\nPlease install gem highline before using the command line task to decrypt an entered string.\n gem install \"highline\"\n\n") - exit -2 + exit(-2) end encrypted = HighLine.new.ask('Enter the value to decrypt:') text = SymmetricEncryption.cipher(version).decrypt(encrypted) @@ -305,10 +305,10 @@ def encrypt_string begin require 'highline' rescue LoadError puts("\nPlease install gem highline before using the command line task to encrypt an entered string.\n gem install \"highline\"\n\n") - exit -2 + exit(-2) end value1 = nil value2 = 0 while value1 != value2