sunstone 1.7.8 → 1.7.9

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
  SHA1:
3
- metadata.gz: e267fa4516116d563ab8668f7a61a75c1fb3f528
4
- data.tar.gz: e55f2401867dd93ca60625155eeb0e33dd09da3e
3
+ metadata.gz: b8f5ba12cef68d528bec916b6184ec53d65928d2
4
+ data.tar.gz: 9dbcb23a310b674bb0e1630de51df58e6758eec2
5
5
  SHA512:
6
- metadata.gz: 3b5d0b5fedf8fbdcaa98fed931a95d0a926e18780e492c02b42c3bc57606664cde1cee0e35748d0d87eb5f78fae840a9f0e97f573076f583b37413cf7c38484f
7
- data.tar.gz: e012ed572ac6b97f8982c9b04fd3adf86b68f8a62211fa7b5b1319a540f363a02c27bf6f2d16b01b885dbcb330549ef44e1ce92d1046a54b95e188960f3011b2
6
+ metadata.gz: 48677b2b7a83a34da56cf8fef3f5a756ea010ba914de48925fe6eb477bc9e6b6dc29e82e29f49befe770c03fd2ed32741a808d6454ebe55db30136d5771468ed
7
+ data.tar.gz: 4905994af30e60840b48d1932d9c656c6ce56e8ccdc69a61c873e0b1595a0bc69ae320e8acda16d9f2e73d222d50729f5e6561bb2e23b12f15108e11b13a10fe
@@ -115,25 +115,31 @@ module Sunstone
115
115
  end
116
116
 
117
117
  return_value = nil
118
- @connection.request(request) do |response|
119
- if response['API-Version-Deprecated']
120
- logger.warn("DEPRECATION WARNING: API v#{API_VERSION} is being phased out")
121
- end
118
+ retry_count = 0
119
+ begin
120
+ @connection.request(request) do |response|
121
+ if response['API-Version-Deprecated']
122
+ logger.warn("DEPRECATION WARNING: API v#{API_VERSION} is being phased out")
123
+ end
122
124
 
123
- validate_response_code(response)
125
+ validate_response_code(response)
124
126
 
125
- # Get the cookies
126
- response.each_header do |key, value|
127
- if key.downcase == 'set-cookie' && Thread.current[:sunstone_cookie_store]
128
- Thread.current[:sunstone_cookie_store].set_cookie(request_uri, value)
127
+ # Get the cookies
128
+ response.each_header do |key, value|
129
+ if key.downcase == 'set-cookie' && Thread.current[:sunstone_cookie_store]
130
+ Thread.current[:sunstone_cookie_store].set_cookie(request_uri, value)
131
+ end
129
132
  end
130
- end
131
133
 
132
- if block_given?
133
- return_value =yield(response)
134
- else
135
- return_value =response
134
+ if block_given?
135
+ return_value =yield(response)
136
+ else
137
+ return_value =response
138
+ end
136
139
  end
140
+ rescue ActiveRecord::ConnectionNotEstablished
141
+ retry_count += 1
142
+ retry if retry_count == 1
137
143
  end
138
144
 
139
145
  return_value
@@ -328,6 +334,8 @@ module Sunstone
328
334
  raise Sunstone::Exception::ServiceUnavailable, response
329
335
  when 301
330
336
  raise Sunstone::Exception::MovedPermanently, response
337
+ when 502
338
+ raise ActiveRecord::ConnectionNotEstablished, response
331
339
  when 300..599
332
340
  raise Sunstone::Exception, response
333
341
  else
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "sunstone"
3
- s.version = '1.7.8'
3
+ s.version = '1.7.9'
4
4
  s.authors = ["Jon Bracy"]
5
5
  s.email = ["jonbracy@gmail.com"]
6
6
  s.homepage = "http://sunstonerb.com"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sunstone
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.8
4
+ version: 1.7.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Bracy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-13 00:00:00.000000000 Z
11
+ date: 2015-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake