auser-poolparty 1.2.10 → 1.2.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. data/VERSION.yml +1 -1
  2. data/bin/cloud +1 -1
  3. data/bin/cloud-list +19 -7
  4. data/bin/cloud-provision +3 -0
  5. data/bin/cloud-run +37 -0
  6. data/bin/server-list-active +1 -1
  7. data/config/jeweler.rb +2 -2
  8. data/examples/basic.rb +4 -3
  9. data/examples/fairchild.rb +2 -2
  10. data/examples/metavirt_cloud.rb +18 -8
  11. data/examples/simple.rb +4 -3
  12. data/examples/vmrun_cloud.rb +2 -5
  13. data/lib/poolparty.rb +1 -1
  14. data/lib/poolparty/core/object.rb +6 -4
  15. data/lib/poolparty/core/string.rb +2 -1
  16. data/lib/poolparty/helpers/optioner.rb +1 -1
  17. data/lib/poolparty/modules/callbacks.rb +2 -0
  18. data/lib/poolparty/modules/cloud_resourcer.rb +4 -5
  19. data/lib/poolparty/modules/daemonizable.rb +4 -5
  20. data/lib/poolparty/modules/definable_resource.rb +1 -0
  21. data/lib/poolparty/modules/pinger.rb +5 -1
  22. data/lib/poolparty/monitors/monitor_daemon.rb +159 -0
  23. data/lib/poolparty/monitors/monitor_rack.rb +21 -11
  24. data/lib/poolparty/monitors/monitors/clock_monitor.rb +5 -0
  25. data/lib/poolparty/monitors/monitors/elections_monitor.rb +49 -0
  26. data/lib/poolparty/monitors/monitors/neighborhood_monitor.rb +7 -7
  27. data/lib/poolparty/monitors/monitors/stats_monitor.rb +15 -3
  28. data/lib/poolparty/net/init.rb +1 -1
  29. data/lib/poolparty/net/remote_instance.rb +43 -39
  30. data/lib/poolparty/net/remoter/connections.rb +6 -3
  31. data/lib/poolparty/net/remoter/interactive.rb +18 -11
  32. data/lib/poolparty/net/remoter_base.rb +39 -12
  33. data/lib/poolparty/net/remoter_bases/ec2/ec2.rb +23 -19
  34. data/lib/poolparty/net/remoter_bases/ec2/ec2_remote_instance.rb +15 -33
  35. data/lib/poolparty/net/remoter_bases/ec2/ec2_response_object.rb +28 -20
  36. data/lib/poolparty/net/remoter_bases/libvirt/libvirt.rb +73 -0
  37. data/lib/poolparty/net/remoter_bases/libvirt/libvirt_instance.rb +64 -0
  38. data/lib/poolparty/net/remoter_bases/metavirt/metavirt.rb +27 -17
  39. data/lib/poolparty/net/remoter_bases/metavirt/metavirt_instance.rb +20 -35
  40. data/lib/poolparty/net/remoter_bases/vmrun/vmrun.rb +35 -17
  41. data/lib/poolparty/net/remoter_bases/vmrun/vmrun_instance.rb +32 -24
  42. data/lib/poolparty/plugins/apache2/apache.rb +1 -1
  43. data/lib/poolparty/plugins/chef/chef.rb +12 -26
  44. data/lib/poolparty/plugins/chef/chef_deploy.rb +5 -23
  45. data/lib/poolparty/plugins/chef/chef_deploy_definition.rb +32 -0
  46. data/lib/poolparty/plugins/chef/chef_library.rb +7 -0
  47. data/lib/poolparty/plugins/chef/chef_recipe.rb +7 -0
  48. data/lib/poolparty/plugins/chef/include_chef_recipe.rb +14 -0
  49. data/lib/poolparty/{resources → plugins}/host.rb +5 -4
  50. data/lib/poolparty/plugins/line_in_file.rb +1 -1
  51. data/lib/poolparty/{resources → plugins}/sshkey.rb +10 -8
  52. data/lib/poolparty/poolparty/cloud.rb +7 -0
  53. data/lib/poolparty/poolparty/default.rb +0 -2
  54. data/lib/poolparty/poolparty/pool.rb +13 -3
  55. data/lib/poolparty/provision/boot_strapper.rb +8 -8
  56. data/lib/poolparty/resources/exec.rb +7 -0
  57. data/lib/poolparty/resources/group.rb +3 -3
  58. data/lib/poolparty/resources/user.rb +6 -1
  59. data/lib/poolparty/templates/monitor.ru +12 -0
  60. data/spec/poolparty/net/remoter_bases/ec2_remote_instance_spec.rb +0 -2
  61. data/spec/poolparty/net/remoter_bases/ec2_spec.rb +7 -4
  62. data/spec/poolparty/poolparty/example_spec.rb +21 -21
  63. data/spec/poolparty/poolparty/pool_spec.rb +2 -1
  64. data/spec/poolparty/resources/sshkey_spec.rb +39 -40
  65. data/tasks/poolparty.rake +27 -1
  66. data/test/fixtures/fake_clouds.rb +11 -0
  67. data/test/poolparty/dependency_resolver/chef_resolver_test.rb +82 -0
  68. data/test/poolparty/monitors/test_base_monitor.rb +2 -2
  69. data/test/poolparty/monitors/test_monitor_rack.rb +11 -24
  70. data/test/poolparty/net/remoter_base_test.rb +4 -5
  71. data/test/poolparty/net/remoter_bases/libvirt/libvirt_test.rb +70 -0
  72. data/test/poolparty/net/remoter_bases/metavirt/metavirt_test.rb +32 -3
  73. data/test/poolparty/plugins/chef_plugin_test.rb +23 -0
  74. data/test/poolparty/poolparty/pool_test.rb +22 -0
  75. data/vendor/gems/dslify/lib/dslify.rb +3 -0
  76. data/vendor/gems/dslify/test/dslify_test.rb +4 -15
  77. data/vendor/gems/git-style-binaries/README.markdown +6 -0
  78. data/vendor/gems/git-style-binaries/Rakefile +1 -1
  79. data/vendor/gems/git-style-binaries/VERSION.yml +1 -1
  80. data/vendor/gems/git-style-binaries/doc/gsb-screencast.png +0 -0
  81. data/vendor/gems/git-style-binaries/doc/poolparty-binaries.screenplay +11 -13
  82. data/vendor/gems/git-style-binaries/git-style-binaries.gemspec +12 -3
  83. data/vendor/gems/git-style-binaries/lib/git-style-binary.rb +15 -1
  84. data/vendor/gems/git-style-binaries/test/running_binaries_test.rb +2 -2
  85. data/vendor/gems/suitcase/VERSION.yml +1 -1
  86. data/vendor/gems/suitcase/lib/suitcase/zipper.rb +73 -25
  87. data/vendor/gems/suitcase/suitcase.gemspec +5 -5
  88. data/vendor/gems/suitcase/test/suitcase_test.rb +12 -6
  89. data/vendor/gems/suitcase/test/test_dir/gems/famoseagle-carrot-0.6.0.gem +0 -0
  90. metadata +24 -52
  91. data/spec/poolparty/resources/host_spec.rb +0 -35
  92. data/vendor/gems/rest-client/README.rdoc +0 -151
  93. data/vendor/gems/rest-client/Rakefile +0 -85
  94. data/vendor/gems/rest-client/bin/restclient +0 -87
  95. data/vendor/gems/rest-client/lib/rest_client.rb +0 -2
  96. data/vendor/gems/rest-client/lib/restclient.rb +0 -93
  97. data/vendor/gems/rest-client/lib/restclient/exceptions.rb +0 -84
  98. data/vendor/gems/rest-client/lib/restclient/mixin/response.rb +0 -43
  99. data/vendor/gems/rest-client/lib/restclient/raw_response.rb +0 -30
  100. data/vendor/gems/rest-client/lib/restclient/request.rb +0 -232
  101. data/vendor/gems/rest-client/lib/restclient/resource.rb +0 -146
  102. data/vendor/gems/rest-client/lib/restclient/response.rb +0 -20
  103. data/vendor/gems/rest-client/rest-client.gemspec +0 -21
  104. data/vendor/gems/rest-client/spec/base.rb +0 -4
  105. data/vendor/gems/rest-client/spec/exceptions_spec.rb +0 -54
  106. data/vendor/gems/rest-client/spec/mixin/response_spec.rb +0 -46
  107. data/vendor/gems/rest-client/spec/raw_response_spec.rb +0 -17
  108. data/vendor/gems/rest-client/spec/request_spec.rb +0 -442
  109. data/vendor/gems/rest-client/spec/resource_spec.rb +0 -75
  110. data/vendor/gems/rest-client/spec/response_spec.rb +0 -16
  111. data/vendor/gems/rest-client/spec/restclient_spec.rb +0 -53
@@ -1,75 +0,0 @@
1
- require File.dirname(__FILE__) + '/base'
2
-
3
- describe RestClient::Resource do
4
- before do
5
- @resource = RestClient::Resource.new('http://some/resource', :user => 'jane', :password => 'mypass', :headers => { 'X-Something' => '1'})
6
- end
7
-
8
- context "Resource delegation" do
9
- it "GET" do
10
- RestClient::Request.should_receive(:execute).with(:method => :get, :url => 'http://some/resource', :headers => { 'X-Something' => '1'}, :user => 'jane', :password => 'mypass')
11
- @resource.get
12
- end
13
-
14
- it "POST" do
15
- RestClient::Request.should_receive(:execute).with(:method => :post, :url => 'http://some/resource', :payload => 'abc', :headers => { :content_type => 'image/jpg', 'X-Something' => '1'}, :user => 'jane', :password => 'mypass')
16
- @resource.post 'abc', :content_type => 'image/jpg'
17
- end
18
-
19
- it "PUT" do
20
- RestClient::Request.should_receive(:execute).with(:method => :put, :url => 'http://some/resource', :payload => 'abc', :headers => { :content_type => 'image/jpg', 'X-Something' => '1'}, :user => 'jane', :password => 'mypass')
21
- @resource.put 'abc', :content_type => 'image/jpg'
22
- end
23
-
24
- it "DELETE" do
25
- RestClient::Request.should_receive(:execute).with(:method => :delete, :url => 'http://some/resource', :headers => { 'X-Something' => '1'}, :user => 'jane', :password => 'mypass')
26
- @resource.delete
27
- end
28
-
29
- it "overrides resource headers" do
30
- RestClient::Request.should_receive(:execute).with(:method => :get, :url => 'http://some/resource', :headers => { 'X-Something' => '2'}, :user => 'jane', :password => 'mypass')
31
- @resource.get 'X-Something' => '2'
32
- end
33
- end
34
-
35
- it "can instantiate with no user/password" do
36
- @resource = RestClient::Resource.new('http://some/resource')
37
- end
38
-
39
- it "is backwards compatible with previous constructor" do
40
- @resource = RestClient::Resource.new('http://some/resource', 'user', 'pass')
41
- @resource.user.should == 'user'
42
- @resource.password.should == 'pass'
43
- end
44
-
45
- it "concatinates urls, inserting a slash when it needs one" do
46
- @resource.concat_urls('http://example.com', 'resource').should == 'http://example.com/resource'
47
- end
48
-
49
- it "concatinates urls, using no slash if the first url ends with a slash" do
50
- @resource.concat_urls('http://example.com/', 'resource').should == 'http://example.com/resource'
51
- end
52
-
53
- it "concatinates urls, using no slash if the second url starts with a slash" do
54
- @resource.concat_urls('http://example.com', '/resource').should == 'http://example.com/resource'
55
- end
56
-
57
- it "concatinates even non-string urls, :posts + 1 => 'posts/1'" do
58
- @resource.concat_urls(:posts, 1).should == 'posts/1'
59
- end
60
-
61
- it "offers subresources via []" do
62
- parent = RestClient::Resource.new('http://example.com')
63
- parent['posts'].url.should == 'http://example.com/posts'
64
- end
65
-
66
- it "transports options to subresources" do
67
- parent = RestClient::Resource.new('http://example.com', :user => 'user', :password => 'password')
68
- parent['posts'].user.should == 'user'
69
- parent['posts'].password.should == 'password'
70
- end
71
-
72
- it "prints its url with to_s" do
73
- RestClient::Resource.new('x').to_s.should == 'x'
74
- end
75
- end
@@ -1,16 +0,0 @@
1
- require File.dirname(__FILE__) + '/base'
2
-
3
- describe RestClient::Response do
4
- before do
5
- @net_http_res = mock('net http response')
6
- @response = RestClient::Response.new('abc', @net_http_res)
7
- end
8
-
9
- it "behaves like string" do
10
- @response.should == 'abc'
11
- end
12
-
13
- it "accepts nil strings and sets it to empty for the case of HEAD" do
14
- RestClient::Response.new(nil, @net_http_res).should == ""
15
- end
16
- end
@@ -1,53 +0,0 @@
1
- require File.dirname(__FILE__) + '/base'
2
-
3
- describe RestClient do
4
- describe "API" do
5
- it "GET" do
6
- RestClient::Request.should_receive(:execute).with(:method => :get, :url => 'http://some/resource', :headers => {})
7
- RestClient.get('http://some/resource')
8
- end
9
-
10
- it "POST" do
11
- RestClient::Request.should_receive(:execute).with(:method => :post, :url => 'http://some/resource', :payload => 'payload', :headers => {})
12
- RestClient.post('http://some/resource', 'payload')
13
- end
14
-
15
- it "PUT" do
16
- RestClient::Request.should_receive(:execute).with(:method => :put, :url => 'http://some/resource', :payload => 'payload', :headers => {})
17
- RestClient.put('http://some/resource', 'payload')
18
- end
19
-
20
- it "DELETE" do
21
- RestClient::Request.should_receive(:execute).with(:method => :delete, :url => 'http://some/resource', :headers => {})
22
- RestClient.delete('http://some/resource')
23
- end
24
-
25
- it "HEAD" do
26
- RestClient::Request.should_receive(:execute).with(:method => :head, :url => 'http://some/resource', :headers => {})
27
- RestClient.head('http://some/resource')
28
- end
29
- end
30
-
31
- describe "logging" do
32
- after do
33
- RestClient.log = nil
34
- end
35
-
36
- it "gets the log source from the RESTCLIENT_LOG environment variable" do
37
- ENV.stub!(:[]).with('RESTCLIENT_LOG').and_return('from env')
38
- RestClient.log = 'from class method'
39
- RestClient.log.should == 'from env'
40
- end
41
-
42
- it "sets a destination for log output, used if no environment variable is set" do
43
- ENV.stub!(:[]).with('RESTCLIENT_LOG').and_return(nil)
44
- RestClient.log = 'from class method'
45
- RestClient.log.should == 'from class method'
46
- end
47
-
48
- it "returns nil (no logging) if neither are set (default)" do
49
- ENV.stub!(:[]).with('RESTCLIENT_LOG').and_return(nil)
50
- RestClient.log.should == nil
51
- end
52
- end
53
- end