From: Roy Truelove Date: 2009-02-16T05:54:01+09:00 Subject: Re: REXML (1.8.6-p110) backwards compatibility problem with rcov Sean Hussey wrote: > Nice catch! > > After applying both fixes, I now get this: > > /usr/local/lib/ruby/1.8/rexml/formatters/pretty.rb:131:in `[]': no > implicit conversion from nil to integer (TypeError) Hey Sean, it looks like the rexml code is assuming that there'll be a ' ' somewhere in the code to wrap on. I was able to fix this with the following patch to the pretty.rb file : --- /opt/ruby-1.8.7-p72/lib/ruby/1.8/rexml/formatters/pretty.rb.OLD 2009-02-15 14:47:32.000000000 -0600 +++ /opt/ruby-1.8.7-p72/lib/ruby/1.8/rexml/formatters/pretty.rb 2009-02-15 14:48:50.000000000 -0600 @@ -126,10 +126,11 @@ def wrap(string, width) # Recursively wrap string at width. return string if string.length <= width place = string.rindex(' ', width) # Position in string with last ' ' before cutoff + return string if place.nil? # there aren't any ' 's before cutoff, nothing to split on. return string[0,place] + "\n" + wrap(string[place+1..-1], width) end end end -- Posted via http://www.ruby-forum.com/.