couchrest_model/github_gemtest.rb
2008-11-26 13:42:27 -08:00

20 lines
343 B
Ruby

#!/usr/bin/env ruby
require 'yaml'
if ARGV.size < 1
puts "Usage: github-test.rb my-project.gemspec"
exit
end
require 'rubygems/specification'
data = File.read(ARGV[0])
spec = nil
if data !~ %r{!ruby/object:Gem::Specification}
Thread.new { spec = eval("$SAFE = 3\n#{data}") }.join
else
spec = YAML.load(data)
end
puts spec
puts "OK"