sunstone 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/active_record/connection_adapters/sunstone_adapter.rb +2 -2
- data/lib/arel/visitors/sunstone.rb +1 -1
- data/lib/sunstone.rb +0 -8
- data/lib/sunstone/connection.rb +8 -3
- 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: 932214114f8eca2aa1070795e17fd2c1e2cdf129
|
4
|
+
data.tar.gz: 752db701091fb743681348f1b9a34e1f4bcf1e2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4551d1399d76ce59806fcc33ed50267142247e22d321b814fe2216b8e8398809769305af7f1689ee0f2b93cd01caa403a74d7765662d9277ba77c35b10d8ba4c
|
7
|
+
data.tar.gz: a93c30a197f5e0d8d8538bf80576bd84fd4422ca4a694adb3c1d6d135b33d7cf4173f4c56a333d93c0ef91bc7dc462a6ce2608e5ad8b42dd238de85484ae8a91
|
@@ -104,12 +104,12 @@ module ActiveRecord
|
|
104
104
|
def reconnect!
|
105
105
|
super
|
106
106
|
@connection.reset
|
107
|
-
configure_connection
|
107
|
+
# configure_connection
|
108
108
|
end
|
109
109
|
|
110
110
|
# TODO don't know about this yet
|
111
111
|
def reset!
|
112
|
-
configure_connection
|
112
|
+
# configure_connection
|
113
113
|
end
|
114
114
|
|
115
115
|
# TODO: deal with connection.close
|
data/lib/sunstone.rb
CHANGED
@@ -25,14 +25,6 @@ module Sunstone
|
|
25
25
|
VERSION = 0.1
|
26
26
|
|
27
27
|
# TODO:
|
28
|
-
# # Set a cookie jar to use during request sent during the
|
29
|
-
# def with_cookie_store(store, &block)
|
30
|
-
# Thread.current[:sunstone_cookie_store] = store
|
31
|
-
# yield
|
32
|
-
# ensure
|
33
|
-
# Thread.current[:sunstone_cookie_store] = nil
|
34
|
-
# end
|
35
|
-
#
|
36
28
|
#
|
37
29
|
# # Get a connection from the connection pool and perform the block with
|
38
30
|
# # the connection
|
data/lib/sunstone/connection.rb
CHANGED
@@ -98,8 +98,13 @@ module Sunstone
|
|
98
98
|
# end
|
99
99
|
# end
|
100
100
|
def send_request(request, body=nil, &block)
|
101
|
+
request_uri = "http#{use_ssl ? 's' : ''}://#{host}#{port != 80 ? (port == 443 && use_ssl ? '' : ":#{port}") : ''}#{request.path}"
|
101
102
|
request_headers.each { |k, v| request[k] = v }
|
102
|
-
|
103
|
+
|
104
|
+
if Thread.current[:sunstone_cookie_store]
|
105
|
+
request['Cookie'] = Thread.current[:sunstone_cookie_store].cookie_header_for(request_uri)
|
106
|
+
end
|
107
|
+
|
103
108
|
if body.is_a?(IO)
|
104
109
|
request['Transfer-Encoding'] = 'chunked'
|
105
110
|
request.body_stream = body
|
@@ -112,7 +117,7 @@ module Sunstone
|
|
112
117
|
return_value = nil
|
113
118
|
@connection.request(request) do |response|
|
114
119
|
|
115
|
-
if response['
|
120
|
+
if response['API-Version-Deprecated']
|
116
121
|
logger.warn("DEPRECATION WARNING: API v#{API_VERSION} is being phased out")
|
117
122
|
end
|
118
123
|
|
@@ -121,7 +126,7 @@ module Sunstone
|
|
121
126
|
# Get the cookies
|
122
127
|
response.each_header do |key, value|
|
123
128
|
if key.downcase == 'set-cookie' && Thread.current[:sunstone_cookie_store]
|
124
|
-
Thread.current[:sunstone_cookie_store].set_cookie(
|
129
|
+
Thread.current[:sunstone_cookie_store].set_cookie(request_uri, value)
|
125
130
|
end
|
126
131
|
end
|
127
132
|
|
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.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Bracy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|