Class: GV::Addons::Memcached

Inherits:
Valley::Addon show all
Defined in:
lib/gv/addons/memcached.rb

Constant Summary collapse

PORT =
11211
CONTAINER_DIR =
"/data/db"

Instance Attribute Summary

Attributes inherited from Valley::Addon

#cmd, #params

Instance Method Summary collapse

Methods inherited from Valley::Addon

#info, #initialize, #port

Constructor Details

This class inherits a constructor from GV::Valley::Addon

Instance Method Details

#create(app_name) ⇒ Object



20
21
22
23
# File 'lib/gv/addons/memcached.rb', line 20

def create app_name
  super app_name
  self.class.space.write([@name.to_sym,@app_name,"#{self.external_ip}:#{port(app_name)}",self.external_ip])    
end

#destroy(app_name) ⇒ Object



25
26
27
28
29
# File 'lib/gv/addons/memcached.rb', line 25

def destroy app_name
  super app_name
  tuple = [@name.to_sym,@app_name,nil,nil]
  (self.class.space.take(tuple,0) rescue nil) while (self.class.space.read(tuple,0) rescue nil)
end

#imageObject



12
# File 'lib/gv/addons/memcached.rb', line 12

def image; "bacongobbler/memcached" end

#url(app_name) ⇒ Object



15
16
17
18
# File 'lib/gv/addons/memcached.rb', line 15

def url app_name
  @app_name = app_name
  self.class.space.read([@name.to_sym,@app_name,nil,nil],0) rescue nil
end