C:/jruby/lib/ruby/gems/1.8/gems/needle1.3.0/lib/needle/logger.rb:121:in `method_missing': undefined method `length'
for :NilClass (NoMethodError)
the failing line:
format_string << $' if $'.length > 0
the error only occurs in jruby, but the bug would propably apply to both worlds:
$ ruby -e "la= \"lulu\"; la =~ /m/; p $'.length() "
-e:1: undefined method `length' for nil:NilClass (NoMethodError)
$ ruby -e "la= \"lulu\"; la =~ /m/; p $'.length "
-e:1: undefined method `length' for nil:NilClass (NoMethodError)
$ ruby -e "la= \"lulu\"; la =~ /lu/; p $'.length "
2
$ ruby -e "la= \"lulu\"; la =~ /m/; p $'.instance_of?(String) "
false
$ ruby -e "la= \"lulu\"; la =~ /lu/; p $'.instance_of?(String) "
true
so we probably have to check first, wheater $' is actually a String. e.g.
format_string << $' if $'.length > 0 if $'.instance_of?(String)
so long,
/fux
PS: the issue with jruby still is:
ruby output: # Logfile created on Fri Mar 30 15:04:38 +0200 2007 by logger.rb/1.5.2.9
jruby output: # Logfile created on Fri Mar 30 15:15:11 CEST 2007 by /
but at least it's not exiting abnormaly... :) |