Class: Vpsb::Resources::DoImage

Inherits:
BaseResource show all
Includes:
AskSupport, ShellSupport
Defined in:
lib/vpsb/resources/do_image.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_image.rb', line 8

def call(core)
  puts "Loading list of available operating systems"
  in_dir(core.get(:server_app_path), "knife digital_ocean image list -G | grep -i 'Ubuntu [ ]* Ubuntu 1[0234]\.[01][04]'")
  answer = ask { puts 'Which system? Enter its id (default: 3101918)' }.strip
  answer.empty? ? '3101918' : answer
end