Class: Aptible::CLI::Agent
- Inherits:
-
Thor
- Object
- Thor
- Aptible::CLI::Agent
- Includes:
- Helpers::Token, Subcommands::Apps, Subcommands::Config, Subcommands::DB, Subcommands::Domains, Subcommands::Logs, Subcommands::Ps, Subcommands::Rebuild, Subcommands::Restart, Subcommands::SSH, Thor::Actions
- Defined in:
- lib/aptible/cli/agent.rb
Class Method Summary collapse
-
.exit_on_failure? ⇒ Boolean
Forward return codes on failures.
Instance Method Summary collapse
Methods included from Subcommands::SSH
Methods included from Subcommands::Restart
Methods included from Subcommands::Rebuild
Methods included from Subcommands::Ps
Methods included from Subcommands::Logs
Methods included from Subcommands::Domains
Methods included from Subcommands::DB
Methods included from Subcommands::Config
Methods included from Subcommands::Apps
Methods included from Helpers::Token
#current_token_hash, #fetch_token, #save_token, #token_file
Class Method Details
.exit_on_failure? ⇒ Boolean
Forward return codes on failures.
39 40 41 |
# File 'lib/aptible/cli/agent.rb', line 39 def self.exit_on_failure? true end |
Instance Method Details
#login ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/aptible/cli/agent.rb', line 51 def login email = [:email] || ask('Email: ') password = [:password] || ask('Password: ', echo: false) puts '' begin token = Aptible::Auth::Token.create(email: email, password: password) rescue OAuth2::Error raise Thor::Error, 'Could not authenticate with given credentials' end save_token(token.access_token) puts "Token written to #{token_file}" end |