Created
October 10, 2008 13:28
-
-
Save webmat/16042 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
# An improved GitHub gemspec checker. | |
# GitHub accepts YAML dumps for the gemspecs, which helps keep your gem generation tasks DRY | |
if ARGV.size < 1 | |
puts "Usage: github-test.rb my-project.gemspec" | |
exit | |
end | |
require 'rubygems/specification' | |
data = File.read(ARGV[0]) | |
spec = nil | |
begin | |
Thread.new { spec = eval("$SAFE = 3\n#{data}") }.join | |
rescue SyntaxError | |
#Output in YAML format, then? | |
require 'yaml' | |
spec = YAML.load(data) | |
end | |
puts spec | |
puts "OK" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment