Module: PoolParty::Pool

Included in:
Object
Defined in:
lib/poolparty/poolparty/pool.rb

Defined Under Namespace

Classes: Pool

Instance Method Summary collapse

Instance Method Details

#pool(name, &block) ⇒ Object



4
5
6
# File 'lib/poolparty/poolparty/pool.rb', line 4

def pool(name, &block)
  pools[name] ||= Pool.new(name, &block)
end

#pool_specfileObject



22
23
24
# File 'lib/poolparty/poolparty/pool.rb', line 22

def pool_specfile
  $pool_specfile
end

#poolsObject



8
9
10
# File 'lib/poolparty/poolparty/pool.rb', line 8

def pools
  $pools ||= {}
end

#remove_pool(name) ⇒ Object

Helpers



76
77
78
# File 'lib/poolparty/poolparty/pool.rb', line 76

def remove_pool(name)
  pools.delete(name) if pools.has_key?(name)
end

#reset!Object



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

def reset!
  $pools = $clouds = $plugins = @describe_instances = nil
end

#set_pool_specfile(filename) ⇒ Object



18
19
20
# File 'lib/poolparty/poolparty/pool.rb', line 18

def set_pool_specfile(filename)
  $pool_specfile = filename unless $pool_specfile
end

#with_pool(pl, opts = {}, &block) ⇒ Object



12
13
14
15
16
# File 'lib/poolparty/poolparty/pool.rb', line 12

def with_pool(pl, opts={}, &block)
  raise CloudNotFoundException.new("Pool not found") unless pl
  pl.options.merge!(opts) if pl.options
  pl.run_in_context &block if block
end