Guest User

Untitled

a guest
Feb 20th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #!/usr/bin/env ruby
  2.  
  3. # An improved GitHub gemspec checker.
  4. # GitHub accepts YAML dumps for the gemspecs, which helps keep your gem generation tasks DRY
  5.  
  6. if ARGV.size < 1
  7. puts "Usage: github-test.rb my-project.gemspec"
  8. exit
  9. end
  10.  
  11. require 'rubygems/specification'
  12. data = File.read(ARGV[0])
  13. spec = nil
  14. begin
  15. Thread.new { spec = eval("$SAFE = 3\n#{data}") }.join
  16. rescue SyntaxError
  17. #Output in YAML format, then?
  18. require 'yaml'
  19. spec = YAML.load(data)
  20. end
  21. puts spec
  22. puts "OK"
Add Comment
Please, Sign In to add comment