Class: Sym::App::Commands::GenerateKey
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- Sym::App::Commands::GenerateKey
- Defined in:
- lib/sym/app/commands/generate_key.rb
Constant Summary
Constants included from Sym
BASH_COMPLETION, COMPLETION_FILE, COMPLETION_PATH, DESCRIPTION, ENV_ARGS_VARIABLE_NAME, LOGGER, NIL_LOGGER, VERSION
Instance Method Summary collapse
Constructor Details
This class inherits a constructor from Sym::App::Commands::BaseCommand
Instance Method Details
#execute ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/sym/app/commands/generate_key.rb', line 12 def execute retries ||= 0 the_key = create_key the_key = encrypt_password_if_needed(the_key) add_to_keychain_if_needed(the_key) the_key rescue Sym::Errors::PasswordsDontMatch, Sym::Errors::PasswordTooShort => e STDERR.puts e..bold retry if (retries += 1) < 3 end |