Class: Vpsb::Resources::DoRegion

Inherits:
BaseResource show all
Includes:
AskSupport, ShellSupport
Defined in:
lib/vpsb/resources/do_region.rb

Instance Method Summary collapse

Methods included from ShellSupport

#in_dir

Methods included from AskSupport

#ask, #ask_loop, #ask_to_confirm

Instance Method Details

#call(core) ⇒ Object



8
9
10
11
12
13
# File 'lib/vpsb/resources/do_region.rb', line 8

def call(core)
  puts "Loading list of available regions"
  in_dir(core.get(:server_app_path), "knife digital_ocean region list")
  answer = ask { puts 'Which region? Enter its id (default: 5)' }.strip
  answer.empty? ? '5' : answer
end