Skip to content

Instantly share code, notes, and snippets.

@rsutphin
Created November 23, 2012 07:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rsutphin/4134308 to your computer and use it in GitHub Desktop.
Save rsutphin/4134308 to your computer and use it in GitHub Desktop.
A trivial client for the rubygems.org dependencies API. Prints all versions and their deps for a particular gem.
require 'pp'
require 'rubygems'
GEM_NAME = ARGV.pop or fail "Please give a gem name"
api_result = `curl http://rubygems.org/api/v1/dependencies?gems=#{GEM_NAME}`
pp Marshal.load(api_result).sort_by { |dep| Gem::Version.new(dep[:number]) }.reverse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment