sunstone 2.0.4 → 5.0.0.beta3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,4 @@
1
+ require 'msgpack'
1
2
  require 'wankel'
2
3
  require 'cookie_store'
3
4
  require 'active_record'
@@ -10,18 +11,23 @@ require File.expand_path(File.join(__FILE__, '../arel/visitors/sunstone'))
10
11
  require File.expand_path(File.join(__FILE__, '../arel/collectors/sunstone'))
11
12
 
12
13
  require File.expand_path(File.join(__FILE__, '../active_record/connection_adapters/sunstone_adapter'))
14
+ require File.expand_path(File.join(__FILE__, '../active_record/connection_adapters/sunstone/type_metadata'))
13
15
 
14
16
  require File.expand_path(File.join(__FILE__, '../../ext/active_record/statement_cache'))
15
17
  require File.expand_path(File.join(__FILE__, '../../ext/active_record/relation'))
18
+ require File.expand_path(File.join(__FILE__, '../../ext/active_record/persistence'))
19
+ require File.expand_path(File.join(__FILE__, '../../ext/active_record/attribute_methods'))
16
20
  # require File.expand_path(File.join(__FILE__, '../../ext/active_record/relation/predicate_builder'))
17
21
  # require File.expand_path(File.join(__FILE__, '../../ext/active_record/calculations'))
18
22
  require File.expand_path(File.join(__FILE__, '../../ext/active_record/query_methods'))
23
+ require File.expand_path(File.join(__FILE__, '../../ext/active_record/associations/collection_association'))
19
24
  # require File.expand_path(File.join(__FILE__, '../../ext/active_record/associations/builder/has_and_belongs_to_many'))
20
25
 
21
26
  require File.expand_path(File.join(__FILE__, '../../ext/active_support/core_ext/object/to_query'))
22
27
 
23
28
  require File.expand_path(File.join(__FILE__, '../../ext/arel/select_manager'))
24
29
  require File.expand_path(File.join(__FILE__, '../../ext/arel/nodes/eager_load'))
30
+ require File.expand_path(File.join(__FILE__, '../../ext/arel/attributes/relation'))
25
31
  require File.expand_path(File.join(__FILE__, '../../ext/arel/nodes/select_statement'))
26
32
  require File.expand_path(File.join(__FILE__, '../../ext/active_record/finder_methods'))
27
33
  require File.expand_path(File.join(__FILE__, '../../ext/active_record/batches'))
@@ -117,7 +117,6 @@ module Sunstone
117
117
  elsif body.is_a?(String)
118
118
  request.body = body
119
119
  elsif body
120
-
121
120
  request.body = Wankel.encode(body)
122
121
  end
123
122
 
@@ -292,14 +291,14 @@ module Sunstone
292
291
  private
293
292
 
294
293
  def request_headers
295
- headers = {
296
- 'Accept' => 'application/json',
297
- 'User-Agent' => user_agent,
298
- 'Api-Version' => '0.1.0'
299
- }
294
+ headers = Thread.current[:sunstone_headers] || {}
295
+ headers['Accept'] = 'application/json'
296
+ headers['User-Agent'] = user_agent
297
+ headers['Api-Version'] = '0.1.0'
298
+
300
299
  request_api_key = Thread.current[:sunstone_api_key] || api_key
301
-
302
300
  headers['Api-Key'] = request_api_key if request_api_key
301
+
303
302
  headers
304
303
  end
305
304
 
@@ -328,7 +327,7 @@ module Sunstone
328
327
  if !(200..299).include?(code)
329
328
  case code
330
329
  when 400
331
- raise Sunstone::Exception::BadRequest, response
330
+ raise Sunstone::Exception::BadRequest, response.body
332
331
  when 401
333
332
  raise Sunstone::Exception::Unauthorized, response
334
333
  when 404
@@ -6,11 +6,6 @@ module Sunstone
6
6
  end
7
7
 
8
8
  class BadRequest < Sunstone::Exception
9
- attr_reader :response
10
- def initialize(response)
11
- super
12
- @response = response
13
- end
14
9
  end
15
10
 
16
11
  class Unauthorized < Sunstone::Exception
@@ -1,3 +1,3 @@
1
1
  module Sunstone
2
- VERSION = '2.0.4'
2
+ VERSION = '5.0.0.beta3'
3
3
  end
@@ -28,10 +28,11 @@ Gem::Specification.new do |s|
28
28
  s.add_development_dependency 'sdoc-templates-42floors'
29
29
 
30
30
  # Runtime
31
+ s.add_runtime_dependency 'msgpack'
31
32
  s.add_runtime_dependency 'wankel'
32
33
  s.add_runtime_dependency 'cookie_store'
33
- s.add_runtime_dependency 'arel', '~> 6.0'
34
- s.add_runtime_dependency 'activesupport', '>= 4.2.4'
35
- s.add_runtime_dependency 'activemodel', '>= 4.2.4'
36
- s.add_runtime_dependency 'activerecord', '>= 4.2.4'
34
+ s.add_runtime_dependency 'arel', '~> 7.0'
35
+ s.add_runtime_dependency 'activesupport', '>= 5.0.0.beta3'
36
+ s.add_runtime_dependency 'activemodel', '>= 5.0.0.beta3'
37
+ s.add_runtime_dependency 'activerecord', '>= 5.0.0.beta3'
37
38
  end
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: 2.0.4
4
+ version: 5.0.0.beta3
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-12-11 00:00:00.000000000 Z
11
+ date: 2016-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -164,6 +164,20 @@ dependencies:
164
164
  - - ">="
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: msgpack
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :runtime
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
167
181
  - !ruby/object:Gem::Dependency
168
182
  name: wankel
169
183
  requirement: !ruby/object:Gem::Requirement
@@ -198,56 +212,56 @@ dependencies:
198
212
  requirements:
199
213
  - - "~>"
200
214
  - !ruby/object:Gem::Version
201
- version: '6.0'
215
+ version: '7.0'
202
216
  type: :runtime
203
217
  prerelease: false
204
218
  version_requirements: !ruby/object:Gem::Requirement
205
219
  requirements:
206
220
  - - "~>"
207
221
  - !ruby/object:Gem::Version
208
- version: '6.0'
222
+ version: '7.0'
209
223
  - !ruby/object:Gem::Dependency
210
224
  name: activesupport
211
225
  requirement: !ruby/object:Gem::Requirement
212
226
  requirements:
213
227
  - - ">="
214
228
  - !ruby/object:Gem::Version
215
- version: 4.2.4
229
+ version: 5.0.0.beta3
216
230
  type: :runtime
217
231
  prerelease: false
218
232
  version_requirements: !ruby/object:Gem::Requirement
219
233
  requirements:
220
234
  - - ">="
221
235
  - !ruby/object:Gem::Version
222
- version: 4.2.4
236
+ version: 5.0.0.beta3
223
237
  - !ruby/object:Gem::Dependency
224
238
  name: activemodel
225
239
  requirement: !ruby/object:Gem::Requirement
226
240
  requirements:
227
241
  - - ">="
228
242
  - !ruby/object:Gem::Version
229
- version: 4.2.4
243
+ version: 5.0.0.beta3
230
244
  type: :runtime
231
245
  prerelease: false
232
246
  version_requirements: !ruby/object:Gem::Requirement
233
247
  requirements:
234
248
  - - ">="
235
249
  - !ruby/object:Gem::Version
236
- version: 4.2.4
250
+ version: 5.0.0.beta3
237
251
  - !ruby/object:Gem::Dependency
238
252
  name: activerecord
239
253
  requirement: !ruby/object:Gem::Requirement
240
254
  requirements:
241
255
  - - ">="
242
256
  - !ruby/object:Gem::Version
243
- version: 4.2.4
257
+ version: 5.0.0.beta3
244
258
  type: :runtime
245
259
  prerelease: false
246
260
  version_requirements: !ruby/object:Gem::Requirement
247
261
  requirements:
248
262
  - - ">="
249
263
  - !ruby/object:Gem::Version
250
- version: 4.2.4
264
+ version: 5.0.0.beta3
251
265
  description: A library for interacting with REST APIs. Similar to ActiveResource
252
266
  email:
253
267
  - jonbracy@gmail.com
@@ -262,14 +276,18 @@ files:
262
276
  - Rakefile.rb
263
277
  - TODO.md
264
278
  - ext/active_record/associations/builder/has_and_belongs_to_many.rb
279
+ - ext/active_record/associations/collection_association.rb
280
+ - ext/active_record/attribute_methods.rb
265
281
  - ext/active_record/batches.rb
266
282
  - ext/active_record/calculations.rb
267
283
  - ext/active_record/finder_methods.rb
284
+ - ext/active_record/persistence.rb
268
285
  - ext/active_record/query_methods.rb
269
286
  - ext/active_record/relation.rb
270
287
  - ext/active_record/relation/predicate_builder.rb
271
288
  - ext/active_record/statement_cache.rb
272
289
  - ext/active_support/core_ext/object/to_query.rb
290
+ - ext/arel/attributes/relation.rb
273
291
  - ext/arel/nodes/eager_load.rb
274
292
  - ext/arel/nodes/select_statement.rb
275
293
  - ext/arel/select_manager.rb
@@ -279,6 +297,7 @@ files:
279
297
  - lib/active_record/connection_adapters/sunstone/type/array.rb
280
298
  - lib/active_record/connection_adapters/sunstone/type/date_time.rb
281
299
  - lib/active_record/connection_adapters/sunstone/type/ewkb.rb
300
+ - lib/active_record/connection_adapters/sunstone/type_metadata.rb
282
301
  - lib/active_record/connection_adapters/sunstone_adapter.rb
283
302
  - lib/arel/collectors/sunstone.rb
284
303
  - lib/arel/visitors/sunstone.rb
@@ -307,12 +326,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
307
326
  version: '0'
308
327
  required_rubygems_version: !ruby/object:Gem::Requirement
309
328
  requirements:
310
- - - ">="
329
+ - - ">"
311
330
  - !ruby/object:Gem::Version
312
- version: '0'
331
+ version: 1.3.1
313
332
  requirements: []
314
333
  rubyforge_project:
315
- rubygems_version: 2.4.5
334
+ rubygems_version: 2.5.1
316
335
  signing_key:
317
336
  specification_version: 4
318
337
  summary: A library for interacting with REST APIs