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 +4 -4
- data/lib/sunstone/connection.rb +22 -14
- data/sunstone.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8f5ba12cef68d528bec916b6184ec53d65928d2
|
4
|
+
data.tar.gz: 9dbcb23a310b674bb0e1630de51df58e6758eec2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48677b2b7a83a34da56cf8fef3f5a756ea010ba914de48925fe6eb477bc9e6b6dc29e82e29f49befe770c03fd2ed32741a808d6454ebe55db30136d5771468ed
|
7
|
+
data.tar.gz: 4905994af30e60840b48d1932d9c656c6ce56e8ccdc69a61c873e0b1595a0bc69ae320e8acda16d9f2e73d222d50729f5e6561bb2e23b12f15108e11b13a10fe
|
data/lib/sunstone/connection.rb
CHANGED
@@ -115,25 +115,31 @@ module Sunstone
|
|
115
115
|
end
|
116
116
|
|
117
117
|
return_value = nil
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
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
|
-
|
125
|
+
validate_response_code(response)
|
124
126
|
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
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
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
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
|
data/sunstone.gemspec
CHANGED
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.
|
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-
|
11
|
+
date: 2015-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|