siebel_donations 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,7 +7,7 @@ end
7
7
 
8
8
  module SiebelDonations
9
9
  class << self
10
- attr_accessor :base_url, :oauth_token
10
+ attr_accessor :base_url, :oauth_token, :default_timeout
11
11
 
12
12
  def configure
13
13
  yield self
@@ -16,6 +16,10 @@ module SiebelDonations
16
16
  def base_url
17
17
  @base_url ||= "http://hart-a321.net.ccci.org:9980/wsapi/rest"
18
18
  end
19
+
20
+ def default_timeout
21
+ @default_timeout || 6000
22
+ end
19
23
  end
20
24
  end
21
25
 
@@ -12,8 +12,11 @@ module SiebelDonations
12
12
 
13
13
  def self.get(path, params)
14
14
  raise 'You need to configure SiebelDonations with your oauth_token.' unless SiebelDonations.oauth_token
15
+
16
+ params[:response_timeout] ||= SiebelDonations.default_timeout
17
+
15
18
  url = SiebelDonations.base_url + path
16
- RestClient.get(url, {params: params, timeout: -1, authorization: "Bearer #{SiebelDonations.oauth_token}"}) { |response, request, result, &block|
19
+ RestClient::Request.execute(:method => :get, :url => url, :headers => {params: params, authorization: "Bearer #{SiebelDonations.oauth_token}"}, :timeout => -1) { |response, request, result, &block|
17
20
  case response.code
18
21
  when 200
19
22
  Oj.load(response)
@@ -1,3 +1,3 @@
1
1
  module SiebelDonations
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: siebel_donations
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-04 00:00:00.000000000 Z
12
+ date: 2012-12-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
@@ -99,12 +99,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
99
99
  - - ! '>='
100
100
  - !ruby/object:Gem::Version
101
101
  version: '0'
102
+ segments:
103
+ - 0
104
+ hash: 2970667198763255648
102
105
  required_rubygems_version: !ruby/object:Gem::Requirement
103
106
  none: false
104
107
  requirements:
105
108
  - - ! '>='
106
109
  - !ruby/object:Gem::Version
107
110
  version: '0'
111
+ segments:
112
+ - 0
113
+ hash: 2970667198763255648
108
114
  requirements: []
109
115
  rubyforge_project:
110
116
  rubygems_version: 1.8.24
@@ -114,4 +120,3 @@ summary: Get donation information from Siebel Donor
114
120
  test_files:
115
121
  - spec/donation_spec.rb
116
122
  - spec/spec_helper.rb
117
- has_rdoc: