ridley 4.2.0 → 4.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/Gemfile +1 -1
  4. data/README.md +4 -4
  5. data/lib/ridley/connection.rb +1 -2
  6. data/lib/ridley/errors.rb +1 -0
  7. data/lib/ridley/mixin/params_validate.rb +4 -0
  8. data/lib/ridley/version.rb +1 -1
  9. data/ridley.gemspec +2 -2
  10. data/spec/acceptance/client_resource_spec.rb +12 -12
  11. data/spec/acceptance/cookbook_resource_spec.rb +15 -15
  12. data/spec/acceptance/data_bag_item_resource_spec.rb +14 -14
  13. data/spec/acceptance/data_bag_resource_spec.rb +4 -4
  14. data/spec/acceptance/environment_resource_spec.rb +14 -14
  15. data/spec/acceptance/node_resource_spec.rb +15 -15
  16. data/spec/acceptance/role_resource_spec.rb +14 -14
  17. data/spec/acceptance/sandbox_resource_spec.rb +3 -3
  18. data/spec/acceptance/search_resource_spec.rb +6 -6
  19. data/spec/acceptance/user_resource_spec.rb +21 -21
  20. data/spec/support/each_matcher.rb +2 -2
  21. data/spec/support/filepath_matchers.rb +2 -2
  22. data/spec/support/shared_examples/ridley_resource.rb +39 -39
  23. data/spec/unit/ridley/chef/cookbook/metadata_spec.rb +8 -8
  24. data/spec/unit/ridley/chef/cookbook/syntax_check_spec.rb +15 -15
  25. data/spec/unit/ridley/chef/cookbook_spec.rb +124 -118
  26. data/spec/unit/ridley/chef/digester_spec.rb +2 -2
  27. data/spec/unit/ridley/chef_object_spec.rb +35 -35
  28. data/spec/unit/ridley/chef_objects/client_object_spec.rb +2 -2
  29. data/spec/unit/ridley/chef_objects/cookbook_object_spec.rb +12 -12
  30. data/spec/unit/ridley/chef_objects/data_bag_item_object_spec.rb +7 -7
  31. data/spec/unit/ridley/chef_objects/data_bag_object_spec.rb +4 -1
  32. data/spec/unit/ridley/chef_objects/environment_object_spec.rb +10 -10
  33. data/spec/unit/ridley/chef_objects/node_object_spec.rb +28 -28
  34. data/spec/unit/ridley/chef_objects/role_object_spec.rb +10 -10
  35. data/spec/unit/ridley/chef_objects/sandbox_object_spec.rb +6 -6
  36. data/spec/unit/ridley/client_spec.rb +59 -21
  37. data/spec/unit/ridley/connection_spec.rb +7 -7
  38. data/spec/unit/ridley/errors_spec.rb +3 -3
  39. data/spec/unit/ridley/middleware/chef_auth_spec.rb +2 -2
  40. data/spec/unit/ridley/middleware/chef_response_spec.rb +29 -29
  41. data/spec/unit/ridley/middleware/parse_json_spec.rb +14 -14
  42. data/spec/unit/ridley/mixins/from_file_spec.rb +3 -3
  43. data/spec/unit/ridley/resource_spec.rb +5 -5
  44. data/spec/unit/ridley/resources/cookbook_resource_spec.rb +10 -10
  45. data/spec/unit/ridley/resources/data_bag_item_resource_spec.rb +1 -1
  46. data/spec/unit/ridley/resources/data_bag_resource_spec.rb +6 -3
  47. data/spec/unit/ridley/resources/environment_resource_spec.rb +4 -4
  48. data/spec/unit/ridley/resources/role_resource_spec.rb +1 -1
  49. data/spec/unit/ridley/resources/sandbox_resource_spec.rb +7 -7
  50. data/spec/unit/ridley/resources/search_resource_spec.rb +22 -22
  51. data/spec/unit/ridley/sandbox_uploader_spec.rb +3 -3
  52. data/spec/unit/ridley_spec.rb +6 -6
  53. metadata +15 -18
  54. data/lib/ridley/middleware/gzip.rb +0 -18
  55. data/spec/unit/ridley/middleware/gzip_spec.rb +0 -59
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ridley
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.0
4
+ version: 4.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamie Winsor
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-06-01 00:00:00.000000000 Z
12
+ date: 2015-10-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: addressable
@@ -160,7 +160,7 @@ dependencies:
160
160
  version: 2.0.2
161
161
  - - "<"
162
162
  - !ruby/object:Gem::Version
163
- version: 3.0.0
163
+ version: 4.0.0
164
164
  type: :runtime
165
165
  prerelease: false
166
166
  version_requirements: !ruby/object:Gem::Requirement
@@ -170,49 +170,49 @@ dependencies:
170
170
  version: 2.0.2
171
171
  - - "<"
172
172
  - !ruby/object:Gem::Version
173
- version: 3.0.0
173
+ version: 4.0.0
174
174
  - !ruby/object:Gem::Dependency
175
- name: json
175
+ name: httpclient
176
176
  requirement: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - ">="
178
+ - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: 1.7.7
180
+ version: '2.6'
181
181
  type: :runtime
182
182
  prerelease: false
183
183
  version_requirements: !ruby/object:Gem::Requirement
184
184
  requirements:
185
- - - ">="
185
+ - - "~>"
186
186
  - !ruby/object:Gem::Version
187
- version: 1.7.7
187
+ version: '2.6'
188
188
  - !ruby/object:Gem::Dependency
189
- name: mixlib-authentication
189
+ name: json
190
190
  requirement: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - ">="
193
193
  - !ruby/object:Gem::Version
194
- version: 1.3.0
194
+ version: 1.7.7
195
195
  type: :runtime
196
196
  prerelease: false
197
197
  version_requirements: !ruby/object:Gem::Requirement
198
198
  requirements:
199
199
  - - ">="
200
200
  - !ruby/object:Gem::Version
201
- version: 1.3.0
201
+ version: 1.7.7
202
202
  - !ruby/object:Gem::Dependency
203
- name: net-http-persistent
203
+ name: mixlib-authentication
204
204
  requirement: !ruby/object:Gem::Requirement
205
205
  requirements:
206
206
  - - ">="
207
207
  - !ruby/object:Gem::Version
208
- version: '2.8'
208
+ version: 1.3.0
209
209
  type: :runtime
210
210
  prerelease: false
211
211
  version_requirements: !ruby/object:Gem::Requirement
212
212
  requirements:
213
213
  - - ">="
214
214
  - !ruby/object:Gem::Version
215
- version: '2.8'
215
+ version: 1.3.0
216
216
  - !ruby/object:Gem::Dependency
217
217
  name: retryable
218
218
  requirement: !ruby/object:Gem::Requirement
@@ -301,7 +301,6 @@ files:
301
301
  - lib/ridley/middleware/chef_auth.rb
302
302
  - lib/ridley/middleware/chef_response.rb
303
303
  - lib/ridley/middleware/follow_redirects.rb
304
- - lib/ridley/middleware/gzip.rb
305
304
  - lib/ridley/middleware/parse_json.rb
306
305
  - lib/ridley/mixin.rb
307
306
  - lib/ridley/mixin/checksum.rb
@@ -379,7 +378,6 @@ files:
379
378
  - spec/unit/ridley/logger_spec.rb
380
379
  - spec/unit/ridley/middleware/chef_auth_spec.rb
381
380
  - spec/unit/ridley/middleware/chef_response_spec.rb
382
- - spec/unit/ridley/middleware/gzip_spec.rb
383
381
  - spec/unit/ridley/middleware/parse_json_spec.rb
384
382
  - spec/unit/ridley/mixins/from_file_spec.rb
385
383
  - spec/unit/ridley/resource_spec.rb
@@ -477,7 +475,6 @@ test_files:
477
475
  - spec/unit/ridley/logger_spec.rb
478
476
  - spec/unit/ridley/middleware/chef_auth_spec.rb
479
477
  - spec/unit/ridley/middleware/chef_response_spec.rb
480
- - spec/unit/ridley/middleware/gzip_spec.rb
481
478
  - spec/unit/ridley/middleware/parse_json_spec.rb
482
479
  - spec/unit/ridley/mixins/from_file_spec.rb
483
480
  - spec/unit/ridley/resource_spec.rb
@@ -1,18 +0,0 @@
1
- require 'zlib'
2
-
3
- module Ridley
4
- module Middleware
5
- class Gzip < Faraday::Response::Middleware
6
- def on_complete(env)
7
- case env[:response_headers][CONTENT_ENCODING].to_s.downcase
8
- when 'gzip'
9
- env[:body] = Zlib::GzipReader.new(StringIO.new(env[:body]), encoding: 'ASCII-8BIT').read
10
- when 'deflate'
11
- env[:body] = Zlib::Inflate.inflate(env[:body])
12
- end
13
- end
14
- end
15
- end
16
- end
17
-
18
- Faraday::Response.register_middleware gzip: Ridley::Middleware::Gzip
@@ -1,59 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Ridley::Middleware::Gzip do
4
- let(:env) do
5
- Hashie::Mash.new(
6
- 'response_headers' => {
7
- 'content-encoding' => nil
8
- },
9
- 'body' => nil
10
- )
11
- end
12
-
13
- subject { described_class.new }
14
-
15
- describe "#on_complete" do
16
- let(:run) { subject.on_complete(env) }
17
-
18
- context "when content-encoding is set to 'gzip'" do
19
- let(:secret) { "this is a secret zipped message" }
20
-
21
- before do
22
- env['response_headers']['content-encoding'] = 'gzip'
23
- io = StringIO.new
24
- writer = Zlib::GzipWriter.new(io)
25
- writer.write(secret)
26
- writer.close
27
- env['body'] = io.string
28
- end
29
-
30
- it "unzips the commpressed body" do
31
- run
32
- expect(env['body']).to eq(secret)
33
- end
34
- end
35
-
36
- context "when content-encoding is set to 'deflate'" do
37
- let(:secret) { "this is a secret deflated message" }
38
-
39
- before do
40
- env['response_headers']['content-encoding'] = 'deflate'
41
- env['body'] = Zlib::Deflate.deflate(secret)
42
- end
43
-
44
- it "inflates the compressed body" do
45
- run
46
- expect(env['body']).to eq(secret)
47
- end
48
- end
49
-
50
- context "when content-encoding is set to nothing" do
51
- before { env['body'] = 'not changed' }
52
-
53
- it "does not manipulate the body of the request" do
54
- run
55
- expect(env['body']).to eq('not changed')
56
- end
57
- end
58
- end
59
- end