Skip to content

Instantly share code, notes, and snippets.

@rdp
Forked from pjhyett/github-test.rb
Created September 16, 2009 15:57
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 rdp/188119 to your computer and use it in GitHub Desktop.
Save rdp/188119 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'yaml'
if ARGV.size < 1
puts "Usage: github-test.rb my-project.gemspec"
exit
end
require 'rubygems'
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