-
-
Save pjhyett/16215 to your computer and use it in GitHub Desktop.
Simulation script for building a gem on GitHub
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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