Skip to content

Commit

Permalink
Move to MultiJson for multi-platform support
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Spiegel authored and Aaron Spiegel committed Apr 11, 2013
1 parent d6863af commit cae468a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Gemfile
Expand Up @@ -2,3 +2,6 @@ source 'https://rubygems.org'

# Specify your gem's dependencies in comic_vine.gemspec
gemspec

gem 'gson', platform: :jruby
gem 'oj', platform: :ruby
2 changes: 1 addition & 1 deletion comic_vine.gemspec
Expand Up @@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
gem.require_paths = ["lib"]
gem.version = ComicVine::VERSION

gem.add_dependency 'json'
gem.add_dependency 'multi_json'
gem.add_development_dependency "rspec", ">= 2.0.0"
gem.add_development_dependency "webmock"
gem.add_development_dependency "simplecov"
Expand Down
4 changes: 2 additions & 2 deletions lib/comic_vine.rb
@@ -1,6 +1,6 @@
require "comic_vine/version"
require "net/http"
require "json"
require "multi_json"
require "cgi"

module ComicVine
Expand Down Expand Up @@ -78,7 +78,7 @@ def hit_api base_url, query=""
url = base_url+"?format=json&api_key=#{@@key}"+query
uri = URI.parse(url)
resp = Net::HTTP.get(uri)
presp = JSON.parse(resp)
presp = MultiJson.load(resp)
raise CVError, presp['error'] unless presp['status_code'] == 1
presp
end
Expand Down

0 comments on commit cae468a

Please sign in to comment.