Class: PoolParty::Pool::Pool

Inherits:
PoolParty::PoolPartyBaseClass show all
Includes:
CloudResourcer, PoolParty::PrettyPrinter, Remote
Defined in:
lib/poolparty/poolparty/pool.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Remote

#_nodes, #are_any_nodes_exceeding_minimum_runtime?, #are_too_few_instances_running?, #are_too_many_instances_running?, #commands, #execute!, #is_master_running?, #list_of_instances, #list_of_nodes_exceeding_minimum_runtime, #master, #netssh, #nodes, #remote_rsync_command, #remote_ssh_array, #remote_ssh_string, #rsync, #rsync_command, #rsync_storage_files_to, #rsync_storage_files_to_command, #rsync_to, #rsync_to_command, #run_command_on, #run_command_on_command, #run_command_on_instance_number, #run_local, #run_remote, #scp_array, #scp_to_command, #simplest_run_remote, #ssh_array, #ssh_command, #ssh_into, #ssh_into_instance_number, #ssh_options, #ssh_string, #target_host

Methods included from PoolParty::Pinger

included

Methods included from CloudResourcer

#_keypairs, #full_keypair_path, #instances, #keypair, #number_of_resources, #plugin_directory, #run_stored_block, #setup_dev, #store_block, #stored_block, #update_from_schema, #using, #using_remoter?

Methods included from PoolParty::PrettyPrinter

#pretty_name, #pretty_options, #pretty_print

Methods inherited from PoolParty::PoolPartyBaseClass

add_has_and_does_not_have_methods_for, #add_resource, #add_service, #add_to_parent_if_parent_exists_and_is_a_service, #get_local_resource, #get_name_from_options_and_extra_options, #get_resource, #handle_option_values, #in_local_resources?, #is_a_resource?, #is_plugin?, #method_missing, #ordered_resources, #plugin_store, #resource, #resources, #run_in_context, #services, #store_in_local_resources

Methods included from DependencyResolverCloudExtensions

#to_properties_hash

Constructor Details

#initialize(name, &block) ⇒ Pool

Returns a new instance of Pool.



37
38
39
40
41
42
43
44
45
46
47
# File 'lib/poolparty/poolparty/pool.rb', line 37

def initialize(name,&block)
  @pool_name = name
  @pool_name.freeze
  
  ::PoolParty.context_stack.clear
  
  set_pool_specfile get_latest_caller
  setup_defaults

  super(&block)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class PoolParty::PoolPartyBaseClass

Class Method Details

.load_from_file(filename = nil) ⇒ Object



48
49
50
51
52
53
54
# File 'lib/poolparty/poolparty/pool.rb', line 48

def self.load_from_file(filename=nil)
  # a = new ::File.basename(filename, ::File.extname(filename))
  File.open(filename, 'r') do |f|
    instance_eval f.read, pool_specfile
  end
  # a
end

Instance Method Details

#name(*args) ⇒ Object

a



55
56
57
# File 'lib/poolparty/poolparty/pool.rb', line 55

def name(*args)
  @pool_name ||= @pool_name ? @pool_name : (args.empty? ? :default_pool : args.first)
end

#parentObject



59
# File 'lib/poolparty/poolparty/pool.rb', line 59

def parent;nil;end

#pool_cloudsObject



65
66
67
68
69
70
71
# File 'lib/poolparty/poolparty/pool.rb', line 65

def pool_clouds
  returning Array.new do |arr|
    clouds.each do |name, cl|
      arr << cl if cl.parent.name == self.name
    end
  end
end

#setup_defaultsObject



61
62
63
# File 'lib/poolparty/poolparty/pool.rb', line 61

def setup_defaults        
  PoolParty::Extra::Deployments.include_deployments "#{Dir.pwd}/deployments"
end