Module: Euca

Defined in:
lib/euca.rb,
lib/euca/api.rb,
lib/euca/model.rb,
lib/euca/api/tag.rb,
lib/euca/version.rb,
lib/euca/wrapper.rb,
lib/euca/filterable.rb,
lib/euca/api/address.rb,
lib/euca/api/keypair.rb,
lib/euca/api/instance.rb

Defined Under Namespace

Modules: Api, Filterable, Model Classes: Address, Instance, Keypair, Tag, Wrapper

Constant Summary collapse

EUCA_VERSION =
"euca-version".freeze
UBUNTU_13_10 =
"qmi-c4c45230"
UBUNTU_12_04 =
"qmi-b58041dd"
T1_NANO =
"t1.nano"
VERSION =
"0.0.15"

Class Method Summary collapse

Class Method Details

.api_methodsObject



19
20
21
22
23
24
# File 'lib/euca.rb', line 19

def self.api_methods
  @@api_methods ||= begin
    sh(:ls, :"1", "#{self.exec_path}/euca-*").
    gsub(/#{self.exec_path}\/euca-/m,"").split("\n")
  end
end

.exec_pathObject



26
27
28
# File 'lib/euca.rb', line 26

def self.exec_path
  @@euca_home ||= sh(:dirname, "$(which euca-version)")
end

.has_cli?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/euca.rb', line 11

def self.has_cli?
  self.version.exit_status == 0
end

.sh(*args) ⇒ Object

Raises:

  • (RuntimeError)


30
31
32
33
34
# File 'lib/euca.rb', line 30

def self.sh *args
  ret = Rye.shell *args
  raise RuntimeError.new(ret.stderr.join($/)) if ret.exit_status != 0
  ret.to_s
end

.versionObject



15
16
17
# File 'lib/euca.rb', line 15

def self.version
  sh(BIN_VERSION)
end