Class: CloudRunner::DigitalOcean::Cli::New

Inherits:
Base
  • Object
show all
Defined in:
lib/cloud_runner/digital_ocean/cli/new.rb

Constant Summary collapse

SHORT_HOST_IMAGE_NAMES =
{
  "ubuntu-10-04" => "Ubuntu 10.04 x64 Server",
  "ubuntu-12-04" => "Ubuntu 12.04 x64 Server",
  "centos-6-3"   => "CentOS 6.3 x64",
}.freeze

Instance Attribute Summary

Attributes inherited from Base

#options

Instance Method Summary collapse

Methods inherited from Base

#run_script

Constructor Details

#initialize(opts = {}) ⇒ New

Returns a new instance of New.



12
13
14
15
16
17
18
19
20
# File 'lib/cloud_runner/digital_ocean/cli/new.rb', line 12

def initialize(opts={})
  super

  raise "Host image must be specified" \
    unless @host_image = options[:host_image]

  raise "Host image is not available" \
    unless @image_name = SHORT_HOST_IMAGE_NAMES[@host_image]
end