siebel_donations 1.0.11 → 1.0.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9bca87e7e7adb117c59e7b15517b75b5c2fcf0c83143ea89dc800e3d6bbe602f
4
- data.tar.gz: 3edc34cd4c90728e9e650d30e8b5ac13a48ccd498b0362c95e705c248a9d18d0
3
+ metadata.gz: 2524352a26b0a76d1a52e45580267a3ac9fc58ff9951e4cb942dce81a7d8237b
4
+ data.tar.gz: 3886685b60392bb80ad7909da1c256e362840e031826e2413d2c0eaac3010347
5
5
  SHA512:
6
- metadata.gz: 48c44ad82bbd9738a017692e9416fb46174da48eb395a7da169398453311a64481de81fe2063983f3f03fd7e242bb537bcd957fdb79f3f42b3fc3e8380116b38
7
- data.tar.gz: 26c77c7fe6924e23453cbe9b087f25dc12b95ea97a4637e1e80e0f8ab5524e1753c6c6d19789fe1fb648d12c1b5621376cd9e8bce0c2fea8c5c3c08a9cbf8518
6
+ metadata.gz: 7921b075c3bbccd78d9822597632975d2afa2f6e3da38e1fff7db500b4829a971104484b2a03e7afb2687438827b561ece8ad629c8921766b83d77406bc08efd
7
+ data.tar.gz: 161d4246544427d1daa88d9b910dadfc97722793b271fe636bf393c7c9c9f17d7ed09dff826fb87fe1e4917d2beab5a497ba62d02c65d231396d25ea543916ed
@@ -2,7 +2,7 @@ module SiebelDonations
2
2
  class Address < Base
3
3
 
4
4
  attr_reader :id, :primary, :seasonal, :address1, :address2, :address3, :address4, :city,
5
- :state, :zip, :updated_at
5
+ :state, :zip, :country, :updated_at
6
6
 
7
7
 
8
8
  def type
@@ -14,7 +14,8 @@ module SiebelDonations
14
14
  def self.get(path, params)
15
15
  raise 'You need to configure SiebelDonations with your oauth_token.' unless SiebelDonations.oauth_token
16
16
 
17
- params[:response_timeout] ||= SiebelDonations.default_timeout
17
+ request_timeout = params[:timeout] || SiebelDonations.default_timeout
18
+ params[:response_timeout] ||= request_timeout
18
19
  retry_count = params.delete(:retry_count) || SiebelDonations.default_retry_count
19
20
 
20
21
  url = SiebelDonations.base_url + path
@@ -23,7 +24,7 @@ module SiebelDonations
23
24
  retryable_errors = [RestClient::InternalServerError, Timeout::Error, Errno::ECONNRESET]
24
25
 
25
26
  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
+ request_params = { method: :get, url: url, headers: headers, timeout: request_timeout }
27
28
  RestClient::Request.execute(request_params) do |response, request, result, &block|
28
29
  case response.code
29
30
  when 200
@@ -1,3 +1,3 @@
1
1
  module SiebelDonations
2
- VERSION = "1.0.11"
2
+ VERSION = "1.0.14"
3
3
  end
@@ -22,7 +22,7 @@ module SiebelDonations
22
22
  end
23
23
 
24
24
  def default_retry_count
25
- @default_retry_count || 20
25
+ @default_retry_count || 2
26
26
  end
27
27
  end
28
28
  end
data/spec/base_spec.rb ADDED
@@ -0,0 +1,25 @@
1
+ require 'spec_helper'
2
+
3
+ describe SiebelDonations::Base do
4
+ context '.get' do
5
+ context 'with timeout param set' do
6
+ it 'passes param to RestClient' do
7
+ expect(RestClient::Request).to receive(:execute)
8
+ .with(hash_including(url: SiebelDonations.base_url, timeout: 123))
9
+ .and_return(nil)
10
+
11
+ described_class.get('', timeout: 123)
12
+ end
13
+ end
14
+
15
+ context 'without timeout param set' do
16
+ it 'passes default to RestClient' do
17
+ expect(RestClient::Request).to receive(:execute)
18
+ .with(hash_including(timeout: 6000))
19
+ .and_return(nil)
20
+
21
+ described_class.get('', {})
22
+ end
23
+ end
24
+ end
25
+ 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.11
4
+ version: 1.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Starcher
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-24 00:00:00.000000000 Z
11
+ date: 2022-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -92,12 +92,13 @@ files:
92
92
  - lib/siebel_donations/profile.rb
93
93
  - lib/siebel_donations/version.rb
94
94
  - siebel_donations.gemspec
95
+ - spec/base_spec.rb
95
96
  - spec/donation_spec.rb
96
97
  - spec/spec_helper.rb
97
98
  homepage: ''
98
99
  licenses: []
99
100
  metadata: {}
100
- post_install_message:
101
+ post_install_message:
101
102
  rdoc_options: []
102
103
  require_paths:
103
104
  - lib
@@ -112,11 +113,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
113
  - !ruby/object:Gem::Version
113
114
  version: '0'
114
115
  requirements: []
115
- rubyforge_project:
116
- rubygems_version: 2.7.8
117
- signing_key:
116
+ rubygems_version: 3.3.0
117
+ signing_key:
118
118
  specification_version: 4
119
119
  summary: Get donation information from Siebel Donor
120
120
  test_files:
121
+ - spec/base_spec.rb
121
122
  - spec/donation_spec.rb
122
123
  - spec/spec_helper.rb