couchrest_model/github_gemtest.rb

20 lines
343 B
Ruby
Raw Normal View History

2008-11-26 22:42:27 +01:00
#!/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"