#!/usr/bin/ruby # Name: gemdeps.rb # Author: Robin H. Johnson # Description: # Produce output identical to 'gem depend FOO' # but by taking Gem metadata on STDIN instead of requiring the Gem to be # installed. # Usage: # tar xf rails-1.2.5.gem -O metadata.gz | zcat | ruby deps.rb require 'rubygems' s = Gem::Specification.from_yaml(STDIN) print "Gem ",s.full_name,"\n" s.dependencies.each do |i| print " ",i, "\n" end