Permalink
Fetching contributors…
Cannot retrieve contributors at this time
50 lines (38 sloc) 1.14 KB
# -*- ruby -*-
require 'rubygems'
require 'spec'
require 'spec/rake/spectask'
BUILD_DIR = 'target'
desc 'clean up'
task :clean do
FileUtils.rm_rf(BUILD_DIR)
end
desc 'Package as a gem.'
task :package do
gemspec = Dir['*.gemspec'].first
Kernel.system("#{RUBY} -S gem build #{gemspec}")
FileUtils.mkdir_p(BUILD_DIR)
gem = Dir['*.gem'].first
FileUtils.mv(gem, File.join(BUILD_DIR,"#{gem}"))
puts File.join(BUILD_DIR,"#{gem}")
end
desc 'Install the package as a gem.'
task :install => [:package] do
gem = Dir[File.join(BUILD_DIR, '*.gem')].first
Kernel.system("#{RUBY} -S gem install --local #{gem}")
end
desc 'Run specifications'
Spec::Rake::SpecTask.new(:spec) do |t|
if File.exists?(File.join('spec','spec.opts'))
t.spec_opts << '--options' << File.join('spec','spec.opts')
end
t.spec_files = Dir.glob(File.join('spec','**','*_spec.rb'))
end
# using both ruby and jruby with bundler is almost impossible - too many
# strange issues
# desc 'generate rails using all generators and run the specs/tests'
# require 'cucumber/rake/task'
# Cucumber::Rake::Task.new do |t|
# t.cucumber_opts = %w{--format pretty}
# end
# vim: syntax=Ruby