Skip to content

Commit

Permalink
Add Rakefile
Browse files Browse the repository at this point in the history
  • Loading branch information
mynyml committed Feb 7, 2010
1 parent 29f0643 commit 6140278
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions Rakefile
@@ -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

0 comments on commit 6140278

Please sign in to comment.