Module: Dawn::CLI::Key

Extended by:
Helpers
Defined in:
lib/dawn/cli/commands/key.rb

Class Method Summary collapse

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, #table_style

Class Method Details

.addObject

“Adds this machine’s sshkey to Dawn”



15
16
17
18
19
# File 'lib/dawn/cli/commands/key.rb', line 15

def self.add
  filename = File.join(Dir.home, ".ssh/id_rsa.pub")
  pubkey = File.read filename
  key    = Dawn::Key.create(key: pubkey)
end

.deleteObject

“Delete a Key by ID”



28
29
30
# File 'lib/dawn/cli/commands/key.rb', line 28

def self.delete
  Dawn::Key.destroy(id: id)
end

.get(id) ⇒ Object

“Retrieve a Key by ID”



22
23
24
25
# File 'lib/dawn/cli/commands/key.rb', line 22

def self.get(id)
  key = Dawn::Key.find(id: id)
  say format_keys([key])
end

.listObject

“Lists all your Keys currently on dawn”



10
11
12
# File 'lib/dawn/cli/commands/key.rb', line 10

def self.list
  say format_keys(Dawn::Key.all)
end