Module: Dawn::CLI::Domain

Extended by:
BaseCommands
Defined in:
lib/dawn/cli/commands/domain.rb

Class Method Summary collapse

Methods included from BaseCommands

command, handle_abort_exception

Methods included from Helpers

#current_app, #current_app_name, #extract_app_in_dir, #extract_app_remote_from_git_config, #git, #git_add_dawn_remote, #git_dawn_remote?, #git_remotes, #git_remove_dawn_remote, #has_git?, #try_create_app

Methods included from OutputFormatter

#format_apps, #format_domains, #format_drains, #format_gears, #format_keys, #format_releases, #table_style

Class Method Details

.add(url) ⇒ Object

“Add a new domain to the current app”

Parameters:

  • url (String)


19
20
21
22
23
# File 'lib/dawn/cli/commands/domain.rb', line 19

def self.add(url)
  current_app.domains.create(domain: { url: url })
rescue Excon::Errors::Conflict => ex
  handle_abort_exception("dawn domain add", ex)
end

.delete(url) ⇒ Object

“Remove an existing domain from the current app”

Parameters:

  • url (String)


29
30
31
32
33
# File 'lib/dawn/cli/commands/domain.rb', line 29

def self.delete(url)
  current_app.domains.destroy(url: url)
rescue Excon::Errors::NotFound => ex
  handle_abort_exception("dawn domain delete", ex)
end

.listObject

“List all domains for the current app”



11
12
13
# File 'lib/dawn/cli/commands/domain.rb', line 11

def self.list
  say format_domains(current_app.domains.all)
end