active_rest_client 0.9.72 → 0.9.73

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: 979311b6e72a88f984bed1b34c1c3fd07dde2a9d
4
- data.tar.gz: 327b472ac5851bff68e3d74dbc7b0e127a2b85ca
3
+ metadata.gz: 460632a3d6da332f38436d8c4d578253dc3a0f2e
4
+ data.tar.gz: a44d3ca33dcca47286b5fc69f420d72028062616
5
5
  SHA512:
6
- metadata.gz: 9e9fa00e1d9530c2da3b2783fdb6c02db11c10ad251dc0e6d242d4f11a4d95418583a0e1e2d24784f9487a85e0f12b381fc04f492976b6e5f9fccb6b4445c70b
7
- data.tar.gz: 1f0d887ec3337ee7fb414f8788e36faa96eaf05fb9a9b9cc17991e3fdd8b1cebdfb7cee808d63dcd6ab63f35cc633dd6c1e6c7f83f9491a00dc88d1ac35de5ca
6
+ metadata.gz: 4ccb4c9ad92d157a9996be9d79824f03d143156707b2526761df89dbc08666c173ae0fda3865ab471c5355f107d8b08ceaf981942b560ea0babbd0fd1994c0c5
7
+ data.tar.gz: d42484ef26ea1c377db1bee2dd6977c6e9bf82d9b4618e646765a1a8f8b417f2dd28aa09390734a4e4bd275fa0e00a219d20283528c56756bc1fd60a004c8f82
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
30
30
  spec.add_development_dependency 'terminal-notifier-guard'
31
31
  spec.add_development_dependency 'coveralls'
32
32
 
33
- spec.add_runtime_dependency "oj", "=2.1.4" # 2.1.7 breaks under linux
33
+ spec.add_runtime_dependency "multi_json"
34
34
  spec.add_runtime_dependency "activesupport"
35
35
  spec.add_runtime_dependency "faraday", "~> 0.9"
36
36
  spec.add_runtime_dependency "patron", ">= 0.4.9" # 0.4.18 breaks against Curl v0.7.15 but works with webmock
@@ -80,7 +80,7 @@ module ActiveRestClient
80
80
 
81
81
  def ensure_lazy_loaded
82
82
  if @object.nil?
83
- method = Oj.load(Oj.dump(@request.method))
83
+ method = MultiJson.load(MultiJson.dump(@request.method),:symbolize_keys => true)
84
84
  method[:method] = :get
85
85
  method[:options][:url] = @url
86
86
  method[:options][:overriden_name] = @options[:overriden_name]
@@ -69,7 +69,7 @@ module ActiveRestClient
69
69
  def translate(result, options = {})
70
70
  result.headers["content-type"] = "application/hal+json"
71
71
  result = OpenStruct.new(status:result.status, headers:result.headers, body:result.body)
72
- obj = Oj.load(result.body)
72
+ obj = MultiJson.load(result.body)
73
73
  result.body = yield obj
74
74
  result
75
75
  end
@@ -1,5 +1,5 @@
1
1
  require "cgi"
2
- require "oj"
2
+ require "multi_json"
3
3
 
4
4
  module ActiveRestClient
5
5
 
@@ -267,7 +267,7 @@ module ActiveRestClient
267
267
  if response.body.is_a?(Array) || response.body.is_a?(Hash)
268
268
  body = response.body
269
269
  else
270
- body = Oj.load(response.body) || {}
270
+ body = MultiJson.load(response.body) || {}
271
271
  end
272
272
  body = begin
273
273
  @method[:name].nil? ? body : translator.send(@method[:name], body)
@@ -302,7 +302,7 @@ module ActiveRestClient
302
302
  end
303
303
 
304
304
  result
305
- rescue Oj::ParseError
305
+ rescue MultiJson::ParseError
306
306
  raise ResponseParseException.new(status:response.status, body:response.body)
307
307
  end
308
308
 
@@ -1,3 +1,3 @@
1
1
  module ActiveRestClient
2
- VERSION = "0.9.72"
2
+ VERSION = "0.9.73"
3
3
  end
@@ -276,11 +276,11 @@ describe ActiveRestClient::Base do
276
276
  let(:location) { EmptyExample.new(place:"Room 1408") }
277
277
  let(:lazy) { Laz }
278
278
  let(:object) { EmptyExample.new(name:"Programming 101", location:location, students:[student1, student2]) }
279
- let(:json_parsed_object) { Oj.load(object.to_json) }
279
+ let(:json_parsed_object) { MultiJson.load(object.to_json) }
280
280
 
281
281
  it "should be able to export to valid json" do
282
282
  expect(object.to_json).to_not be_blank
283
- expect{Oj.load(object.to_json)}.to_not raise_error
283
+ expect{MultiJson.load(object.to_json)}.to_not raise_error
284
284
  end
285
285
 
286
286
  it "should not be using Object's #to_json method" do
@@ -39,7 +39,7 @@ describe ActiveRestClient::Request do
39
39
  class FilteredBodyExampleClient < ExampleClient
40
40
  base_url "http://www.example.com"
41
41
  before_request do |name, request|
42
- request.body = Oj.dump(request.post_params)
42
+ request.body = MultiJson.dump(request.post_params)
43
43
  end
44
44
 
45
45
  post :save, "/save"
@@ -472,7 +472,7 @@ describe ActiveRestClient::Request do
472
472
  end
473
473
 
474
474
  it "replaces the body completely in a filter" do
475
- ActiveRestClient::Connection.any_instance.should_receive(:post).with("/save", "{\":id\":1234,\":name\":\"john\"}", an_instance_of(Hash)).and_return(OpenStruct.new(body:"{}", headers:{}))
475
+ ActiveRestClient::Connection.any_instance.should_receive(:post).with("/save", "{\"id\":1234,\"name\":\"john\"}", an_instance_of(Hash)).and_return(OpenStruct.new(body:"{}", headers:{}))
476
476
  FilteredBodyExampleClient.save id:1234, name:'john'
477
477
  end
478
478
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_rest_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.72
4
+ version: 0.9.73
5
5
  platform: ruby
6
6
  authors:
7
7
  - Which Ltd
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-03-06 00:00:00.000000000 Z
12
+ date: 2014-03-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -152,19 +152,19 @@ dependencies:
152
152
  - !ruby/object:Gem::Version
153
153
  version: '0'
154
154
  - !ruby/object:Gem::Dependency
155
- name: oj
155
+ name: multi_json
156
156
  requirement: !ruby/object:Gem::Requirement
157
157
  requirements:
158
- - - '='
158
+ - - ">="
159
159
  - !ruby/object:Gem::Version
160
- version: 2.1.4
160
+ version: '0'
161
161
  type: :runtime
162
162
  prerelease: false
163
163
  version_requirements: !ruby/object:Gem::Requirement
164
164
  requirements:
165
- - - '='
165
+ - - ">="
166
166
  - !ruby/object:Gem::Version
167
- version: 2.1.4
167
+ version: '0'
168
168
  - !ruby/object:Gem::Dependency
169
169
  name: activesupport
170
170
  requirement: !ruby/object:Gem::Requirement