Skip to content

Instantly share code, notes, and snippets.

@tommeier
Forked from pjhyett/github-test.rb
Created June 29, 2009 01:49
Show Gist options
  • Save tommeier/137429 to your computer and use it in GitHub Desktop.
Save tommeier/137429 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'rubygems'
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
spec.validate
puts spec
puts "OK"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment