Permalink
Browse files

Changing multi_json version at spec

This change allows Restfolia be compatible with all versions
from multi_json  >= 1 and <=2.
  • Loading branch information...
1 parent 406ef9a commit 89dbcffbec8698c4e8e24225ab3d03a27b5d9bce Roger Leite committed Jun 27, 2012
Showing with 4 additions and 4 deletions.
  1. +2 −2 lib/restfolia/entry_point.rb
  2. +1 −1 lib/restfolia/http/behaviour.rb
  3. +1 −1 restfolia.gemspec
@@ -91,7 +91,7 @@ def get(params = nil)
# Restfolia::HTTP::Behaviour methods for more details.
# Raises URI::InvalidURIError if url attribute is invalid.
def post(params)
- body = MultiJson.dump(params)
+ body = MultiJson.encode(params)
args = self.configuration.merge(:body => body)
http_resp = Restfolia::HTTP::Request.do_request(:post, self.url, args)
@@ -118,7 +118,7 @@ def post(params)
# Restfolia::HTTP::Behaviour methods for more details.
# Raises URI::InvalidURIError if url attribute is invalid.
def put(params)
- body = MultiJson.dump(params)
+ body = MultiJson.encode(params)
args = self.configuration.merge(:body => body)
http_resp = Restfolia::HTTP::Request.do_request(:put, self.url, args)
@@ -28,7 +28,7 @@ class Helpers
def parse_json(http_response)
body = http_response.body
begin
- MultiJson.load(body, :symbolize_keys => true)
+ MultiJson.decode(body, :symbolize_keys => true)
rescue MultiJson::DecodeError => ex
msg = "Body should be a valid json. #{ex.message}"
raise Restfolia::ResponseError.new(msg, caller, http_response)
View
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
- s.add_runtime_dependency "multi_json", "~> 1.3.0"
+ s.add_runtime_dependency "multi_json", "~> 1.0"
s.add_development_dependency "rake"
s.add_development_dependency "minitest", "~> 3"

0 comments on commit 89dbcff

Please sign in to comment.