auser-poolparty 0.2.79 → 0.2.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Manifest.txt +38 -33
 - data/PostInstall.txt +1 -1
 - data/bin/cloud-provision +1 -1
 - data/bin/cloud-spec +40 -0
 - data/lib/poolparty.rb +2 -2
 - data/lib/poolparty/base_packages/poolparty.rb +1 -1
 - data/lib/poolparty/extra/deployments.rb +31 -0
 - data/lib/poolparty/helpers/binary.rb +9 -0
 - data/lib/poolparty/modules/cloud_dsl.rb +1 -1
 - data/lib/poolparty/modules/cloud_resourcer.rb +2 -0
 - data/lib/poolparty/modules/file_writer.rb +2 -2
 - data/lib/poolparty/net/messenger.rb +1 -1
 - data/lib/poolparty/net/remote_bases/ec2.rb +5 -2
 - data/lib/poolparty/net/remoter.rb +2 -4
 - data/lib/poolparty/net/remoter_base.rb +7 -0
 - data/lib/poolparty/poolparty/cloud.rb +22 -7
 - data/lib/poolparty/poolparty/plugin_model.rb +4 -4
 - data/lib/poolparty/poolparty/pool.rb +1 -0
 - data/lib/poolparty/poolparty/resource.rb +1 -1
 - data/lib/poolparty/poolparty/resources/directory.rb +2 -2
 - data/lib/poolparty/poolparty/resources/file.rb +2 -2
 - data/lib/poolparty/poolparty/resources/remote_file.rb +1 -1
 - data/lib/poolparty/poolparty/resources/remote_user.rb +17 -0
 - data/lib/poolparty/{helpers → provisioners}/provisioner_base.rb +10 -4
 - data/lib/poolparty/{helpers → provisioners}/provisioners/master.rb +11 -7
 - data/lib/poolparty/{helpers → provisioners}/provisioners/slave.rb +0 -0
 - data/lib/poolparty/templates/puppetrerun +2 -1
 - data/lib/poolparty/version.rb +1 -1
 - data/poolparty.gemspec +42 -36
 - data/spec/poolparty/extra/deployments_spec.rb +64 -0
 - data/spec/poolparty/helpers/provisioner_base_spec.rb +0 -1
 - data/spec/poolparty/helpers/provisioners/master_spec.rb +0 -1
 - data/spec/poolparty/helpers/provisioners/slave_spec.rb +0 -1
 - data/spec/poolparty/{pool → poolparty}/base_spec.rb +0 -0
 - data/spec/poolparty/{pool → poolparty}/cloud_spec.rb +37 -0
 - data/spec/poolparty/{pool → poolparty}/configurers/files/ruby_basic.rb +0 -0
 - data/spec/poolparty/{pool → poolparty}/configurers/files/ruby_plugins.rb +0 -0
 - data/spec/poolparty/{pool → poolparty}/configurers/ruby_spec.rb +0 -0
 - data/spec/poolparty/{pool → poolparty}/custom_resource_spec.rb +0 -0
 - data/spec/poolparty/{pool → poolparty}/example_spec.rb +0 -0
 - data/spec/poolparty/{pool → poolparty}/plugin_model_spec.rb +0 -0
 - data/spec/poolparty/{pool → poolparty}/plugin_spec.rb +0 -0
 - data/spec/poolparty/{pool → poolparty}/pool_spec.rb +0 -0
 - data/spec/poolparty/{pool → poolparty}/resource_spec.rb +0 -0
 - data/spec/poolparty/{pool → poolparty}/resources/class_package_spec.rb +0 -0
 - data/spec/poolparty/{pool → poolparty}/resources/conditional_spec.rb +0 -0
 - data/spec/poolparty/{pool → poolparty}/resources/cron_spec.rb +0 -0
 - data/spec/poolparty/{pool → poolparty}/resources/directory_spec.rb +0 -0
 - data/spec/poolparty/{pool → poolparty}/resources/exec_spec.rb +0 -0
 - data/spec/poolparty/{pool → poolparty}/resources/file_spec.rb +0 -0
 - data/spec/poolparty/{pool → poolparty}/resources/gem_spec.rb +0 -0
 - data/spec/poolparty/{pool → poolparty}/resources/host_spec.rb +0 -0
 - data/spec/poolparty/{pool → poolparty}/resources/package_spec.rb +0 -0
 - data/spec/poolparty/{pool → poolparty}/resources/remote_file_spec.rb +0 -0
 - data/spec/poolparty/{pool → poolparty}/resources/service_spec.rb +0 -0
 - data/spec/poolparty/{pool → poolparty}/resources/sshkey_spec.rb +0 -0
 - data/spec/poolparty/{pool → poolparty}/resources/symlink_spec.rb +0 -0
 - data/spec/poolparty/poolparty/resources/user_spec.rb +38 -0
 - data/spec/poolparty/{pool → poolparty}/resources/variable_spec.rb +0 -0
 - data/spec/poolparty/{pool → poolparty}/script_spec.rb +0 -0
 - data/spec/poolparty/{pool → poolparty}/test_plugins/sshkey_test +0 -0
 - data/spec/poolparty/{pool → poolparty}/test_plugins/virtual_host_template.erb +0 -0
 - data/spec/poolparty/{pool → poolparty}/test_plugins/webserver.rb +0 -0
 - data/website/index.html +107 -0
 - metadata +42 -36
 - data/lib/erlang/messenger/src/pm_client_old.erl +0 -52
 
    
        data/Manifest.txt
    CHANGED
    
    | 
         @@ -18,6 +18,7 @@ bin/cloud-provision 
     | 
|
| 
       18 
18 
     | 
    
         
             
            bin/cloud-refresh
         
     | 
| 
       19 
19 
     | 
    
         
             
            bin/cloud-rsync
         
     | 
| 
       20 
20 
     | 
    
         
             
            bin/cloud-run
         
     | 
| 
      
 21 
     | 
    
         
            +
            bin/cloud-spec
         
     | 
| 
       21 
22 
     | 
    
         
             
            bin/cloud-ssh
         
     | 
| 
       22 
23 
     | 
    
         
             
            bin/cloud-start
         
     | 
| 
       23 
24 
     | 
    
         
             
            bin/cloud-stats
         
     | 
| 
         @@ -152,7 +153,6 @@ lib/erlang/messenger/src/client_server.erl 
     | 
|
| 
       152 
153 
     | 
    
         
             
            lib/erlang/messenger/src/master_app.erl
         
     | 
| 
       153 
154 
     | 
    
         
             
            lib/erlang/messenger/src/node_app.erl
         
     | 
| 
       154 
155 
     | 
    
         
             
            lib/erlang/messenger/src/pm_client.erl
         
     | 
| 
       155 
     | 
    
         
            -
            lib/erlang/messenger/src/pm_client_old.erl
         
     | 
| 
       156 
156 
     | 
    
         
             
            lib/erlang/messenger/src/pm_client_supervisor.erl
         
     | 
| 
       157 
157 
     | 
    
         
             
            lib/erlang/messenger/src/pm_cluster.erl
         
     | 
| 
       158 
158 
     | 
    
         
             
            lib/erlang/messenger/src/pm_event_manager.erl
         
     | 
| 
         @@ -199,14 +199,12 @@ lib/poolparty/exceptions/RuntimeException.rb 
     | 
|
| 
       199 
199 
     | 
    
         
             
            lib/poolparty/exceptions/SpecException.rb
         
     | 
| 
       200 
200 
     | 
    
         
             
            lib/poolparty/exceptions/TemplateNotFound.rb
         
     | 
| 
       201 
201 
     | 
    
         
             
            lib/poolparty/exceptions/UnacceptableCommand.rb
         
     | 
| 
      
 202 
     | 
    
         
            +
            lib/poolparty/extra/deployments.rb
         
     | 
| 
       202 
203 
     | 
    
         
             
            lib/poolparty/helpers/binary.rb
         
     | 
| 
       203 
204 
     | 
    
         
             
            lib/poolparty/helpers/console.rb
         
     | 
| 
       204 
205 
     | 
    
         
             
            lib/poolparty/helpers/display.rb
         
     | 
| 
       205 
206 
     | 
    
         
             
            lib/poolparty/helpers/nice_printer.rb
         
     | 
| 
       206 
207 
     | 
    
         
             
            lib/poolparty/helpers/optioner.rb
         
     | 
| 
       207 
     | 
    
         
            -
            lib/poolparty/helpers/provisioner_base.rb
         
     | 
| 
       208 
     | 
    
         
            -
            lib/poolparty/helpers/provisioners/master.rb
         
     | 
| 
       209 
     | 
    
         
            -
            lib/poolparty/helpers/provisioners/slave.rb
         
     | 
| 
       210 
208 
     | 
    
         
             
            lib/poolparty/helpers/ruberl.rb
         
     | 
| 
       211 
209 
     | 
    
         
             
            lib/poolparty/modules/cloud_dsl.rb
         
     | 
| 
       212 
210 
     | 
    
         
             
            lib/poolparty/modules/cloud_resourcer.rb
         
     | 
| 
         @@ -257,11 +255,15 @@ lib/poolparty/poolparty/resources/host.rb 
     | 
|
| 
       257 
255 
     | 
    
         
             
            lib/poolparty/poolparty/resources/mount.rb
         
     | 
| 
       258 
256 
     | 
    
         
             
            lib/poolparty/poolparty/resources/package.rb
         
     | 
| 
       259 
257 
     | 
    
         
             
            lib/poolparty/poolparty/resources/remote_file.rb
         
     | 
| 
      
 258 
     | 
    
         
            +
            lib/poolparty/poolparty/resources/remote_user.rb
         
     | 
| 
       260 
259 
     | 
    
         
             
            lib/poolparty/poolparty/resources/service.rb
         
     | 
| 
       261 
260 
     | 
    
         
             
            lib/poolparty/poolparty/resources/sshkey.rb
         
     | 
| 
       262 
261 
     | 
    
         
             
            lib/poolparty/poolparty/resources/symlink.rb
         
     | 
| 
       263 
262 
     | 
    
         
             
            lib/poolparty/poolparty/resources/variable.rb
         
     | 
| 
       264 
263 
     | 
    
         
             
            lib/poolparty/poolparty/script.rb
         
     | 
| 
      
 264 
     | 
    
         
            +
            lib/poolparty/provisioners/provisioner_base.rb
         
     | 
| 
      
 265 
     | 
    
         
            +
            lib/poolparty/provisioners/provisioners/master.rb
         
     | 
| 
      
 266 
     | 
    
         
            +
            lib/poolparty/provisioners/provisioners/slave.rb
         
     | 
| 
       265 
267 
     | 
    
         
             
            lib/poolparty/spec/core/string.rb
         
     | 
| 
       266 
268 
     | 
    
         
             
            lib/poolparty/spec/matchers/a_spec_extensions_base.rb
         
     | 
| 
       267 
269 
     | 
    
         
             
            lib/poolparty/spec/matchers/have_cron.rb
         
     | 
| 
         @@ -325,6 +327,7 @@ spec/poolparty/core/object_spec.rb 
     | 
|
| 
       325 
327 
     | 
    
         
             
            spec/poolparty/core/string_spec.rb
         
     | 
| 
       326 
328 
     | 
    
         
             
            spec/poolparty/core/time_spec.rb
         
     | 
| 
       327 
329 
     | 
    
         
             
            spec/poolparty/dependency_resolutions/base_spec.rb
         
     | 
| 
      
 330 
     | 
    
         
            +
            spec/poolparty/extra/deployments_spec.rb
         
     | 
| 
       328 
331 
     | 
    
         
             
            spec/poolparty/helpers/binary_spec.rb
         
     | 
| 
       329 
332 
     | 
    
         
             
            spec/poolparty/helpers/display_spec.rb
         
     | 
| 
       330 
333 
     | 
    
         
             
            spec/poolparty/helpers/optioner_spec.rb
         
     | 
| 
         @@ -349,35 +352,36 @@ spec/poolparty/plugins/deploydirectory_spec.rb 
     | 
|
| 
       349 
352 
     | 
    
         
             
            spec/poolparty/plugins/git_spec.rb
         
     | 
| 
       350 
353 
     | 
    
         
             
            spec/poolparty/plugins/line_spec.rb
         
     | 
| 
       351 
354 
     | 
    
         
             
            spec/poolparty/plugins/svn_spec.rb
         
     | 
| 
       352 
     | 
    
         
            -
            spec/poolparty/ 
     | 
| 
       353 
     | 
    
         
            -
            spec/poolparty/ 
     | 
| 
       354 
     | 
    
         
            -
            spec/poolparty/ 
     | 
| 
       355 
     | 
    
         
            -
            spec/poolparty/ 
     | 
| 
       356 
     | 
    
         
            -
            spec/poolparty/ 
     | 
| 
       357 
     | 
    
         
            -
            spec/poolparty/ 
     | 
| 
       358 
     | 
    
         
            -
            spec/poolparty/ 
     | 
| 
       359 
     | 
    
         
            -
            spec/poolparty/ 
     | 
| 
       360 
     | 
    
         
            -
            spec/poolparty/ 
     | 
| 
       361 
     | 
    
         
            -
            spec/poolparty/ 
     | 
| 
       362 
     | 
    
         
            -
            spec/poolparty/ 
     | 
| 
       363 
     | 
    
         
            -
            spec/poolparty/ 
     | 
| 
       364 
     | 
    
         
            -
            spec/poolparty/ 
     | 
| 
       365 
     | 
    
         
            -
            spec/poolparty/ 
     | 
| 
       366 
     | 
    
         
            -
            spec/poolparty/ 
     | 
| 
       367 
     | 
    
         
            -
            spec/poolparty/ 
     | 
| 
       368 
     | 
    
         
            -
            spec/poolparty/ 
     | 
| 
       369 
     | 
    
         
            -
            spec/poolparty/ 
     | 
| 
       370 
     | 
    
         
            -
            spec/poolparty/ 
     | 
| 
       371 
     | 
    
         
            -
            spec/poolparty/ 
     | 
| 
       372 
     | 
    
         
            -
            spec/poolparty/ 
     | 
| 
       373 
     | 
    
         
            -
            spec/poolparty/ 
     | 
| 
       374 
     | 
    
         
            -
            spec/poolparty/ 
     | 
| 
       375 
     | 
    
         
            -
            spec/poolparty/ 
     | 
| 
       376 
     | 
    
         
            -
            spec/poolparty/ 
     | 
| 
       377 
     | 
    
         
            -
            spec/poolparty/ 
     | 
| 
       378 
     | 
    
         
            -
            spec/poolparty/ 
     | 
| 
       379 
     | 
    
         
            -
            spec/poolparty/ 
     | 
| 
       380 
     | 
    
         
            -
            spec/poolparty/ 
     | 
| 
      
 355 
     | 
    
         
            +
            spec/poolparty/poolparty/base_spec.rb
         
     | 
| 
      
 356 
     | 
    
         
            +
            spec/poolparty/poolparty/cloud_spec.rb
         
     | 
| 
      
 357 
     | 
    
         
            +
            spec/poolparty/poolparty/configurers/files/ruby_basic.rb
         
     | 
| 
      
 358 
     | 
    
         
            +
            spec/poolparty/poolparty/configurers/files/ruby_plugins.rb
         
     | 
| 
      
 359 
     | 
    
         
            +
            spec/poolparty/poolparty/configurers/ruby_spec.rb
         
     | 
| 
      
 360 
     | 
    
         
            +
            spec/poolparty/poolparty/custom_resource_spec.rb
         
     | 
| 
      
 361 
     | 
    
         
            +
            spec/poolparty/poolparty/example_spec.rb
         
     | 
| 
      
 362 
     | 
    
         
            +
            spec/poolparty/poolparty/plugin_model_spec.rb
         
     | 
| 
      
 363 
     | 
    
         
            +
            spec/poolparty/poolparty/plugin_spec.rb
         
     | 
| 
      
 364 
     | 
    
         
            +
            spec/poolparty/poolparty/pool_spec.rb
         
     | 
| 
      
 365 
     | 
    
         
            +
            spec/poolparty/poolparty/resource_spec.rb
         
     | 
| 
      
 366 
     | 
    
         
            +
            spec/poolparty/poolparty/resources/class_package_spec.rb
         
     | 
| 
      
 367 
     | 
    
         
            +
            spec/poolparty/poolparty/resources/conditional_spec.rb
         
     | 
| 
      
 368 
     | 
    
         
            +
            spec/poolparty/poolparty/resources/cron_spec.rb
         
     | 
| 
      
 369 
     | 
    
         
            +
            spec/poolparty/poolparty/resources/directory_spec.rb
         
     | 
| 
      
 370 
     | 
    
         
            +
            spec/poolparty/poolparty/resources/exec_spec.rb
         
     | 
| 
      
 371 
     | 
    
         
            +
            spec/poolparty/poolparty/resources/file_spec.rb
         
     | 
| 
      
 372 
     | 
    
         
            +
            spec/poolparty/poolparty/resources/gem_spec.rb
         
     | 
| 
      
 373 
     | 
    
         
            +
            spec/poolparty/poolparty/resources/host_spec.rb
         
     | 
| 
      
 374 
     | 
    
         
            +
            spec/poolparty/poolparty/resources/package_spec.rb
         
     | 
| 
      
 375 
     | 
    
         
            +
            spec/poolparty/poolparty/resources/remote_file_spec.rb
         
     | 
| 
      
 376 
     | 
    
         
            +
            spec/poolparty/poolparty/resources/service_spec.rb
         
     | 
| 
      
 377 
     | 
    
         
            +
            spec/poolparty/poolparty/resources/sshkey_spec.rb
         
     | 
| 
      
 378 
     | 
    
         
            +
            spec/poolparty/poolparty/resources/symlink_spec.rb
         
     | 
| 
      
 379 
     | 
    
         
            +
            spec/poolparty/poolparty/resources/user_spec.rb
         
     | 
| 
      
 380 
     | 
    
         
            +
            spec/poolparty/poolparty/resources/variable_spec.rb
         
     | 
| 
      
 381 
     | 
    
         
            +
            spec/poolparty/poolparty/script_spec.rb
         
     | 
| 
      
 382 
     | 
    
         
            +
            spec/poolparty/poolparty/test_plugins/sshkey_test
         
     | 
| 
      
 383 
     | 
    
         
            +
            spec/poolparty/poolparty/test_plugins/virtual_host_template.erb
         
     | 
| 
      
 384 
     | 
    
         
            +
            spec/poolparty/poolparty/test_plugins/webserver.rb
         
     | 
| 
       381 
385 
     | 
    
         
             
            spec/poolparty/poolparty_spec.rb
         
     | 
| 
       382 
386 
     | 
    
         
             
            spec/poolparty/spec/core/string_spec.rb
         
     | 
| 
       383 
387 
     | 
    
         
             
            spec/poolparty/spec_helper.rb
         
     | 
| 
         @@ -394,6 +398,7 @@ test/test_generator_helper.rb 
     | 
|
| 
       394 
398 
     | 
    
         
             
            test/test_helper.rb
         
     | 
| 
       395 
399 
     | 
    
         
             
            test/test_pool_spec_generator.rb
         
     | 
| 
       396 
400 
     | 
    
         
             
            test/test_poolparty.rb
         
     | 
| 
      
 401 
     | 
    
         
            +
            website/index.html
         
     | 
| 
       397 
402 
     | 
    
         
             
            website/index.txt
         
     | 
| 
       398 
403 
     | 
    
         
             
            website/javascripts/rounded_corners_lite.inc.js
         
     | 
| 
       399 
404 
     | 
    
         
             
            website/stylesheets/code.css
         
     | 
    
        data/PostInstall.txt
    CHANGED
    
    
    
        data/bin/cloud-provision
    CHANGED
    
    | 
         @@ -18,7 +18,7 @@ o.loaded_clouds.each do |cloud| 
     | 
|
| 
       18 
18 
     | 
    
         
             
                if instance_num
         
     | 
| 
       19 
19 
     | 
    
         
             
                  @instance = get_instance_by_number( instance_num )
         
     | 
| 
       20 
20 
     | 
    
         
             
                  instance_num == 0 ? Provisioner.provision_master(self, testing) : Provisioner.provision_slave(@instance, self, testing)
         
     | 
| 
       21 
     | 
    
         
            -
                  Provisioner.process_clean_reconfigure_for!(@instance, self, testing)
         
     | 
| 
      
 21 
     | 
    
         
            +
                  # Provisioner.process_clean_reconfigure_for!(@instance, self, testing)
         
     | 
| 
       22 
22 
     | 
    
         
             
                else
         
     | 
| 
       23 
23 
     | 
    
         
             
                  if provision_slave
         
     | 
| 
       24 
24 
     | 
    
         
             
                    vputs "Provisioning slaves"
         
     | 
    
        data/bin/cloud-spec
    ADDED
    
    | 
         @@ -0,0 +1,40 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            #!/usr/bin/env ruby
         
     | 
| 
      
 2 
     | 
    
         
            +
            $:.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
         
     | 
| 
      
 3 
     | 
    
         
            +
            require "poolparty"
         
     | 
| 
      
 4 
     | 
    
         
            +
            require "poolpartycl"
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            available_tests = {
         
     | 
| 
      
 7 
     | 
    
         
            +
              :launch => "Launches a cloud and ensures it is accessible at port 80"
         
     | 
| 
      
 8 
     | 
    
         
            +
            }
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
            available_tests_string = available_tests.map {|k,v| "#{k}: #{v}"}.join("\n")
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
            o = PoolParty::Optioner.new(ARGV) do |opts, optioner|  
         
     | 
| 
      
 13 
     | 
    
         
            +
              optioner.cloudnames
         
     | 
| 
      
 14 
     | 
    
         
            +
              optioner.daemonizeable
         
     | 
| 
      
 15 
     | 
    
         
            +
              opts.on('--type type', 
         
     | 
| 
      
 16 
     | 
    
         
            +
                "Run type of test. Available tests: #{available_tests_string} (default: launch)")    { |c| optioner.testtype c }
         
     | 
| 
      
 17 
     | 
    
         
            +
            end
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
            o.loaded_clouds.each do |cloud|
         
     | 
| 
      
 20 
     | 
    
         
            +
              with_cloud(cloud) do
         
     | 
| 
      
 21 
     | 
    
         
            +
                puts "Are you sure you want to live test?"
         
     | 
| 
      
 22 
     | 
    
         
            +
                body = ["Normal charges for running instances will apply"]
         
     | 
| 
      
 23 
     | 
    
         
            +
                body << "as this will run instances"
         
     | 
| 
      
 24 
     | 
    
         
            +
                body.each {|st| puts "\t#{st}"}
         
     | 
| 
      
 25 
     | 
    
         
            +
                print "(y|n): "
         
     | 
| 
      
 26 
     | 
    
         
            +
                input = gets.downcase.chomp
         
     | 
| 
      
 27 
     | 
    
         
            +
                do_test = input.downcase == "y" ? true : false
         
     | 
| 
      
 28 
     | 
    
         
            +
                if do_test
         
     | 
| 
      
 29 
     | 
    
         
            +
                  case testtype
         
     | 
| 
      
 30 
     | 
    
         
            +
                  when "launch"
         
     | 
| 
      
 31 
     | 
    
         
            +
                  when nil
         
     | 
| 
      
 32 
     | 
    
         
            +
                    print_with_nice_printer("Starting live specing cloud #{name}")      
         
     | 
| 
      
 33 
     | 
    
         
            +
                    # hide_output {launch_and_configure_master!}
         
     | 
| 
      
 34 
     | 
    
         
            +
                    print_with_nice_printer("Waiting for cloud to provision")
         
     | 
| 
      
 35 
     | 
    
         
            +
                    
         
     | 
| 
      
 36 
     | 
    
         
            +
                  end
         
     | 
| 
      
 37 
     | 
    
         
            +
                end
         
     | 
| 
      
 38 
     | 
    
         
            +
              end
         
     | 
| 
      
 39 
     | 
    
         
            +
              
         
     | 
| 
      
 40 
     | 
    
         
            +
            end
         
     | 
    
        data/lib/poolparty.rb
    CHANGED
    
    | 
         @@ -2,7 +2,7 @@ require 'rubygems' 
     | 
|
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            # Load required gems
         
     | 
| 
       4 
4 
     | 
    
         
             
            @required_software = Array.new
         
     | 
| 
       5 
     | 
    
         
            -
            %w(activesupport ftools logging resolv ruby2ruby).each do |lib|
         
     | 
| 
      
 5 
     | 
    
         
            +
            %w(activesupport ftools logging resolv ruby2ruby digest/sha2).each do |lib|
         
     | 
| 
       6 
6 
     | 
    
         
             
              begin
         
     | 
| 
       7 
7 
     | 
    
         
             
                require lib
         
     | 
| 
       8 
8 
     | 
    
         
             
              rescue Exception => e
         
     | 
| 
         @@ -38,7 +38,7 @@ ActiveSupport::Dependencies.load_paths << File.dirname(__FILE__) 
     | 
|
| 
       38 
38 
     | 
    
         
             
            ## Load PoolParty
         
     | 
| 
       39 
39 
     | 
    
         
             
            require "#{File.dirname(__FILE__)}/poolparty/version"
         
     | 
| 
       40 
40 
     | 
    
         | 
| 
       41 
     | 
    
         
            -
            %w(core modules exceptions dependency_resolutions aska monitors net).each do |dir|
         
     | 
| 
      
 41 
     | 
    
         
            +
            %w(core modules exceptions dependency_resolutions aska monitors provisioners extra net).each do |dir|
         
     | 
| 
       42 
42 
     | 
    
         
             
              Dir[File.dirname(__FILE__) + "/poolparty/#{dir}/**.rb"].each do |file|
         
     | 
| 
       43 
43 
     | 
    
         
             
                require file
         
     | 
| 
       44 
44 
     | 
    
         
             
              end
         
     | 
| 
         @@ -50,7 +50,7 @@ module PoolParty 
     | 
|
| 
       50 
50 
     | 
    
         
             
                    end
         
     | 
| 
       51 
51 
     | 
    
         | 
| 
       52 
52 
     | 
    
         
             
                    # execute_on_node do
         
     | 
| 
       53 
     | 
    
         
            -
                      has_cron(:name => "node puppetd runner", :user => Base.user, :minute => "*/ 
     | 
| 
      
 53 
     | 
    
         
            +
                      has_cron(:name => "node puppetd runner", :user => Base.user, :minute => "*/15") do
         
     | 
| 
       54 
54 
     | 
    
         
             
                        requires get_gempackage("poolparty")
         
     | 
| 
       55 
55 
     | 
    
         
             
                        command "/usr/bin/puppetrunner"
         
     | 
| 
       56 
56 
     | 
    
         
             
                      end
         
     | 
| 
         @@ -0,0 +1,31 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            module PoolParty
         
     | 
| 
      
 2 
     | 
    
         
            +
              module Extra
         
     | 
| 
      
 3 
     | 
    
         
            +
                class Deployments
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
                  class << self
         
     | 
| 
      
 6 
     | 
    
         
            +
                    
         
     | 
| 
      
 7 
     | 
    
         
            +
                    def include_deployment(filename)
         
     | 
| 
      
 8 
     | 
    
         
            +
                      return nil unless ::File.file? filename
         
     | 
| 
      
 9 
     | 
    
         
            +
                      name = ::File.basename(filename, ::File.extname(filename))
         
     | 
| 
      
 10 
     | 
    
         
            +
                      contents = open(filename).read
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
                      plugin_klass = PoolParty::PluginModel::PluginModel.new(name)
         
     | 
| 
      
 13 
     | 
    
         
            +
                      plugin_klass.klass.class_eval <<-EOE
         
     | 
| 
      
 14 
     | 
    
         
            +
                        def enable
         
     | 
| 
      
 15 
     | 
    
         
            +
                          #{contents}
         
     | 
| 
      
 16 
     | 
    
         
            +
                        end
         
     | 
| 
      
 17 
     | 
    
         
            +
                      EOE
         
     | 
| 
      
 18 
     | 
    
         
            +
                      plugin_klass
         
     | 
| 
      
 19 
     | 
    
         
            +
                    end
         
     | 
| 
      
 20 
     | 
    
         
            +
                    
         
     | 
| 
      
 21 
     | 
    
         
            +
                    def include_deployments(dir)
         
     | 
| 
      
 22 
     | 
    
         
            +
                      return nil unless ::File.directory? dir
         
     | 
| 
      
 23 
     | 
    
         
            +
                      Dir["#{dir}/*"].each do |fi|
         
     | 
| 
      
 24 
     | 
    
         
            +
                        include_deployment fi
         
     | 
| 
      
 25 
     | 
    
         
            +
                      end
         
     | 
| 
      
 26 
     | 
    
         
            +
                      dir
         
     | 
| 
      
 27 
     | 
    
         
            +
                    end
         
     | 
| 
      
 28 
     | 
    
         
            +
                  end
         
     | 
| 
      
 29 
     | 
    
         
            +
                end    
         
     | 
| 
      
 30 
     | 
    
         
            +
              end
         
     | 
| 
      
 31 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -13,6 +13,15 @@ module PoolParty 
     | 
|
| 
       13 
13 
     | 
    
         
             
                end
         
     | 
| 
       14 
14 
     | 
    
         
             
              end
         
     | 
| 
       15 
15 
     | 
    
         | 
| 
      
 16 
     | 
    
         
            +
              def print_with_nice_printer(header=nil, strs=[])
         
     | 
| 
      
 17 
     | 
    
         
            +
                returning NicePrinter.new do |printer|
         
     | 
| 
      
 18 
     | 
    
         
            +
                  printer.header
         
     | 
| 
      
 19 
     | 
    
         
            +
                  printer.center(header) if header
         
     | 
| 
      
 20 
     | 
    
         
            +
                  strs.each {|st| printer << st if st}
         
     | 
| 
      
 21 
     | 
    
         
            +
                  printer.footer
         
     | 
| 
      
 22 
     | 
    
         
            +
                end.print
         
     | 
| 
      
 23 
     | 
    
         
            +
              end
         
     | 
| 
      
 24 
     | 
    
         
            +
              
         
     | 
| 
       16 
25 
     | 
    
         
             
              def pool_specfile
         
     | 
| 
       17 
26 
     | 
    
         
             
                $pool_specfile
         
     | 
| 
       18 
27 
     | 
    
         
             
              end
         
     | 
| 
         @@ -6,7 +6,7 @@ module PoolParty 
     | 
|
| 
       6 
6 
     | 
    
         
             
                  ebs_volume_mount_point loc
         
     | 
| 
       7 
7 
     | 
    
         
             
                  ebs_volume_device "/dev/#{id.sanitize}"
         
     | 
| 
       8 
8 
     | 
    
         | 
| 
       9 
     | 
    
         
            -
                  has_mount(:name => loc, :device => ebs_volume_device 
     | 
| 
      
 9 
     | 
    
         
            +
                  has_mount(:name => loc, :device => ebs_volume_device)
         
     | 
| 
       10 
10 
     | 
    
         
             
                  has_directory(:name => loc)
         
     | 
| 
       11 
11 
     | 
    
         
             
                end
         
     | 
| 
       12 
12 
     | 
    
         | 
| 
         @@ -55,6 +55,8 @@ module PoolParty 
     | 
|
| 
       55 
55 
     | 
    
         
             
                  return nil
         
     | 
| 
       56 
56 
     | 
    
         
             
                end
         
     | 
| 
       57 
57 
     | 
    
         | 
| 
      
 58 
     | 
    
         
            +
                # The keypair name can be one name or another including id_rsa or not
         
     | 
| 
      
 59 
     | 
    
         
            +
                # So let's get the name that exists as a keypair
         
     | 
| 
       58 
60 
     | 
    
         
             
                def full_keypair_name
         
     | 
| 
       59 
61 
     | 
    
         
             
                  keypair_paths.each do |path|
         
     | 
| 
       60 
62 
     | 
    
         
             
                    possible_keypair_basenames.each do |base|
         
     | 
| 
         @@ -26,11 +26,11 @@ module PoolParty 
     | 
|
| 
       26 
26 
     | 
    
         
             
                  path = ::File.join( Base.storage_directory, dirname )
         
     | 
| 
       27 
27 
     | 
    
         
             
                  make_base_path path
         
     | 
| 
       28 
28 
     | 
    
         
             
                end
         
     | 
| 
       29 
     | 
    
         
            -
                def write_to_file_in_storage_directory(file, str, preceded="", &block)
         
     | 
| 
      
 29 
     | 
    
         
            +
                def write_to_file_in_storage_directory(file, str="", preceded="", &block)
         
     | 
| 
       30 
30 
     | 
    
         
             
                  path = ::File.join( Base.storage_directory, preceded, ::File.basename(file) )
         
     | 
| 
       31 
31 
     | 
    
         
             
                  write_to_file(path, str, &block)
         
     | 
| 
       32 
32 
     | 
    
         
             
                end
         
     | 
| 
       33 
     | 
    
         
            -
                def write_to_file(file, str, preceded="", &block)
         
     | 
| 
      
 33 
     | 
    
         
            +
                def write_to_file(file, str="", preceded="", &block)
         
     | 
| 
       34 
34 
     | 
    
         
             
                  path = ::File.join( Base.storage_directory, preceded, ::File.basename(file) )
         
     | 
| 
       35 
35 
     | 
    
         
             
                  make_base_path( Base.storage_directory )
         
     | 
| 
       36 
36 
     | 
    
         
             
                  ::File.open(path, "w+") do |f|
         
     | 
| 
         @@ -16,7 +16,7 @@ module PoolParty 
     | 
|
| 
       16 
16 
     | 
    
         
             
                end
         
     | 
| 
       17 
17 
     | 
    
         
             
                # TODO: Fix cookie setting
         
     | 
| 
       18 
18 
     | 
    
         
             
                def self.erl_command(hostname, extra="", min_ports=7000, max_ports=7050)
         
     | 
| 
       19 
     | 
    
         
            -
                  command_line_opts = "-pa #{append_dir}/ebin -kernel inet_dist_listen_min #{min_ports} inet_dist_listen_max #{max_ports} -sname #{hostname} - 
     | 
| 
      
 19 
     | 
    
         
            +
                  command_line_opts = "-pa #{append_dir}/ebin -kernel inet_dist_listen_min #{min_ports} inet_dist_listen_max #{max_ports} -sname #{hostname} -cookie"
         
     | 
| 
       20 
20 
     | 
    
         | 
| 
       21 
21 
     | 
    
         
             
                  "erl #{command_line_opts} #{extra}"
         
     | 
| 
       22 
22 
     | 
    
         
             
                end
         
     | 
| 
         @@ -125,8 +125,7 @@ begin 
     | 
|
| 
       125 
125 
     | 
    
         
             
                    pub_key && private_key
         
     | 
| 
       126 
126 
     | 
    
         
             
                  end
         
     | 
| 
       127 
127 
     | 
    
         
             
                  # The keys are used only for puppet certificates
         
     | 
| 
       128 
     | 
    
         
            -
                  # and are only used for EC2. 
     | 
| 
       129 
     | 
    
         
            -
                  # eventually into the ec2 remoter_base
         
     | 
| 
      
 128 
     | 
    
         
            +
                  # and are only used for EC2.
         
     | 
| 
       130 
129 
     | 
    
         
             
                  # Public key 
         
     | 
| 
       131 
130 
     | 
    
         
             
                  def pub_key
         
     | 
| 
       132 
131 
     | 
    
         
             
                    @pub_key ||= ENV["EC2_CERT"] ? ENV["EC2_CERT"] : nil
         
     | 
| 
         @@ -135,6 +134,10 @@ begin 
     | 
|
| 
       135 
134 
     | 
    
         
             
                  def private_key
         
     | 
| 
       136 
135 
     | 
    
         
             
                    @private_key ||= ENV["EC2_PRIVATE_KEY"] ? ENV["EC2_PRIVATE_KEY"] : nil
         
     | 
| 
       137 
136 
     | 
    
         
             
                  end
         
     | 
| 
      
 137 
     | 
    
         
            +
                  
         
     | 
| 
      
 138 
     | 
    
         
            +
                  def custom_minimum_runnable_options
         
     | 
| 
      
 139 
     | 
    
         
            +
                    [:ami, :availabilty_zone, :security_group]
         
     | 
| 
      
 140 
     | 
    
         
            +
                  end
         
     | 
| 
       138 
141 
     | 
    
         | 
| 
       139 
142 
     | 
    
         
             
                  # Callback
         
     | 
| 
       140 
143 
     | 
    
         
             
                  def custom_install_tasks_for(o)
         
     | 
| 
         @@ -2,8 +2,6 @@ 
     | 
|
| 
       2 
2 
     | 
    
         
             
              This module is included by the remote module and defines the remoting methods
         
     | 
| 
       3 
3 
     | 
    
         
             
              that the clouds can use to rsync or run remote commands
         
     | 
| 
       4 
4 
     | 
    
         
             
            =end
         
     | 
| 
       5 
     | 
    
         
            -
            require File.dirname(__FILE__) + "/../helpers/provisioner_base"
         
     | 
| 
       6 
     | 
    
         
            -
             
     | 
| 
       7 
5 
     | 
    
         
             
            module PoolParty
         
     | 
| 
       8 
6 
     | 
    
         
             
              module Remote
         
     | 
| 
       9 
7 
     | 
    
         
             
                module Remoter
         
     | 
| 
         @@ -189,9 +187,9 @@ module PoolParty 
     | 
|
| 
       189 
187 
     | 
    
         
             
                      last_instances = nonmaster_nonterminated_instances[(@num_instances - (num))..(@num_instances)]
         
     | 
| 
       190 
188 
     | 
    
         
             
                      last_instances.each do |inst|
         
     | 
| 
       191 
189 
     | 
    
         
             
                        vputs "Provision slave: #{inst}"
         
     | 
| 
       192 
     | 
    
         
            -
                        hide_output {PoolParty::Provisioner.process_clean_reconfigure_for!(inst, self)}
         
     | 
| 
      
 190 
     | 
    
         
            +
                        # hide_output {PoolParty::Provisioner.process_clean_reconfigure_for!(inst, self)}
         
     | 
| 
       193 
191 
     | 
    
         
             
                        PoolParty::Provisioner.provision_slave(inst, self, false) unless inst.master? rescue vputs "Error"
         
     | 
| 
       194 
     | 
    
         
            -
                        hide_output {PoolParty::Provisioner.process_clean_reconfigure_for!(inst, self)}
         
     | 
| 
      
 192 
     | 
    
         
            +
                        # hide_output {PoolParty::Provisioner.process_clean_reconfigure_for!(inst, self)}
         
     | 
| 
       195 
193 
     | 
    
         
             
                        # cmd = ". /etc/profile && cloud-provision -i #{inst.name.gsub(/node/, '')} &"
         
     | 
| 
       196 
194 
     | 
    
         
             
                        # vputs "Provision slave with command #{cmd}"
         
     | 
| 
       197 
195 
     | 
    
         
             
                      end
         
     | 
| 
         @@ -140,6 +140,13 @@ module PoolParty 
     | 
|
| 
       140 
140 
     | 
    
         
             
                  # Callback after loaded
         
     | 
| 
       141 
141 
     | 
    
         
             
                  def loaded_remoter_base        
         
     | 
| 
       142 
142 
     | 
    
         
             
                  end
         
     | 
| 
      
 143 
     | 
    
         
            +
                  
         
     | 
| 
      
 144 
     | 
    
         
            +
                  # Custom minimum runnable options
         
     | 
| 
      
 145 
     | 
    
         
            +
                  # Extend the minimum runnable options that are necessary
         
     | 
| 
      
 146 
     | 
    
         
            +
                  # for poolparty to run on the remote base
         
     | 
| 
      
 147 
     | 
    
         
            +
                  def custom_minimum_runnable_options
         
     | 
| 
      
 148 
     | 
    
         
            +
                    []
         
     | 
| 
      
 149 
     | 
    
         
            +
                  end
         
     | 
| 
       143 
150 
     | 
    
         | 
| 
       144 
151 
     | 
    
         
             
                  # Custom installation tasks
         
     | 
| 
       145 
152 
     | 
    
         
             
                  # Allow the remoter bases to attach their own tasks on the 
         
     | 
| 
         @@ -54,9 +54,9 @@ module PoolParty 
     | 
|
| 
       54 
54 
     | 
    
         
             
                    # set_parent(parent) if parent && !@parent
         
     | 
| 
       55 
55 
     | 
    
         
             
                    # self.run_in_context parent, &block if block
         
     | 
| 
       56 
56 
     | 
    
         
             
                    setup_defaults
         
     | 
| 
       57 
     | 
    
         
            -
                    realize_plugins!
         
     | 
| 
       58 
     | 
    
         
            -
                    reset! # reset the clouds
         
     | 
| 
       59 
     | 
    
         
            -
                    reset_remoter_base!
         
     | 
| 
      
 57 
     | 
    
         
            +
                    # realize_plugins!
         
     | 
| 
      
 58 
     | 
    
         
            +
                    # reset! # reset the clouds
         
     | 
| 
      
 59 
     | 
    
         
            +
                    # reset_remoter_base!
         
     | 
| 
       60 
60 
     | 
    
         
             
                  end
         
     | 
| 
       61 
61 
     | 
    
         | 
| 
       62 
62 
     | 
    
         
             
                  def setup_defaults
         
     | 
| 
         @@ -79,7 +79,7 @@ module PoolParty 
     | 
|
| 
       79 
79 
     | 
    
         
             
                  def generate_keypair(*args)
         
     | 
| 
       80 
80 
     | 
    
         
             
                    options[:keypair] = "#{parent && parent.is_a?(PoolParty::Pool::Pool) ? parent.name : "poolparty"}_#{name}" unless has_keypair?
         
     | 
| 
       81 
81 
     | 
    
         
             
                  end
         
     | 
| 
       82 
     | 
    
         
            -
             
     | 
| 
      
 82 
     | 
    
         
            +
                        
         
     | 
| 
       83 
83 
     | 
    
         
             
                  # Prepare to send the new configuration to the instances
         
     | 
| 
       84 
84 
     | 
    
         
             
                  # First, let's make sure that our base directory is made
         
     | 
| 
       85 
85 
     | 
    
         
             
                  # Then copy the templates that have no other reference in
         
     | 
| 
         @@ -97,6 +97,7 @@ module PoolParty 
     | 
|
| 
       97 
97 
     | 
    
         
             
                    Script.save!(self)
         
     | 
| 
       98 
98 
     | 
    
         
             
                    # not my favorite...
         
     | 
| 
       99 
99 
     | 
    
         
             
                    copy_ssh_key
         
     | 
| 
      
 100 
     | 
    
         
            +
                    write_unique_cookie
         
     | 
| 
       100 
101 
     | 
    
         
             
                    before_configuration_tasks
         
     | 
| 
       101 
102 
     | 
    
         
             
                  end
         
     | 
| 
       102 
103 
     | 
    
         | 
| 
         @@ -112,6 +113,20 @@ module PoolParty 
     | 
|
| 
       112 
113 
     | 
    
         
             
                    Base.store_keys_in_file_for(self)
         
     | 
| 
       113 
114 
     | 
    
         
             
                  end
         
     | 
| 
       114 
115 
     | 
    
         | 
| 
      
 116 
     | 
    
         
            +
                  # Let's write the cookie into the tmp path
         
     | 
| 
      
 117 
     | 
    
         
            +
                  def write_unique_cookie
         
     | 
| 
      
 118 
     | 
    
         
            +
                    write_to_file_in_storage_directory("cookie") do
         
     | 
| 
      
 119 
     | 
    
         
            +
                      generate_unique_cookie_string
         
     | 
| 
      
 120 
     | 
    
         
            +
                    end
         
     | 
| 
      
 121 
     | 
    
         
            +
                  end
         
     | 
| 
      
 122 
     | 
    
         
            +
                  
         
     | 
| 
      
 123 
     | 
    
         
            +
                  # Generate a unique cookie string so that our erlang modules can 
         
     | 
| 
      
 124 
     | 
    
         
            +
                  # talk to each other safely. This is based off the keypair
         
     | 
| 
      
 125 
     | 
    
         
            +
                  # and the name of the cloud
         
     | 
| 
      
 126 
     | 
    
         
            +
                  def generate_unique_cookie_string
         
     | 
| 
      
 127 
     | 
    
         
            +
                    Digest::SHA256.hexdigest("#{full_keypair_name}#{name}")
         
     | 
| 
      
 128 
     | 
    
         
            +
                  end
         
     | 
| 
      
 129 
     | 
    
         
            +
                  
         
     | 
| 
       115 
130 
     | 
    
         
             
                  # Build the new poolparty manifest
         
     | 
| 
       116 
131 
     | 
    
         
             
                  # Wrapping all of these requirements into the one 
         
     | 
| 
       117 
132 
     | 
    
         
             
                  # poolparty class.
         
     | 
| 
         @@ -201,10 +216,10 @@ module PoolParty 
     | 
|
| 
       201 
216 
     | 
    
         
             
                  # they need a few options to run, these are the required options
         
     | 
| 
       202 
217 
     | 
    
         
             
                  # to be saved on the remote "master" machine
         
     | 
| 
       203 
218 
     | 
    
         
             
                  def minimum_runnable_options
         
     | 
| 
       204 
     | 
    
         
            -
                    [
         
     | 
| 
       205 
     | 
    
         
            -
                      :keypair, :minimum_instances, :maximum_instances, 
     | 
| 
      
 219 
     | 
    
         
            +
                    ([
         
     | 
| 
      
 220 
     | 
    
         
            +
                      :keypair, :minimum_instances, :maximum_instances,
         
     | 
| 
       206 
221 
     | 
    
         
             
                      :expand_when, :contract_when, :set_master_ip_to
         
     | 
| 
       207 
     | 
    
         
            -
                    ]
         
     | 
| 
      
 222 
     | 
    
         
            +
                    ]<< custom_minimum_runnable_options).flatten
         
     | 
| 
       208 
223 
     | 
    
         
             
                  end
         
     | 
| 
       209 
224 
     | 
    
         | 
| 
       210 
225 
     | 
    
         
             
                  # Add all the poolparty requirements here
         
     | 
| 
         @@ -4,7 +4,7 @@ module PoolParty 
     | 
|
| 
       4 
4 
     | 
    
         
             
              module PluginModel
         
     | 
| 
       5 
5 
     | 
    
         | 
| 
       6 
6 
     | 
    
         
             
                def plugin(name=:plugin, cloud=nil, &block)
         
     | 
| 
       7 
     | 
    
         
            -
                  plugins.has_key?(name) ? plugins[name] : (plugins[name] = PluginModel.new(name,  
     | 
| 
      
 7 
     | 
    
         
            +
                  plugins.has_key?(name) ? plugins[name] : (plugins[name] = PluginModel.new(name, &block))
         
     | 
| 
       8 
8 
     | 
    
         
             
                end
         
     | 
| 
       9 
9 
     | 
    
         
             
                alias_method :register_plugin, :plugin
         
     | 
| 
       10 
10 
     | 
    
         | 
| 
         @@ -18,15 +18,15 @@ module PoolParty 
     | 
|
| 
       18 
18 
     | 
    
         
             
                  include Configurable
         
     | 
| 
       19 
19 
     | 
    
         
             
                  include PrettyPrinter      
         
     | 
| 
       20 
20 
     | 
    
         | 
| 
       21 
     | 
    
         
            -
                  def initialize(name 
     | 
| 
      
 21 
     | 
    
         
            +
                  def initialize(name,&block)
         
     | 
| 
       22 
22 
     | 
    
         
             
                    @name = name
         
     | 
| 
       23 
23 
     | 
    
         
             
                    # @parent = cld
         
     | 
| 
       24 
24 
     | 
    
         
             
                    class_string_name = "#{name}"
         
     | 
| 
       25 
25 
     | 
    
         | 
| 
       26 
26 
     | 
    
         
             
                    # Create the class to evaluate the plugin on the implemented call
         
     | 
| 
       27 
     | 
    
         
            -
                    klass = class_string_name.class_constant(PoolParty::Plugin::Plugin)
         
     | 
| 
      
 27 
     | 
    
         
            +
                    @klass = klass = class_string_name.class_constant(PoolParty::Plugin::Plugin)
         
     | 
| 
       28 
28 
     | 
    
         
             
                    mod = class_string_name.module_constant(&block)
         
     | 
| 
       29 
     | 
    
         
            -
             
     | 
| 
      
 29 
     | 
    
         
            +
                    
         
     | 
| 
       30 
30 
     | 
    
         
             
                    klass.send :include, mod
         
     | 
| 
       31 
31 
     | 
    
         | 
| 
       32 
32 
     | 
    
         
             
                    # Store the name of the class for pretty printing later
         
     |