Permalink
Browse files

Added JRuby support for running the tasks. It decides upon platform w…

…hich patterns exclude and how to run the rcov bin

Signed-off-by: commondream <alan@gnoso.com>
  • Loading branch information...
Leonardo Borges commondream
Leonardo Borges authored and commondream committed May 5, 2009
1 parent 32a77e5 commit 49631bb57fa9c7aa26375455b2523b7cd30a158c
Showing with 6 additions and 3 deletions.
  1. +6 −3 tasks/rcov.rake
View
9 tasks/rcov.rake 100644 → 100755
@@ -9,9 +9,11 @@ def run_coverage(files)
end
files = files.join(" ")
-
+
if PLATFORM =~ /darwin/
exclude = '--exclude "gems/*" --exclude "Library/Frameworks/*"'
+ elsif PLATFORM =~ /java/
+ exclude = '--exclude "rubygems/*,jruby/*,parser*,gemspec*,_DELEGATION*,eval*,recognize_optimized*,yaml,yaml/*,fcntl"'
else
exclude = '--exclude "rubygems/*"'
end
@@ -38,8 +40,8 @@ def run_coverage(files)
exclude = exclude + params
end
-
- rcov = "rcov --rails -Ilib:test --sort coverage --text-report #{exclude} --no-validator-links"
+ rcov_bin = PLATFORM =~ /java/ ? "jruby -S rcov" : "rcov"
+ rcov = "#{rcov_bin} --rails -Ilib:test --sort coverage --text-report #{exclude} --no-validator-links"
puts
puts
puts "Running tests..."
@@ -72,3 +74,4 @@ namespace :test do
end
end
end
+

0 comments on commit 49631bb

Please sign in to comment.