Hello,
When using Rcov with JRuby on Windows, Rcov crashes when trying to open the following filename for writing:
"coverage/file:-C:-Program Files-jruby-1_1_4-lib-jruby_jar!-jruby-path_helper_rb.html"
This is because Windows is interpreting the ':' colon symbols in the filename.
To fix this, change the following code in lib/rcov/report.rb from:
@mangle_filename = Hash.new{|h,base|
h[base] = Pathname.new(base).cleanpath.to_s.gsub(%r{^\w:[/\\]}, "").tr(".",
"_").gsub(/[\\\/:]/, "-") + ".html"
}
To:
@mangle_filename = Hash.new{|h,base|
h[base] = Pathname.new(base).cleanpath.to_s.gsub(%r{^\w:[/\\]}, "").gsub(/\./,
"_").gsub(/[\\\/]/, "-") + ".html"
}
Another problem that occurs is Rcov crashes when coercing a NIL into a Fixnum in lib/rcov/rcov.rb:654 in the aggregate_data()
method. Change that line from:
cov_arr.each_with_index{|x,i| dest[i] += x}
to:
cov_arr.each_with_index{|x,i| dest[i] += x.to_i}
Thanks. |