active_rest_client 1.0.2 → 1.0.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b673b275ac742495303d8632a70e7a2425df69bf
4
- data.tar.gz: 99edc9e4f9ec9faa7703449685c48b898196ee15
3
+ metadata.gz: 95a7b0745cf0433d0d39a71335488abf9d5c7db7
4
+ data.tar.gz: 186afb738e60e270b25dae6963e476cfb97b27f7
5
5
  SHA512:
6
- metadata.gz: ea15068289c7bedc5faee76611548e342e8ba395f4bb76fb81f99395d5f3fad10e0936a94df5eac5c45236adf137b9ade25c7553a7828c44ad4e83d2d23be3e9
7
- data.tar.gz: d201d14a7563791a12885ffb7967f58c938194cd979d06c779b42db11cb0792f336d6f7993ad1e21cd8985cfddc05ff8f4522d098b9b5d733f6ba8c62c41af25
6
+ metadata.gz: 7638217032e8783304954e8cd3aac40d2bd7df4a0a8ac2d824c24480a544b0a3d1e4255aad45ddeaed8d20d2f408c4abfb01c847d819f62971c8e83737927425
7
+ data.tar.gz: 458acc1e2864a505f281a194d87dfe70dff2b1415ba72adb5ca3e12246f8ad39b4e5e52f402bd5d2696c39e01a075d0cbe34d4c03470d76fa8873d056f467103
@@ -32,6 +32,6 @@ Gem::Specification.new do |spec|
32
32
 
33
33
  spec.add_runtime_dependency "multi_json"
34
34
  spec.add_runtime_dependency "activesupport"
35
- spec.add_runtime_dependency "faraday", "~> 0.9"
35
+ spec.add_runtime_dependency "faraday"
36
36
  spec.add_development_dependency "patron", ">= 0.4.9" # 0.4.18 breaks against Curl v0.7.15 but works with webmock
37
37
  end
@@ -103,8 +103,15 @@ module ActiveRestClient
103
103
  def default_faraday_config
104
104
  Proc.new do |faraday|
105
105
  faraday.adapter(adapter)
106
- faraday.options.timeout = 10
107
- faraday.options.open_timeout = 10
106
+
107
+ if faraday.options.respond_to?(:timeout=)
108
+ faraday.options.timeout = 10
109
+ faraday.options.open_timeout = 10
110
+ else
111
+ faraday.options['timeout'] = 10
112
+ faraday.options['open_timeout'] = 10
113
+ end
114
+
108
115
  faraday.headers['User-Agent'] = "ActiveRestClient/#{ActiveRestClient::VERSION}"
109
116
  faraday.headers['Connection'] = "Keep-Alive"
110
117
  faraday.headers['Accept'] = "application/json"
@@ -23,13 +23,13 @@ module ActiveRestClient
23
23
 
24
24
  def make_safe_request(path, &block)
25
25
  block.call
26
- rescue Faraday::TimeoutError
26
+ rescue Faraday::Error::TimeoutError
27
27
  raise ActiveRestClient::TimeoutException.new("Timed out getting #{full_url(path)}")
28
- rescue Faraday::ConnectionFailed
28
+ rescue Faraday::Error::ConnectionFailed
29
29
  begin
30
30
  reconnect
31
31
  block.call
32
- rescue Faraday::ConnectionFailed
32
+ rescue Faraday::Error::ConnectionFailed
33
33
  raise ActiveRestClient::ConnectionFailedException.new("Unable to connect to #{full_url(path)}")
34
34
  end
35
35
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveRestClient
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
@@ -99,7 +99,7 @@ describe ActiveRestClient::Connection do
99
99
  end
100
100
 
101
101
  it "should retry once in the event of a connection failed" do
102
- stub_request(:get, "www.example.com/foo").to_raise(Faraday::ConnectionFailed.new("Foo"))
102
+ stub_request(:get, "www.example.com/foo").to_raise(Faraday::Error::ConnectionFailed.new("Foo"))
103
103
  expect { @connection.get("/foo") }.to raise_error(ActiveRestClient::ConnectionFailedException)
104
104
  end
105
105
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_rest_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Which Ltd
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-07-24 00:00:00.000000000 Z
12
+ date: 2014-07-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -183,16 +183,16 @@ dependencies:
183
183
  name: faraday
184
184
  requirement: !ruby/object:Gem::Requirement
185
185
  requirements:
186
- - - "~>"
186
+ - - ">="
187
187
  - !ruby/object:Gem::Version
188
- version: '0.9'
188
+ version: '0'
189
189
  type: :runtime
190
190
  prerelease: false
191
191
  version_requirements: !ruby/object:Gem::Requirement
192
192
  requirements:
193
- - - "~>"
193
+ - - ">="
194
194
  - !ruby/object:Gem::Version
195
- version: '0.9'
195
+ version: '0'
196
196
  - !ruby/object:Gem::Dependency
197
197
  name: patron
198
198
  requirement: !ruby/object:Gem::Requirement