Permalink
Browse files

Remove multi_json dependency by requiring Ruby 1.9

This was the last lingering dependency. I was able to convert almost
every method to request and parse YAML instead of JSON but I got stuck
on rubygems/gemcutter#323. Ruby 1.9 includes JSON as part of the
standard library, so by requiring 1.9, I don't need to specify it as a
dependency. Users of older Ruby versions can hack around this constraint
by force-installing the gem and requiring a JSON library manually.

Closes #4.
  • Loading branch information...
1 parent 266d565 commit 1362d7d0ac1116c7f8060cf436041b20edcbca45 @sferik committed Jul 27, 2011
Showing with 17 additions and 18 deletions.
  1. +3 −4 .travis.yml
  2. +12 −12 gems.gemspec
  3. +2 −2 lib/gems/client.rb
View
@@ -1,7 +1,6 @@
rvm:
- - 1.8.7
+ - 1.9.1
- 1.9.2
- - jruby
- - rbx
- - ree
+ - 1.9.2-head
+ - 1.9.3-head
- ruby-head
View
@@ -9,18 +9,18 @@ Gem::Specification.new do |gem|
gem.add_development_dependency 'simplecov', '~> 0.4'
gem.add_development_dependency 'webmock', '~> 1.6'
gem.add_development_dependency 'yard', '~> 0.7'
- gem.add_runtime_dependency 'multi_json', '~> 1.0.3'
- gem.authors = ["Erik Michaels-Ober"]
- gem.email = ['sferik@gmail.com']
- gem.description = %q{Ruby wrapper for the RubyGems.org API}
- gem.summary = gem.description
- gem.homepage = 'https://github.com/sferik/gems'
+ gem.authors = ["Erik Michaels-Ober"]
+ gem.email = ['sferik@gmail.com']
+ gem.description = %q{Ruby wrapper for the RubyGems.org API}
+ gem.summary = gem.description
+ gem.homepage = 'https://github.com/sferik/gems'
- gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
- gem.files = `git ls-files`.split("\n")
- gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
- gem.name = 'gems'
- gem.require_paths = ['lib']
- gem.version = Gems::VERSION
+ gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+ gem.files = `git ls-files`.split("\n")
+ gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ gem.name = 'gems'
+ gem.require_paths = ['lib']
+ gem.required_ruby_version = '>= 1.9'
+ gem.version = Gems::VERSION
end
View
@@ -1,7 +1,7 @@
require 'date'
require 'gems/configuration'
require 'gems/request'
-require 'multi_json'
+require 'json'
require 'yaml'
module Gems
@@ -49,7 +49,7 @@ def search(query)
# Gems.versions 'coulda'
def versions(gem_name)
response = get("/api/v1/versions/#{gem_name}.json")
- MultiJson.decode(response)
+ JSON.parse(response)
end
# Returns the total number of downloads for a particular gem

0 comments on commit 1362d7d

Please sign in to comment.