tddium_client 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/Gemfile.lock +2 -2
- data/lib/tddium_client.rb +10 -2
- data/lib/tddium_client/version.rb +2 -2
- data/spec/tddium_client_spec.rb +12 -1
- metadata +22 -22
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
OWY1M2VlODU2YmQ3N2FjM2VlMDk4YjI5YzZlYWI1MDc4ZDUxZTlmMw==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ZjIxMDM1NWZmMTY2ZGQ5ODMwZjlmYTFmMjU4ODM1NTc1MjE2NTYyMA==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MDc2ZWEwOTcyYzQyZTRmNWJjY2EwY2QyYjYzMDFjZWNhMDIyZThmMjAwYjgz
|
10
|
+
Njk5YWYzNGFjOTJhZjczNzAzZjEzYzUyOGVkMjU1NzQzMGI0YWRmNWI1ZTky
|
11
|
+
ODhjNGQ1NDliOWJlZjUwNjIwZTI0MWI4NzkwNTgwYmFlODY0Yzg=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ODU1ZjhlNDA1NDI5OGI0YTUyMWUxOWEzY2ZjMTAwNDM0YmJhMmYyNzg5ZTAw
|
14
|
+
MDY5YzEzNTYyNTcyYTE2MGVkYTcyNDQ1OGE2NDVhNjg0ZjYzYThmNTJmYTk2
|
15
|
+
ZTIwNjdkZjIyMjUxMzBlNWVjOWJkZGIzMmQ2YWQ0MTY5MTQ1OWI=
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
tddium_client (0.5.
|
4
|
+
tddium_client (0.5.1)
|
5
5
|
httpclient (>= 2.2.5)
|
6
6
|
json
|
7
7
|
|
@@ -13,7 +13,7 @@ GEM
|
|
13
13
|
diff-lcs (1.1.3)
|
14
14
|
fakefs (0.4.0)
|
15
15
|
httpclient (2.6.0.1)
|
16
|
-
json (1.8.
|
16
|
+
json (1.8.3)
|
17
17
|
multi_json (1.3.6)
|
18
18
|
rack (1.4.1)
|
19
19
|
rack-test (0.6.1)
|
data/lib/tddium_client.rb
CHANGED
@@ -13,6 +13,15 @@ module TddiumClient
|
|
13
13
|
CLIENT_VERSION_HEADER = "X-Tddium-Client-Version"
|
14
14
|
API_ERROR_TEXT = "An error occured: "
|
15
15
|
|
16
|
+
ERRORS = [ Errno::ECONNREFUSED,
|
17
|
+
Errno::ETIMEDOUT,
|
18
|
+
Timeout::Error,
|
19
|
+
OpenSSL::SSL::SSLError,
|
20
|
+
OpenSSL::SSL::Session::SessionError,
|
21
|
+
HTTPClient::TimeoutError,
|
22
|
+
HTTPClient::BadResponseError,
|
23
|
+
SocketError ]
|
24
|
+
|
16
25
|
module Error
|
17
26
|
class Base < RuntimeError; end
|
18
27
|
end
|
@@ -129,10 +138,9 @@ module TddiumClient
|
|
129
138
|
call_params = params.merge({:xid => xid})
|
130
139
|
|
131
140
|
tries = 0
|
132
|
-
|
133
141
|
begin
|
134
142
|
http = @client.send(method, tddium_uri(api_path), :body => call_params.to_json, :header => headers)
|
135
|
-
rescue
|
143
|
+
rescue *ERRORS
|
136
144
|
tries += 1
|
137
145
|
delay = (tries>>1)*0.05*rand()
|
138
146
|
Kernel.sleep(delay)
|
data/spec/tddium_client_spec.rb
CHANGED
@@ -204,7 +204,18 @@ describe "TddiumClient" do
|
|
204
204
|
it "should print the explanation" do
|
205
205
|
upgrade_required.message.should == "API Error: You need to upgrade"
|
206
206
|
end
|
207
|
-
end
|
207
|
+
end
|
208
|
+
|
209
|
+
it "should be in list of errors" do
|
210
|
+
TddiumClient::ERRORS.should be == [ Errno::ECONNREFUSED,
|
211
|
+
Errno::ETIMEDOUT,
|
212
|
+
Timeout::Error,
|
213
|
+
OpenSSL::SSL::SSLError,
|
214
|
+
OpenSSL::SSL::Session::SessionError,
|
215
|
+
HTTPClient::TimeoutError,
|
216
|
+
HTTPClient::BadResponseError,
|
217
|
+
SocketError ]
|
218
|
+
end
|
208
219
|
end
|
209
220
|
|
210
221
|
describe "InternalClient" do
|
metadata
CHANGED
@@ -1,125 +1,125 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tddium_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jay Moorthi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httpclient
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ! '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 2.2.5
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ! '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 2.2.5
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: json
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ! '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ! '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ! '>='
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ! '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: webmock
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ! '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: fakefs
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ! '>='
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ! '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rack-test
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ! '>='
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ! '>='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: simplecov
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ! '>='
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ! '>='
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: rake
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - ! '>='
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - ! '>='
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
description: Internal Gem used to call the Tddium API
|
@@ -129,8 +129,8 @@ executables: []
|
|
129
129
|
extensions: []
|
130
130
|
extra_rdoc_files: []
|
131
131
|
files:
|
132
|
-
-
|
133
|
-
-
|
132
|
+
- .gitignore
|
133
|
+
- .rspec
|
134
134
|
- Gemfile
|
135
135
|
- Gemfile.lock
|
136
136
|
- LICENSE.txt
|
@@ -157,12 +157,12 @@ require_paths:
|
|
157
157
|
- lib
|
158
158
|
required_ruby_version: !ruby/object:Gem::Requirement
|
159
159
|
requirements:
|
160
|
-
- -
|
160
|
+
- - ! '>='
|
161
161
|
- !ruby/object:Gem::Version
|
162
162
|
version: '0'
|
163
163
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
164
164
|
requirements:
|
165
|
-
- -
|
165
|
+
- - ! '>='
|
166
166
|
- !ruby/object:Gem::Version
|
167
167
|
version: '0'
|
168
168
|
requirements: []
|