Rakefile in watchr-0.6 vs Rakefile in watchr-0.7
- old
+ new
@@ -1,15 +1,24 @@
+def gem_opt
+ defined?(Gem) ? "-rubygems" : ""
+end
+
+def ruby
+ require 'rbconfig'
+ File.join([Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name']]) << Config::CONFIG['EXEEXT']
+end
+
# --------------------------------------------------
# Tests
# --------------------------------------------------
task(:default => "test:all")
namespace(:test) do
desc "Run all tests"
task(:all) do
tests = Dir['test/**/test_*.rb'] - ['test/test_helper.rb']
- exit system("ruby -rubygems -I.:lib -e'%w( #{tests.join(' ')} ).each {|file| require file }'")
+ exit system(%Q{#{ruby} #{gem_opt} -I.:lib -e"%w( #{tests.join(' ')} ).each {|file| require file }"})
end
desc "Run all tests on multiple ruby versions (requires rvm)"
task(:portability) do
%w( 1.8.6 1.8.7 1.9.1 1.9.2 ).each do |version|