Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
def gem_opt | ||
defined?(Gem) ? "-rubygems" : "" | ||
end | ||
|
||
# -------------------------------------------------- | ||
# Tests | ||
# -------------------------------------------------- | ||
task(:default => "test:all") | ||
|
||
namespace(:test) do | ||
|
||
desc "Run all tests" | ||
task(:all) do | ||
exit system("ruby #{gem_opt} -I.:lib:test -e'%w( #{Dir['test/**/*_test.rb'].join(' ')} ).each {|p| require p }'") | ||
end | ||
|
||
desc "Run all tests on multiple ruby versions (requires rvm)" | ||
task(:portability) do | ||
versions = %w( 1.8.6 1.8.7 1.9 1.9.2 ) | ||
versions.each do |version| | ||
system <<-BASH | ||
bash -c 'source ~/.rvm/scripts/rvm; | ||
rvm use #{version}; | ||
echo "--------- #{version} ----------"; | ||
rake -s test:all' | ||
BASH | ||
end | ||
end | ||
end | ||
|
||
# -------------------------------------------------- | ||
# Docs | ||
# -------------------------------------------------- | ||
desc "Generate YARD Documentation" | ||
task :yardoc do | ||
require 'yard' | ||
YARD::CLI::Yardoc.run *%w( -o doc/yard --readme README.md - LICENSE ) | ||
end | ||
|