Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

replace json_pure with multi_json

  • Loading branch information...
commit ab0a742cb08089b744f8064433f2e7dc708332ff 1 parent f81c61d
@theganyo authored
View
4 lib/usergrid/core/resource.rb
@@ -78,12 +78,12 @@ def get(additional_headers={}, &block)
end
def post(payload, additional_headers={}, &block)
- payload = payload.to_json if payload.is_a?(Hash) || payload.is_a?(Array)
+ payload = MultiJson.dump(payload) if payload.is_a?(Hash) || payload.is_a?(Array)
self.response = super payload, additional_headers, &block
end
def put(payload, additional_headers={}, &block)
- payload = payload.to_json if payload.is_a?(Hash) || payload.is_a?(Array)
+ payload = MultiJson.dump(payload) if payload.is_a?(Hash) || payload.is_a?(Array)
self.response = super payload, additional_headers, &block
end
View
2  lib/usergrid/extensions/response.rb
@@ -10,7 +10,7 @@ def resource
end
def data
- @data = JSON.parse(self).add_dot_notation! unless @data
+ @data = MultiJson.load(self).add_dot_notation! unless @data
@data
end
View
3  lib/usergrid_iron.rb
@@ -1,5 +1,6 @@
require 'logger'
-require 'json'
+require 'multi_json'
+
module Usergrid
View
2  spec/spec_helper.rb
@@ -29,7 +29,7 @@
SPEC_SETTINGS[:organization][:password])
LOG.info "created organization with user #{SPEC_SETTINGS[:organization][:username]}@email.com"
rescue
- if JSON($!.response)['error'] == "duplicate_unique_property_exists"
+ if MultiJson.load($!.response)['error'] == "duplicate_unique_property_exists"
LOG.debug "test organization exists"
else
raise $!
View
2  usergrid_iron.gemspec
@@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
gem.version = Usergrid::VERSION
gem.add_dependency 'rest-client'
- gem.add_dependency 'json_pure'
+ gem.add_dependency 'multi_json'
gem.add_development_dependency 'rake'
gem.add_development_dependency 'rspec'
Please sign in to comment.
Something went wrong with that request. Please try again.