Skip to content
Browse files

Lower multi json version and feature detect to avoid deprecation warn…

…ing.
  • Loading branch information...
1 parent 348a2bf commit 1ec90d1f85a1b71c4dcb603235ce21d7fe65daf7 @jnunemaker committed Apr 21, 2012
Showing with 7 additions and 2 deletions.
  1. +1 −1 httparty.gemspec
  2. +6 −1 lib/httparty/parser.rb
View
2 httparty.gemspec
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
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.add_dependency 'multi_json', "~> 1.3"
+ s.add_dependency 'multi_json', "~> 1.0"
s.add_dependency 'multi_xml'
s.post_install_message = "When you HTTParty, you must party hard!"
View
7 lib/httparty/parser.rb
@@ -113,7 +113,12 @@ def xml
end
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
def yaml

0 comments on commit 1ec90d1

Please sign in to comment.
Something went wrong with that request. Please try again.