Permalink
Browse files

rubygems is required for packaging tasks

  • Loading branch information...
1 parent 1c22a73 commit ad3b0d7517378aa9069e8f11a0332344acd15189 @rtomayko rtomayko committed Jun 7, 2010
Showing with 19 additions and 20 deletions.
  1. +19 −20 Rakefile
View
39 Rakefile
@@ -42,32 +42,31 @@ task :rdoc => ["RDOX"]
# PACKAGING =================================================================
-if defined?(Gem)
- # load gemspec
- $spec = eval(File.read('rack-contrib.gemspec'))
+require 'rubygems'
+# load gemspec
+$spec = eval(File.read('rack-contrib.gemspec'))
- def package(ext='')
- "pkg/rack-contrib-#{$spec.version}" + ext
- end
+def package(ext='')
+ "pkg/rack-contrib-#{$spec.version}" + ext
+end
- desc 'Build packages'
- task :package => %w[.gem .tar.gz].map {|e| package(e)}
+desc 'Build packages'
+task :package => %w[.gem .tar.gz].map {|e| package(e)}
- desc 'Build and install as local gem'
- task :install => package('.gem') do
- sh "gem install #{package('.gem')}"
- end
+desc 'Build and install as local gem'
+task :install => package('.gem') do
+ sh "gem install #{package('.gem')}"
+end
- directory 'pkg/'
+directory 'pkg/'
- file package('.gem') => %w[pkg/ rack-contrib.gemspec] + $spec.files do |f|
- sh "gem build rack-contrib.gemspec"
- mv File.basename(f.name), f.name
- end
+file package('.gem') => %w[pkg/ rack-contrib.gemspec] + $spec.files do |f|
+ sh "gem build rack-contrib.gemspec"
+ mv File.basename(f.name), f.name
+end
- file package('.tar.gz') => %w[pkg/] + $spec.files do |f|
- sh "git archive --format=tar HEAD | gzip > #{f.name}"
- end
+file package('.tar.gz') => %w[pkg/] + $spec.files do |f|
+ sh "git archive --format=tar HEAD | gzip > #{f.name}"
end
# GEMSPEC ===================================================================

0 comments on commit ad3b0d7

Please sign in to comment.