Class: PoolParty::Pool
Instance Attribute Summary collapse
-
#auto_execute ⇒ Object
Returns the value of attribute auto_execute.
-
#debugging ⇒ Object
Returns the value of attribute debugging.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
-
#very_debugging ⇒ Object
Returns the value of attribute very_debugging.
-
#very_verbose ⇒ Object
Returns the value of attribute very_verbose.
Attributes inherited from Base
Instance Method Summary collapse
- #cloud(name, &block) ⇒ Object
- #clouds ⇒ Object
-
#cmd(commands, opts = {}) ⇒ Object
Run command/s on all nodes in the pool.
- #run ⇒ Object
Methods inherited from Base
#after_initialized, #initialize, #method_missing
Constructor Details
This class inherits a constructor from PoolParty::Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class PoolParty::Base
Instance Attribute Details
#auto_execute ⇒ Object
Returns the value of attribute auto_execute.
4 5 6 |
# File 'lib/poolparty/pool.rb', line 4 def auto_execute @auto_execute end |
#debugging ⇒ Object
Returns the value of attribute debugging.
4 5 6 |
# File 'lib/poolparty/pool.rb', line 4 def debugging @debugging end |
#verbose ⇒ Object
Returns the value of attribute verbose.
4 5 6 |
# File 'lib/poolparty/pool.rb', line 4 def verbose @verbose end |
#very_debugging ⇒ Object
Returns the value of attribute very_debugging.
4 5 6 |
# File 'lib/poolparty/pool.rb', line 4 def very_debugging @very_debugging end |
#very_verbose ⇒ Object
Returns the value of attribute very_verbose.
4 5 6 |
# File 'lib/poolparty/pool.rb', line 4 def very_verbose @very_verbose end |
Instance Method Details
#cloud(name, &block) ⇒ Object
6 7 8 |
# File 'lib/poolparty/pool.rb', line 6 def cloud(name, &block) clouds[name.to_s] = Cloud.new(name.to_s, {:parent => self}, &block) end |
#clouds ⇒ Object
10 11 12 |
# File 'lib/poolparty/pool.rb', line 10 def clouds @clouds ||= {} end |
#cmd(commands, opts = {}) ⇒ Object
Run command/s on all nodes in the pool. Returns a hash in the form of => [{instance_id=>result]}
16 17 18 19 20 21 22 23 |
# File 'lib/poolparty/pool.rb', line 16 def cmd(commands, opts={}) results = {} threads = clouds.collect do |name, c| Thread.new{ results[ name ] = c.cmd(commands, opts) } end threads.each{ |aThread| aThread.join } results end |
#run ⇒ Object
34 35 36 37 38 39 |
# File 'lib/poolparty/pool.rb', line 34 def run clouds.each do |cloud_name, cld| puts "----> Starting to build cloud #{cloud_name}" cld.run end end |