Class: Vpsb::Tasks::DropletSshKeys

Inherits:
BaseTask
  • Object
show all
Includes:
AskSupport
Defined in:
lib/vpsb/tasks/droplet_ssh_keys.rb

Instance Attribute Summary collapse

Attributes inherited from BaseTask

#prepare_squence

Instance Method Summary collapse

Methods included from AskSupport

#ask, #ask_loop, #ask_to_confirm

Methods inherited from BaseTask

prepare_squence

Constructor Details

#initialize(core) ⇒ DropletSshKeys

Returns a new instance of DropletSshKeys.



7
8
9
# File 'lib/vpsb/tasks/droplet_ssh_keys.rb', line 7

def initialize(core)
  @core = core
end

Instance Attribute Details

#coreObject (readonly)

Returns the value of attribute core.



5
6
7
# File 'lib/vpsb/tasks/droplet_ssh_keys.rb', line 5

def core
  @core
end

Instance Method Details

#callObject



13
14
15
16
17
18
# File 'lib/vpsb/tasks/droplet_ssh_keys.rb', line 13

def call
  prepare
  core.get(:ssh_helper).generate_ssh(core.get(:do_ssh_path))
  puts core.get(:ssh_helper).pub_key(core.get(:do_ssh_path))
  ask { puts "Visit https://cloud.digitalocean.com/ssh_keys and add add the key above. Press Enter to continue" }
end