ridley 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,9 +8,8 @@ module Ridley
8
8
  include Celluloid
9
9
 
10
10
  VALID_OPTIONS = [
11
- :params,
12
- :headers,
13
- :request,
11
+ :retries,
12
+ :retry_interval,
14
13
  :ssl,
15
14
  :proxy
16
15
  ]
@@ -29,16 +28,10 @@ module Ridley
29
28
  # @param [String] client_name
30
29
  # @param [String] client_key
31
30
  #
32
- # @option options [Hash] :params
33
- # URI query unencoded key/value pairs
34
- # @option options [Hash] :headers
35
- # unencoded HTTP header key/value pairs
36
31
  # @option options [Integer] :retries (5)
37
32
  # retry requests on 5XX failures
38
33
  # @option options [Float] :retry_interval (0.5)
39
34
  # how often we should pause between retries
40
- # @option options [Hash] :request
41
- # request options
42
35
  # @option options [Hash] :ssl
43
36
  # * :verify (Boolean) [true] set to false to disable SSL verification
44
37
  # @option options [URI, String, Hash] :proxy
@@ -50,23 +43,21 @@ module Ridley
50
43
  @retries = options[:retries]
51
44
  @retry_interval = options[:retry_interval]
52
45
 
53
- options = options.reverse_merge(
54
- builder: Faraday::Builder.new { |b|
55
- b.response :json
56
- b.request :retry,
57
- max: @retries,
58
- interval: @retry_interval,
59
- exceptions: [
60
- Ridley::Errors::HTTP5XXError,
61
- Errno::ETIMEDOUT,
62
- Faraday::Error::TimeoutError
63
- ]
64
- b.response :chef_response
65
- b.request :chef_auth, client_name, client_key
66
-
67
- b.adapter :net_http_persistent
68
- }
69
- )
46
+ options[:builder] = Faraday::Builder.new do |b|
47
+ b.response :json
48
+ b.request :retry,
49
+ max: @retries,
50
+ interval: @retry_interval,
51
+ exceptions: [
52
+ Ridley::Errors::HTTP5XXError,
53
+ Errno::ETIMEDOUT,
54
+ Faraday::Error::TimeoutError
55
+ ]
56
+ b.response :chef_response
57
+ b.request :chef_auth, client_name, client_key
58
+
59
+ b.adapter :net_http_persistent
60
+ end
70
61
 
71
62
  uri_hash = Addressable::URI.parse(server_url).to_hash.slice(:scheme, :host, :port)
72
63
 
@@ -28,7 +28,8 @@ module Ridley
28
28
  #
29
29
  # @return [Hash]
30
30
  def parse(body)
31
- HashWithIndifferentAccess.new MultiJson.decode(body)
31
+ result = MultiJson.decode(body)
32
+ result.is_a?(Hash) ? Hashie::Mash.new(result) : result
32
33
  end
33
34
 
34
35
  # Extracts the type of the response from the response headers
@@ -1,3 +1,3 @@
1
1
  module Ridley
2
- VERSION = "0.8.0"
2
+ VERSION = "0.8.1"
3
3
  end
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: 0.8.0
4
+ version: 0.8.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-28 00:00:00.000000000 Z
12
+ date: 2013-03-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -400,7 +400,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
400
400
  version: '0'
401
401
  segments:
402
402
  - 0
403
- hash: -1703790355388058426
403
+ hash: -2528594805736736498
404
404
  requirements: []
405
405
  rubyforge_project:
406
406
  rubygems_version: 1.8.24