Module: Aptible::CLI::Helpers::AppOrDatabase
Defined Under Namespace
Modules: ClassMethods
Constant Summary
Constants included from Token
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Database
#clone_database, #databases_from_handle, #ensure_database, #find_credential, #find_database_image, #local_url, #render_database, #replicate_database, #validate_image_type, #with_local_tunnel, #with_postgres_tunnel
Methods included from Ssh
#connect_to_ssh_portal, #exit_with_ssh_portal, #with_ssh_cmd
Methods included from ConfigPath
Methods included from Environment
#ensure_default_environment, #ensure_environment, #environment_from_handle, #scoped_environments
Methods included from Token
#current_token_hash, #fetch_token, #save_token, #token_file
Methods included from App
#apps_from_handle, #ensure_app, #ensure_service, #extract_env, #validate_env_key!, #validate_env_pair!
Class Method Details
.included(base) ⇒ Object
28 29 30 |
# File 'lib/aptible/cli/helpers/app_or_database.rb', line 28 def self.included(base) base.extend(ClassMethods) end |
Instance Method Details
#ensure_app_or_database(options = {}) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/aptible/cli/helpers/app_or_database.rb', line 15 def ensure_app_or_database( = {}) if [:app] && [:database] m = 'You must specify only one of --app and --database' raise Thor::Error, m end if [:database] ensure_database(.merge(db: [:database])) else ensure_app() end end |