1
0
Fork 0
mirror of https://github.com/jnunemaker/httparty synced 2023-03-27 23:23:07 -04:00

Lower multi json version and feature detect to avoid deprecation warning.

This commit is contained in:
John Nunemaker 2012-04-21 17:53:45 -04:00
parent 348a2bff86
commit 1ec90d1f85
2 changed files with 7 additions and 2 deletions

View file

@ -12,7 +12,7 @@ Gem::Specification.new do |s|
s.summary = %q{Makes http fun! Also, makes consuming restful web services dead easy.} s.summary = %q{Makes http fun! Also, makes consuming restful web services dead easy.}
s.description = %q{Makes http fun! Also, makes consuming restful web services dead easy.} s.description = %q{Makes http fun! Also, makes consuming restful web services dead easy.}
s.add_dependency 'multi_json', "~> 1.3" s.add_dependency 'multi_json', "~> 1.0"
s.add_dependency 'multi_xml' s.add_dependency 'multi_xml'
s.post_install_message = "When you HTTParty, you must party hard!" s.post_install_message = "When you HTTParty, you must party hard!"

View file

@ -113,7 +113,12 @@ module HTTParty
end end
def json def json
MultiJson.load(body) # https://github.com/sferik/rails/commit/5e62670131dfa1718eaf21ff8dd3371395a5f1cc
if MultiJson.respond_to?(:adapter)
MultiJson.load(body)
else
MultiJson.decode(json)
end
end end
def yaml def yaml