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:
parent
348a2bff86
commit
1ec90d1f85
2 changed files with 7 additions and 2 deletions
|
@ -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!"
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue