siebel_donations 1.0.9 → 1.0.10

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
- SHA1:
3
- metadata.gz: 448d2193307b0e44260ce191cdb7c9a48f576b95
4
- data.tar.gz: fc1f97ff8091968a49b3c23bbd281f6e14d4b5bb
2
+ SHA256:
3
+ metadata.gz: 59a88ba80dceb847b2466018aba9858e2cf154dbe124b82a5338c2cf32ed72a3
4
+ data.tar.gz: e23d3623c6fd624ace533b48c575ae20db049f8e8baeef24d54b2f4a8670e9e6
5
5
  SHA512:
6
- metadata.gz: fe134448979e28be37da40ed84a20b0433439c139719e598fb9890818347b98125dc25f9be2ea8cc90673c8457694dcd0c7bf3a45468fe25fff49e93ef4f8941
7
- data.tar.gz: 3281bd6856c7a7b5616ae21c644c64780bfaba6d067bd8185d9d1e16583fbf0a300b1807d198cb1da76edc70e46f0024e76b4dd072cddbc1982c644b5210f488
6
+ metadata.gz: 2444ae6e420029f3b8984576bcc8732359cd64f39d7c26e50e128825291b6300b3e6d3869739aacc085793701ecfd6beabbcbb32f902212df1ef00f3d3abdc14
7
+ data.tar.gz: 1fa54689325b8eaf5c0ab62ea857b0d317bacd83033a798f7c8c8fd188796dcf869f14a950ac7a63bd10645e9622d19a0a591701875c84e837bd959812a5a4a7
@@ -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
- Retryable.retryable :on => [RestClient::InternalServerError, Timeout::Error, Errno::ECONNRESET], :times => 20, :sleep => 20 do
23
- RestClient::Request.execute(method: :get, url: url, headers: headers, timeout: SiebelDonations.default_timeout) { |response, request, result, &block|
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
 
@@ -1,3 +1,3 @@
1
1
  module SiebelDonations
2
- VERSION = "1.0.9"
2
+ VERSION = "1.0.10"
3
3
  end
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.9
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-05-23 00:00:00.000000000 Z
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.6.8
116
+ rubygems_version: 2.7.8
117
117
  signing_key:
118
118
  specification_version: 4
119
119
  summary: Get donation information from Siebel Donor