1
0
Fork 0
mirror of https://github.com/thoughtbot/shoulda-matchers.git synced 2022-11-09 12:01:38 -05:00
thoughtbot--shoulda-matchers/Rakefile

77 lines
2.1 KiB
Text
Raw Normal View History

require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'rake/gempackagetask'
$LOAD_PATH.unshift("lib")
require 'shoulda'
load 'tasks/shoulda.rake'
# Test::Unit::UI::VERBOSE
2009-01-22 18:22:11 -05:00
test_files_pattern = 'test/{unit,functional,other,matchers}/**/*_test.rb'
Rake::TestTask.new do |t|
t.libs << 'lib' << 'test'
t.pattern = test_files_pattern
t.verbose = false
end
Rake::RDocTask.new { |rdoc|
rdoc.rdoc_dir = 'doc'
rdoc.title = "Shoulda -- Making tests easy on the fingers and eyes"
rdoc.options << '--line-numbers'
rdoc.template = "#{ENV['template']}.rb" if ENV['template']
2008-06-17 13:07:10 -04:00
rdoc.rdoc_files.include('README.rdoc', 'CONTRIBUTION_GUIDELINES.rdoc', 'lib/**/*.rb')
}
desc "Run code-coverage analysis using rcov"
task :coverage do
rm_rf "coverage"
files = Dir[test_files_pattern]
system "rcov --rails --sort coverage -Ilib #{files.join(' ')}"
end
desc 'Update documentation on website'
task :sync_docs => 'rdoc' do
`rsync -ave ssh doc/ dev@dev.thoughtbot.com:/home/dev/www/dev.thoughtbot.com/shoulda`
end
desc 'Default: run tests for all supported versions of Rails'
task :default do
%w(2.3.8 3.0.0.beta3).each do |version|
system("RAILS_VERSION=#{version} rake -s test;")
end
end
spec = Gem::Specification.new do |s|
s.name = "shoulda"
s.version = Shoulda::VERSION
s.summary = "Making tests easy on the fingers and eyes"
s.homepage = "http://thoughtbot.com/projects/shoulda"
s.rubyforge_project = "shoulda"
s.files = FileList["[A-Z]*", "{bin,lib,rails,test}/**/*"]
s.executables = s.files.grep(/^bin/) { |f| File.basename(f) }
s.has_rdoc = true
s.extra_rdoc_files = ["README.rdoc", "CONTRIBUTION_GUIDELINES.rdoc"]
s.rdoc_options = ["--line-numbers", "--main", "README.rdoc"]
s.authors = ["Tammer Saleh"]
s.email = "tsaleh@thoughtbot.com"
end
Rake::GemPackageTask.new spec do |pkg|
pkg.need_tar = true
pkg.need_zip = true
end
desc "Clean files generated by rake tasks"
task :clobber => [:clobber_rdoc, :clobber_package]
desc "Generate a gemspec file for GitHub"
task :gemspec do
File.open("#{spec.name}.gemspec", 'w') do |f|
f.write spec.to_ruby
end
end