tddium_client 0.1.3 → 0.1.4
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.
- data/README +1 -0
- data/lib/tddium_client.rb +1 -1
- data/lib/tddium_client/version.rb +1 -1
- data/spec/tddium_client_spec.rb +6 -0
- metadata +2 -2
data/README
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
The tddium_client gem encapsulates common API access code.
|
data/lib/tddium_client.rb
CHANGED
@@ -120,7 +120,7 @@ module TddiumClient
|
|
120
120
|
|
121
121
|
begin
|
122
122
|
http = HTTParty.send(method, tddium_uri(api_path), :body => params, :headers => headers)
|
123
|
-
rescue Errno::ETIMEDOUT, Timeout::Error, OpenSSL::SSL::SSLError, OpenSSL::SSL::Session::SessionError
|
123
|
+
rescue Errno::ECONNREFUSED, Errno::ETIMEDOUT, Timeout::Error, OpenSSL::SSL::SSLError, OpenSSL::SSL::Session::SessionError
|
124
124
|
tries += 1
|
125
125
|
retry if retries > 0 && tries <= retries
|
126
126
|
end
|
data/spec/tddium_client_spec.rb
CHANGED
@@ -295,6 +295,12 @@ describe "TddiumClient" do
|
|
295
295
|
end
|
296
296
|
|
297
297
|
context "raises a timeout error" do
|
298
|
+
it_behaves_like "retry on exception" do
|
299
|
+
let (:raised_exception) { Errno::ECONNREFUSED }
|
300
|
+
end
|
301
|
+
it_behaves_like "retry on exception" do
|
302
|
+
let (:raised_exception) { Errno::ETIMEDOUT }
|
303
|
+
end
|
298
304
|
it_behaves_like "retry on exception" do
|
299
305
|
let (:raised_exception) { Timeout::Error }
|
300
306
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: tddium_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.4
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Jay Moorthi
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date:
|
13
|
+
date: 2012-01-03 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: httparty
|