Skip to content

Instantly share code, notes, and snippets.

@pjhyett
Forked from webmat/github-test.rb
Created October 11, 2008 04:50
Show Gist options
  • Save pjhyett/16215 to your computer and use it in GitHub Desktop.
Save pjhyett/16215 to your computer and use it in GitHub Desktop.
Simulation script for building a gem on GitHub
#!/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
spec.validate
puts spec
puts "OK"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment