webmat (owner)

Forks

  • gist: 16215 by pjhyett Simulation script for build... created Fri Oct 10 21:50:26 -0700 2008

Revisions

gist: 16042 Download_button fork
public
Public Clone URL: git://gist.github.com/16042.git
github-test.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/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"