Skip to content

Commit

Permalink
Lower multi json version and feature detect to avoid deprecation warn…
Browse files Browse the repository at this point in the history
…ing.
  • Loading branch information
jnunemaker committed Apr 21, 2012
1 parent 348a2bf commit 1ec90d1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion httparty.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
Expand Down
7 changes: 6 additions & 1 deletion lib/httparty/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1ec90d1

Please sign in to comment.