$LOAD_PATH.unshift('lib') require 'rubygems' require 'rake' require 'cucumber' require 'cucumber/rake/task' def run_command command system "#{command}" end task :gem => :clean do run_command 'gem build mirage.gemspec' end task :install => :gem do run_command "gem install mirage" end Cucumber::Rake::Task.new(:features) do |t| t.cucumber_opts = "mode=regression features --format pretty" end task :clean do |task| if run_command "gem list -i mirage" puts "cleaning" run_command "gem uninstall -x mirage" end Dir['*.gem'].each{|gem| FileUtils.rm_f(gem)} task.reenable end task :default => [:install,:features,:clean]