siebel_donations 1.0.9 → 1.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/siebel_donations.rb +5 -1
- data/lib/siebel_donations/base.rb +7 -3
- data/lib/siebel_donations/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 59a88ba80dceb847b2466018aba9858e2cf154dbe124b82a5338c2cf32ed72a3
|
4
|
+
data.tar.gz: e23d3623c6fd624ace533b48c575ae20db049f8e8baeef24d54b2f4a8670e9e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2444ae6e420029f3b8984576bcc8732359cd64f39d7c26e50e128825291b6300b3e6d3869739aacc085793701ecfd6beabbcbb32f902212df1ef00f3d3abdc14
|
7
|
+
data.tar.gz: 1fa54689325b8eaf5c0ab62ea857b0d317bacd83033a798f7c8c8fd188796dcf869f14a950ac7a63bd10645e9622d19a0a591701875c84e837bd959812a5a4a7
|
data/lib/siebel_donations.rb
CHANGED
@@ -7,7 +7,7 @@ end
|
|
7
7
|
|
8
8
|
module SiebelDonations
|
9
9
|
class << self
|
10
|
-
attr_accessor :base_url, :oauth_token, :default_timeout
|
10
|
+
attr_accessor :base_url, :oauth_token, :default_timeout, :default_retry_count
|
11
11
|
|
12
12
|
def configure
|
13
13
|
yield self
|
@@ -20,6 +20,10 @@ module SiebelDonations
|
|
20
20
|
def default_timeout
|
21
21
|
@default_timeout || 6000
|
22
22
|
end
|
23
|
+
|
24
|
+
def default_retry_count
|
25
|
+
@default_retry_count || 20
|
26
|
+
end
|
23
27
|
end
|
24
28
|
end
|
25
29
|
|
@@ -15,12 +15,16 @@ module SiebelDonations
|
|
15
15
|
raise 'You need to configure SiebelDonations with your oauth_token.' unless SiebelDonations.oauth_token
|
16
16
|
|
17
17
|
params[:response_timeout] ||= SiebelDonations.default_timeout
|
18
|
+
retry_count = params.delete(:retry_count) || SiebelDonations.default_retry_count
|
18
19
|
|
19
20
|
url = SiebelDonations.base_url + path
|
20
21
|
headers = { params: params, authorization: "Bearer #{SiebelDonations.oauth_token}" }
|
21
22
|
|
22
|
-
|
23
|
-
|
23
|
+
retryable_errors = [RestClient::InternalServerError, Timeout::Error, Errno::ECONNRESET]
|
24
|
+
|
25
|
+
Retryable.retryable on: retryable_errors, times: retry_count, sleep: 20 do
|
26
|
+
request_params = { method: :get, url: url, headers: headers, timeout: SiebelDonations.default_timeout }
|
27
|
+
RestClient::Request.execute(request_params) do |response, request, result, &block|
|
24
28
|
case response.code
|
25
29
|
when 200
|
26
30
|
Oj.load(response.unpack("C*").pack("U*").force_encoding("UTF-8").encode!)
|
@@ -33,7 +37,7 @@ module SiebelDonations
|
|
33
37
|
puts request.inspect
|
34
38
|
raise result.inspect
|
35
39
|
end
|
36
|
-
|
40
|
+
end
|
37
41
|
end
|
38
42
|
end
|
39
43
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: siebel_donations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Starcher
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -113,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
113
113
|
version: '0'
|
114
114
|
requirements: []
|
115
115
|
rubyforge_project:
|
116
|
-
rubygems_version: 2.
|
116
|
+
rubygems_version: 2.7.8
|
117
117
|
signing_key:
|
118
118
|
specification_version: 4
|
119
119
|
summary: Get donation information from Siebel Donor
|