ridley 0.11.0.rc1 → 0.11.1

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.
Files changed (42) hide show
  1. data/.travis.yml +3 -2
  2. data/Gemfile +1 -0
  3. data/Guardfile +2 -2
  4. data/Thorfile +2 -2
  5. data/lib/ridley/chef.rb +1 -0
  6. data/lib/ridley/chef/chefignore.rb +76 -0
  7. data/lib/ridley/chef/cookbook.rb +17 -7
  8. data/lib/ridley/chef/cookbook/metadata.rb +8 -0
  9. data/lib/ridley/chef_objects/cookbook_object.rb +21 -37
  10. data/lib/ridley/chef_objects/data_bag_item_obect.rb +9 -0
  11. data/lib/ridley/client.rb +2 -2
  12. data/lib/ridley/connection.rb +12 -6
  13. data/lib/ridley/errors.rb +14 -0
  14. data/lib/ridley/host_connector.rb +10 -3
  15. data/lib/ridley/resource.rb +25 -5
  16. data/lib/ridley/resources/cookbook_resource.rb +19 -9
  17. data/lib/ridley/resources/data_bag_item_resource.rb +8 -4
  18. data/lib/ridley/resources/search_resource.rb +5 -5
  19. data/lib/ridley/sandbox_uploader.rb +6 -0
  20. data/lib/ridley/version.rb +1 -1
  21. data/ridley.gemspec +1 -1
  22. data/spec/acceptance/client_resource_spec.rb +44 -62
  23. data/spec/acceptance/cookbook_resource_spec.rb +27 -0
  24. data/spec/acceptance/data_bag_item_resource_spec.rb +36 -54
  25. data/spec/acceptance/data_bag_resource_spec.rb +9 -21
  26. data/spec/acceptance/environment_resource_spec.rb +34 -63
  27. data/spec/acceptance/node_resource_spec.rb +27 -47
  28. data/spec/acceptance/role_resource_spec.rb +27 -67
  29. data/spec/acceptance/sandbox_resource_spec.rb +3 -13
  30. data/spec/acceptance/search_resource_spec.rb +5 -15
  31. data/spec/fixtures/chefignore +8 -0
  32. data/spec/spec_helper.rb +15 -1
  33. data/spec/support/chef_server.rb +77 -0
  34. data/spec/unit/ridley/chef/chefignore_spec.rb +40 -0
  35. data/spec/unit/ridley/chef/cookbook_spec.rb +30 -2
  36. data/spec/unit/ridley/chef_objects/cookbook_object_spec.rb +3 -3
  37. data/spec/unit/ridley/connection_spec.rb +1 -2
  38. data/spec/unit/ridley/resources/cookbook_resource_spec.rb +85 -48
  39. data/spec/unit/ridley/resources/data_bag_resource_spec.rb +1 -1
  40. data/spec/unit/ridley/resources/search_resource_spec.rb +39 -2
  41. data/spec/unit/ridley/sandbox_uploader_spec.rb +25 -0
  42. metadata +19 -7
@@ -11,7 +11,7 @@ describe Ridley::DataBagResource do
11
11
  subject.should be_a(Ridley::DataBagItemResource)
12
12
  end
13
13
 
14
- its(:data_bag_secret) { should eql(secret) }
14
+ its(:encrypted_data_bag_secret) { should eql(secret) }
15
15
  end
16
16
 
17
17
  describe "#find" do
@@ -95,8 +95,9 @@ describe Ridley::SearchResource do
95
95
  start: 0
96
96
  })
97
97
  end
98
+ let(:registry) { double("registry", :[] => nil) }
98
99
 
99
- let(:run) { subject.run(index, query_string) }
100
+ let(:run) { subject.run(index, query_string, registry) }
100
101
 
101
102
  before do
102
103
  connection.stub(:get).and_return(response)
@@ -143,6 +144,15 @@ describe Ridley::SearchResource do
143
144
  result.should be_a(Array)
144
145
  result.should each be_a(Ridley::NodeObject)
145
146
  end
147
+
148
+ context "after the search has executed and results are returned" do
149
+ let(:search_results) { subject.run(index, query_string, registry) }
150
+
151
+ it "Ridley::NodeObject instances contain the results" do
152
+ first_result = search_results.first
153
+ first_result.name.should eq("ridley-one")
154
+ end
155
+ end
146
156
  end
147
157
 
148
158
  context "when :role is the given index" do
@@ -172,6 +182,15 @@ describe Ridley::SearchResource do
172
182
  result.should be_a(Array)
173
183
  result.should each be_a(Ridley::RoleObject)
174
184
  end
185
+
186
+ context "after the search has executed and results are returned" do
187
+ let(:search_results) { subject.run(index, query_string, registry) }
188
+
189
+ it "Ridley::RoleObject instances contain the results" do
190
+ first_result = search_results.first
191
+ first_result.name.should eq("ridley-role-one")
192
+ end
193
+ end
175
194
  end
176
195
 
177
196
  context "when :environment is the given index" do
@@ -200,6 +219,15 @@ describe Ridley::SearchResource do
200
219
  result.should be_a(Array)
201
220
  result.should each be_a(Ridley::EnvironmentObject)
202
221
  end
222
+
223
+ context "after the search has executed and results are returned" do
224
+ let(:search_results) { subject.run(index, query_string, registry) }
225
+
226
+ it "Ridley::EnvironmentObject instances contain the results" do
227
+ first_result = search_results.first
228
+ first_result.name.should eq("ridley-env-test")
229
+ end
230
+ end
203
231
  end
204
232
 
205
233
  context "when :client is the given index" do
@@ -209,7 +237,7 @@ describe Ridley::SearchResource do
209
237
  rows: [
210
238
  {
211
239
  chef_type: "client",
212
- name: nil,
240
+ name: "ridley-client-test",
213
241
  admin: false,
214
242
  validator: false,
215
243
  certificate: "-----BEGIN CERTIFICATE-----\nMIIDOjCCAqOgAwIBAgIE47eOmDANBgkqhkiG9w0BAQUFADCBnjELMAkGA1UEBhMC\nVVMxEzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxFjAUBgNV\nBAoMDU9wc2NvZGUsIEluYy4xHDAaBgNVBAsME0NlcnRpZmljYXRlIFNlcnZpY2Ux\nMjAwBgNVBAMMKW9wc2NvZGUuY29tL2VtYWlsQWRkcmVzcz1hdXRoQG9wc2NvZGUu\nY29tMCAXDTEyMTAwOTAwMTUxNVoYDzIxMDExMTA0MDAxNTE1WjCBnTEQMA4GA1UE\nBxMHU2VhdHRsZTETMBEGA1UECBMKV2FzaGluZ3RvbjELMAkGA1UEBhMCVVMxHDAa\nBgNVBAsTE0NlcnRpZmljYXRlIFNlcnZpY2UxFjAUBgNVBAoTDU9wc2NvZGUsIElu\nYy4xMTAvBgNVBAMUKFVSSTpodHRwOi8vb3BzY29kZS5jb20vR1VJRFMvY2xpZW50\nX2d1aWQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCqB9KEGzl7Wcm/\nwz/x8HByZANCn6WQC+R12qQso5I6nLbTNkRP668jXG3j0R5/F5i/KearAB9ePzL/\nQe3iHtwW6u1qLI1hVNFNB+I1fGu1p6fZyIOjnLn3bqsbOkBplHOIqHsp4GVSsHKb\nD32UXZDa9S9ZFXnR4iT6hUGm5895ReZG9TDiHvBpi9NJFDZXz+AQ6JuQY8UgYMMA\nm80KbO8/NJlXbRW+siRuvr+LIsi9Mx4i63pBWAN46my291rQU31PF3IB+btfGtR/\nyDWDgMSB37bTzZeOf1Dg9fpl2vIXyu3PoHER0oYmrMQbrdwAt7qCHZNuNWn51WPb\n1PHxXL1rAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAGnJUVAv951fUhGyPOrl+LbQG\nqgchMwIn7oDLE863e66BYTDj7koK3jjhx3EBkrT2vt/xS4yW0ZRV1BNqfnNKWbBq\nMNQiKkYdTr+oq2O3plOg/q/M1eG1B5pxGXqvH0O76DVWQcV/svO+HQEi1n8y5UQd\n+pBJCygpuv78wPCM+c4=\n-----END CERTIFICATE-----\n",
@@ -229,6 +257,15 @@ describe Ridley::SearchResource do
229
257
  result.should be_a(Array)
230
258
  result.should each be_a(Ridley::ClientObject)
231
259
  end
260
+
261
+ context "after the search has executed and results are returned" do
262
+ let(:search_results) { subject.run(index, query_string, registry) }
263
+
264
+ it "Ridley::ClientObject instances contain the results" do
265
+ first_result = search_results.first
266
+ first_result.name.should eq("ridley-client-test")
267
+ end
268
+ end
232
269
  end
233
270
  end
234
271
  end
@@ -48,6 +48,10 @@ describe Ridley::SandboxUploader do
48
48
  let(:chk_id) { "oGCPHrQ+5MylEL+V+NIJ9w==" }
49
49
  let(:path) { fixtures_path.join('reset.pem').to_s }
50
50
 
51
+ before do
52
+ connection.stub(foss?: false)
53
+ end
54
+
51
55
  context "when the checksum needs uploading" do
52
56
  let(:checksums) do
53
57
  {
@@ -82,5 +86,26 @@ describe Ridley::SandboxUploader do
82
86
  subject.upload(sandbox, chk_id, path).should be_nil
83
87
  end
84
88
  end
89
+
90
+ context "when the connection is an open source server connection with a non-80 port" do
91
+ before do
92
+ connection.stub(foss?: true, server_url: "http://localhost:8889")
93
+ end
94
+
95
+ let(:checksums) do
96
+ {
97
+ chk_id => {
98
+ url: "http://localhost/sandboxes/bd091b150b0a4578b97771af6abf3e05",
99
+ needs_upload: true
100
+ }
101
+ }
102
+ end
103
+
104
+ it "does not strip the port from the target to upload to" do
105
+ stub_request(:put, "http://localhost:8889/sandboxes/bd091b150b0a4578b97771af6abf3e05")
106
+
107
+ subject.upload(sandbox, chk_id, path)
108
+ end
109
+ end
85
110
  end
86
111
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ridley
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0.rc1
5
- prerelease: 7
4
+ version: 0.11.1
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jamie Winsor
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-18 00:00:00.000000000 Z
12
+ date: 2013-05-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -178,7 +178,7 @@ dependencies:
178
178
  requirements:
179
179
  - - ! '>='
180
180
  - !ruby/object:Gem::Version
181
- version: 0.4.1
181
+ version: 0.4.3
182
182
  type: :runtime
183
183
  prerelease: false
184
184
  version_requirements: !ruby/object:Gem::Requirement
@@ -186,7 +186,7 @@ dependencies:
186
186
  requirements:
187
187
  - - ! '>='
188
188
  - !ruby/object:Gem::Version
189
- version: 0.4.1
189
+ version: 0.4.3
190
190
  - !ruby/object:Gem::Dependency
191
191
  name: celluloid
192
192
  requirement: !ruby/object:Gem::Requirement
@@ -308,6 +308,7 @@ files:
308
308
  - lib/ridley/bootstrapper/context.rb
309
309
  - lib/ridley/chain_link.rb
310
310
  - lib/ridley/chef.rb
311
+ - lib/ridley/chef/chefignore.rb
311
312
  - lib/ridley/chef/cookbook.rb
312
313
  - lib/ridley/chef/cookbook/metadata.rb
313
314
  - lib/ridley/chef/cookbook/syntax_check.rb
@@ -361,6 +362,7 @@ files:
361
362
  - ridley.gemspec
362
363
  - spec/acceptance/bootstrapping_spec.rb
363
364
  - spec/acceptance/client_resource_spec.rb
365
+ - spec/acceptance/cookbook_resource_spec.rb
364
366
  - spec/acceptance/data_bag_item_resource_spec.rb
365
367
  - spec/acceptance/data_bag_resource_spec.rb
366
368
  - spec/acceptance/environment_resource_spec.rb
@@ -368,6 +370,7 @@ files:
368
370
  - spec/acceptance/role_resource_spec.rb
369
371
  - spec/acceptance/sandbox_resource_spec.rb
370
372
  - spec/acceptance/search_resource_spec.rb
373
+ - spec/fixtures/chefignore
371
374
  - spec/fixtures/encrypted_data_bag_secret
372
375
  - spec/fixtures/example_cookbook/README.md
373
376
  - spec/fixtures/example_cookbook/attributes/default.rb
@@ -385,6 +388,7 @@ files:
385
388
  - spec/fixtures/reset.pem
386
389
  - spec/spec_helper.rb
387
390
  - spec/support/actor_mocking.rb
391
+ - spec/support/chef_server.rb
388
392
  - spec/support/each_matcher.rb
389
393
  - spec/support/filepath_matchers.rb
390
394
  - spec/support/shared_examples/ridley_resource.rb
@@ -393,6 +397,7 @@ files:
393
397
  - spec/unit/ridley/bootstrap_bindings/windows_template_binding_spec.rb
394
398
  - spec/unit/ridley/bootstrapper/context_spec.rb
395
399
  - spec/unit/ridley/bootstrapper_spec.rb
400
+ - spec/unit/ridley/chef/chefignore_spec.rb
396
401
  - spec/unit/ridley/chef/cookbook_spec.rb
397
402
  - spec/unit/ridley/chef/digester_spec.rb
398
403
  - spec/unit/ridley/chef_object_spec.rb
@@ -446,9 +451,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
446
451
  required_rubygems_version: !ruby/object:Gem::Requirement
447
452
  none: false
448
453
  requirements:
449
- - - ! '>'
454
+ - - ! '>='
450
455
  - !ruby/object:Gem::Version
451
- version: 1.3.1
456
+ version: '0'
457
+ segments:
458
+ - 0
459
+ hash: 2982737321566508752
452
460
  requirements: []
453
461
  rubyforge_project:
454
462
  rubygems_version: 1.8.23
@@ -458,6 +466,7 @@ summary: A reliable Chef API client with a clean syntax
458
466
  test_files:
459
467
  - spec/acceptance/bootstrapping_spec.rb
460
468
  - spec/acceptance/client_resource_spec.rb
469
+ - spec/acceptance/cookbook_resource_spec.rb
461
470
  - spec/acceptance/data_bag_item_resource_spec.rb
462
471
  - spec/acceptance/data_bag_resource_spec.rb
463
472
  - spec/acceptance/environment_resource_spec.rb
@@ -465,6 +474,7 @@ test_files:
465
474
  - spec/acceptance/role_resource_spec.rb
466
475
  - spec/acceptance/sandbox_resource_spec.rb
467
476
  - spec/acceptance/search_resource_spec.rb
477
+ - spec/fixtures/chefignore
468
478
  - spec/fixtures/encrypted_data_bag_secret
469
479
  - spec/fixtures/example_cookbook/README.md
470
480
  - spec/fixtures/example_cookbook/attributes/default.rb
@@ -482,6 +492,7 @@ test_files:
482
492
  - spec/fixtures/reset.pem
483
493
  - spec/spec_helper.rb
484
494
  - spec/support/actor_mocking.rb
495
+ - spec/support/chef_server.rb
485
496
  - spec/support/each_matcher.rb
486
497
  - spec/support/filepath_matchers.rb
487
498
  - spec/support/shared_examples/ridley_resource.rb
@@ -490,6 +501,7 @@ test_files:
490
501
  - spec/unit/ridley/bootstrap_bindings/windows_template_binding_spec.rb
491
502
  - spec/unit/ridley/bootstrapper/context_spec.rb
492
503
  - spec/unit/ridley/bootstrapper_spec.rb
504
+ - spec/unit/ridley/chef/chefignore_spec.rb
493
505
  - spec/unit/ridley/chef/cookbook_spec.rb
494
506
  - spec/unit/ridley/chef/digester_spec.rb
495
507
  - spec/unit/ridley/chef_object_spec.rb