Hello,
The following doesn't work anymore with the latest CVS version of Ruby 1.8:
----------------------
require 'cgi'
require 'cgi/session'
cgi = CGI.new
session = CGI::Session.new(cgi)
----------------------
fg@tkp:~$ ruby test.rb
(offline mode: enter name=value pairs on standard input)
/usr/local/lib/ruby/1.8/cgi.rb:947:in `dup': can't dup NilClass (TypeError)
from /usr/local/lib/ruby/1.8/cgi.rb:947:in `to_ary'
from /usr/local/lib/ruby/1.8/cgi/session.rb:37:in `initialize'
from test.rb:7:in `new'
from test.rb:7
Looks like the bug follows the changes on CGI#[] done on Dec 28th.
What makes me love Ruby is the short term solution:
class NilClass
def dup
nil
end
end
.... and my 12000 lines cgi script works again ;-)
Francois
PS: BTW, why nil.dup is illegal by default ?