Bugs: Browse | Submit New | Admin

[#21816] JRuby 1.1.4 with rcov-0.8.1.2.0-java.gem

Date:
2008-09-04 21:28
Priority:
3
Submitted By:
Suraj Kurapati (snk)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
JRuby 1.1.4 with rcov-0.8.1.2.0-java.gem

Detailed description
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.

Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item