siebel_donations 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 524589fa323c1663cda8ed7a3563539e394fe095
4
+ data.tar.gz: f7ebe22616ff08bcd8ada63be795987b986ab7ad
5
+ SHA512:
6
+ metadata.gz: 4657dc08ca58abb193de51383d06b0167b934c557d70c3acce7ff33dd2ee30fcb02fc6164a45fb5672685b4f68be6205565ca8b0baf5db0e787b7e2f26938fe0
7
+ data.tar.gz: de28ff73b9c2f7b94afbf2e1ab6b4f6ef09a31d6a2ea495ed75f2bbd6f092d99e4ea4ef8e331f125d218cec3a8333a3d32bc3dabfa8c74abed7ef5e568931c25
@@ -1,9 +1,19 @@
1
1
  module SiebelDonations
2
2
  class Address < Base
3
3
 
4
- attr_reader :type, :primary, :seasonal, :address1, :address2, :address3, :address4, :city,
5
- :state, :zip
4
+ attr_reader :id, :primary, :seasonal, :address1, :address2, :address3, :address4, :city,
5
+ :state, :zip, :updated_at
6
6
 
7
+
8
+ def type
9
+ case @type.to_s.downcase
10
+ when '', 'mailing address', 'ship to', 'ma', 'mailng', 'm', 'billing', 'mailin', 'mailig',
11
+ 'mailing', 'maling', 'mailign', 'mailingf', 'naukubg', 'maiiling', 'shipping'
12
+ 'Mailing'
13
+ else
14
+ @type
15
+ end
16
+ end
7
17
  end
8
18
  end
9
19
 
@@ -1,5 +1,6 @@
1
1
  require 'rest-client'
2
2
  require 'oj'
3
+ require 'retryable'
3
4
 
4
5
  module SiebelDonations
5
6
  class Base
@@ -16,18 +17,22 @@ module SiebelDonations
16
17
  params[:response_timeout] ||= SiebelDonations.default_timeout
17
18
 
18
19
  url = SiebelDonations.base_url + path
19
- RestClient::Request.execute(:method => :get, :url => url, :headers => {params: params, authorization: "Bearer #{SiebelDonations.oauth_token}"}, :timeout => -1) { |response, request, result, &block|
20
- case response.code
21
- when 200
22
- Oj.load(response)
23
- when 400
24
- raise RestClient::ExceptionWithResponse, response.to_s
25
- else
26
- puts response.inspect
27
- puts request.inspect
28
- raise result.inspect
29
- end
30
- }
20
+ Retryable.retryable :on => [RestClient::InternalServerError, Timeout::Error, Errno::ECONNRESET], :times => 20, :sleep => 20 do
21
+ RestClient::Request.execute(:method => :get, :url => url, :headers => {params: params, authorization: "Bearer #{SiebelDonations.oauth_token}"}, :timeout => -1) { |response, request, result, &block|
22
+ case response.code
23
+ when 200
24
+ Oj.load(response.unpack("C*").pack("U*").force_encoding("UTF-8").encode!)
25
+ when 400
26
+ raise RestClient::BadRequest, response.to_s
27
+ when 500
28
+ raise RestClient::InternalServerError, response.to_s
29
+ else
30
+ puts response.inspect
31
+ puts request.inspect
32
+ raise result.inspect
33
+ end
34
+ }
35
+ end
31
36
  end
32
37
 
33
38
  def self.find(params)
@@ -2,7 +2,7 @@ module SiebelDonations
2
2
  class Contact < Base
3
3
 
4
4
  attr_reader :id, :primary, :first_name, :preferred_name, :middle_name, :last_name,
5
- :title, :sufix, :sex, :phone_numbers, :email_addresses
5
+ :title, :suffix, :sex, :phone_numbers, :email_addresses, :updated_at
6
6
 
7
7
  def initialize(json = {})
8
8
  super
@@ -3,7 +3,7 @@ module SiebelDonations
3
3
 
4
4
  def self.path() '/donors'; end
5
5
 
6
- attr_reader :id, :account_name, :contacts, :addresses, :type
6
+ attr_reader :id, :account_name, :contacts, :addresses, :type, :updated_at
7
7
 
8
8
  def initialize(json = {})
9
9
  super
@@ -1,7 +1,7 @@
1
1
  module SiebelDonations
2
2
  class EmailAddress < Base
3
3
 
4
- attr_reader :type, :primary, :email
4
+ attr_reader :id, :type, :primary, :email, :updated_at
5
5
 
6
6
  end
7
7
  end
@@ -1,7 +1,7 @@
1
1
  module SiebelDonations
2
2
  class PhoneNumber < Base
3
3
 
4
- attr_reader :type, :primary, :phone
4
+ attr_reader :id, :type, :primary, :phone, :updated_at
5
5
 
6
6
  end
7
7
  end
@@ -1,3 +1,3 @@
1
1
  module SiebelDonations
2
- VERSION = "1.0.3"
2
+ VERSION = "1.0.4"
3
3
  end
@@ -18,7 +18,8 @@ Gem::Specification.new do |gem|
18
18
  gem.require_paths = ["lib"]
19
19
 
20
20
  gem.add_dependency('rest-client', '~> 1.6.7')
21
- gem.add_dependency('oj', '~> 1.4.5')
21
+ gem.add_dependency('oj', '~> 2.1.0')
22
22
  gem.add_dependency('activesupport')
23
+ gem.add_dependency('retryable-rb', '~> 1.1.0')
23
24
 
24
25
  end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: siebel_donations
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
5
- prerelease:
4
+ version: 1.0.4
6
5
  platform: ruby
7
6
  authors:
8
7
  - Josh Starcher
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-12-20 00:00:00.000000000 Z
11
+ date: 2013-09-23 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rest-client
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,35 +27,45 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: oj
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ~>
36
32
  - !ruby/object:Gem::Version
37
- version: 1.4.5
33
+ version: 2.1.0
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ~>
44
39
  - !ruby/object:Gem::Version
45
- version: 1.4.5
40
+ version: 2.1.0
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: activesupport
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: retryable-rb
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 1.1.0
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: 1.1.0
62
69
  description: This gem wraps an API to get donation, donor and account information
63
70
  out of Siebel Donor.
64
71
  email:
@@ -89,33 +96,26 @@ files:
89
96
  - spec/spec_helper.rb
90
97
  homepage: ''
91
98
  licenses: []
99
+ metadata: {}
92
100
  post_install_message:
93
101
  rdoc_options: []
94
102
  require_paths:
95
103
  - lib
96
104
  required_ruby_version: !ruby/object:Gem::Requirement
97
- none: false
98
105
  requirements:
99
- - - ! '>='
106
+ - - '>='
100
107
  - !ruby/object:Gem::Version
101
108
  version: '0'
102
- segments:
103
- - 0
104
- hash: -4344250501764273467
105
109
  required_rubygems_version: !ruby/object:Gem::Requirement
106
- none: false
107
110
  requirements:
108
- - - ! '>='
111
+ - - '>='
109
112
  - !ruby/object:Gem::Version
110
113
  version: '0'
111
- segments:
112
- - 0
113
- hash: -4344250501764273467
114
114
  requirements: []
115
115
  rubyforge_project:
116
- rubygems_version: 1.8.24
116
+ rubygems_version: 2.0.6
117
117
  signing_key:
118
- specification_version: 3
118
+ specification_version: 4
119
119
  summary: Get donation information from Siebel Donor
120
120
  test_files:
121
121
  - spec/donation_spec.rb