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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 25d9399ddb2d453dfd16181b8207792c1de527a6
4
- data.tar.gz: e675ed6285907dfa641237e6d0e86df12c59ce29
3
+ metadata.gz: 932214114f8eca2aa1070795e17fd2c1e2cdf129
4
+ data.tar.gz: 752db701091fb743681348f1b9a34e1f4bcf1e2f
5
5
  SHA512:
6
- metadata.gz: de118716de30e72b4fce3b85c7267883b6daaa3a747a076d9049e64e49ca964edf105347652ecbe0830f96bd915447023cadc67799cc9b1be132215d9a24b37e
7
- data.tar.gz: 54cef9aad93186f4e121331fedff26e2bb6226e25770a372343db86074ae05cf6d5ffda127d71ab637292b096466eaf60dde6827f60ac1842fc56ceb65fa6eef
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
@@ -604,7 +604,7 @@ module Arel
604
604
  # end
605
605
 
606
606
  def visit_Arel_Nodes_Equality o, collector
607
- key = visit(o.left, collector).split('.')
607
+ key = visit(o.left, collector).to_s.split('.')
608
608
  value = (o.right.nil? ? nil : visit(o.right, collector))
609
609
 
610
610
  hash = {
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
@@ -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['X-42Floors-API-Version-Deprecated']
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("#{site}#{request.path}", value)
129
+ Thread.current[:sunstone_cookie_store].set_cookie(request_uri, value)
125
130
  end
126
131
  end
127
132
 
data/sunstone.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "sunstone"
3
- s.version = '1.2.0'
3
+ s.version = '1.2.1'
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.2.0
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-15 00:00:00.000000000 Z
11
+ date: 2014-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake