Skip to content
This repository has been archived by the owner on Jun 25, 2021. It is now read-only.

Commit

Permalink
Refactored gem tasks and added a clean task.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Berger committed Oct 19, 2010
1 parent 746cc4c commit dc57b25
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions Rakefile
@@ -1,23 +1,31 @@
require 'rake'
require 'rake/testtask'

desc "Remove any gem or rbc (Rubinius) files"
task :clean do
Dir['*.gem'].each{ |f| File.delete(f) }
Dir['**/*.rbc'].each{ |f| File.delete(f) }
end

desc "Install the enumerable-extra library (non-gem)"
task :install do
dest = File.join(Config::CONFIG['sitelibdir'], 'enumerable')
Dir.mkdir(dest) unless File.exists? dest
cp 'lib/enumerable/extra.rb', dest, :verbose => true
end

desc 'Build the enumerable-extra gem'
task :gem do
spec = eval(IO.read('enumerable-extra.gemspec'))
Gem::Builder.new(spec).build
end
namespace :gem do
desc 'Build the enumerable-extra gem'
task :create => [:clean] do
spec = eval(IO.read('enumerable-extra.gemspec'))
Gem::Builder.new(spec).build
end

desc "Install the enumerable-extra library as a gem"
task :install_gem => [:gem] do
file = Dir["*.gem"].first
sh "gem install #{file}"
desc "Install the enumerable-extra library as a gem"
task :install => [:create] do
file = Dir["*.gem"].first
sh "gem install #{file}"
end
end

Rake::TestTask.new do |t|
Expand Down

0 comments on commit dc57b25

Please sign in to comment.