Permalink
Browse files

read gemspec in simulated github environment

  • Loading branch information...
1 parent be5a174 commit 066345135e1d5f6f010f3463c1f72cea1bdb0f96 @rtomayko rtomayko committed Aug 31, 2008
Showing with 8 additions and 1 deletion.
  1. +8 −1 Rakefile
View
@@ -17,9 +17,16 @@ end
# PACKAGING ============================================================
+# Load the gemspec using the same limitations as github
def spec
@spec ||=
- eval(File.read('sinatra.gemspec'))
+ begin
+ require 'rubygems/specification'
+ data = File.read('sinatra.gemspec')
+ spec = nil
+ Thread.new { spec = eval("$SAFE = 3\n#{data}") }.join
+ spec
+ end
end
def package(ext='')

0 comments on commit 0663451

Please sign in to comment.