Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 48 lines (38 sloc) 1.197 kb
2ad93af9 »
2010-10-29 first import
1 # -*- ruby -*-
2
3 require 'rubygems'
4
5 require 'spec'
6 require 'spec/rake/spectask'
7
8 BUILD_DIR = 'target'
9
10 desc 'clean up'
11 task :clean do
12 FileUtils.rm_rf(BUILD_DIR)
13 end
14
15 desc 'Package as a gem.'
16 task :package do
17 require 'fileutils'
18 gemspec = Dir['*.gemspec'].first
19 Kernel.system("#{RUBY} -S gem build #{gemspec}")
20 FileUtils.mkdir_p(BUILD_DIR)
21 gem = Dir['*.gem'].first
22 FileUtils.mv(gem, File.join(BUILD_DIR,"#{gem}"))
23 puts File.join(BUILD_DIR,"#{gem}")
24 end
25
26 desc 'Install the package as a gem.'
27 task :install => [:package] do
28 gem = Dir[File.join(BUILD_DIR, '*.gem')].first
29 extra = ENV['GEM_HOME'].nil? && ENV['GEM_PATH'].nil? ? "--user-install" : ""
30 Kernel.system("#{RUBY} -S gem install --local #{gem} --no-ri --no-rdoc #{extra}")
31 end
32
33 desc 'Run specifications'
34 Spec::Rake::SpecTask.new(:spec) do |t|
35 if File.exists?(File.join('spec','spec.opts'))
36 t.spec_opts << '--options' << File.join('spec','spec.opts')
37 end
38 t.spec_files = Dir.glob(File.join('spec','**','*_spec.rb'))
39 end
40
41 desc 'generate rails using all generators and run the specs/tests'
42 require 'cucumber/rake/task'
43
44 Cucumber::Rake::Task.new do |t|
45 t.cucumber_opts = %w{--format pretty}
46 end
47 # vim: syntax=Ruby
Something went wrong with that request. Please try again.