From 703532aa1c71addb3640d597c86f17c4e7feeb48 Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 28 Dec 2006 06:34:02 +0000 Subject: * lib/cgi.rb (CGI::Cookie::initialize): use Array() again. [ruby-core:09781] * object.c (rb_Array): returns 1-element array if the argument does not have to_ary nor to_a. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 15 ++++++++++----- lib/cgi.rb | 2 +- object.c | 7 +++++-- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 22054c3d5c..4d32153cc4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,19 @@ +Thu Dec 28 15:27:38 2006 Yukihiro Matsumoto + + * lib/cgi.rb (CGI::Cookie::initialize): use Array() again. + [ruby-core:09781] + Wed Dec 27 20:52:32 2006 Masaki Suketa * ext/win32ole/win32ole.c: remove WIN32OLE::PROPERTY class. * ext/win32ole/tests/testWIN32OLE.rb: ditto. +Wed Dec 27 10:04:11 2006 Yukihiro Matsumoto + + * object.c (rb_Array): returns 1-element array if the argument + does not have to_ary nor to_a. + Tue Dec 26 21:02:14 2006 Masaki Suketa * test/win32ole/test_folderitem2_invokeverb.rb: The argument @@ -19,11 +29,6 @@ Thu Dec 21 15:37:17 2006 Yukihiro Matsumoto * string.c (rb_str_slice_bang): rdoc description bug fixed. [ruby-core:09754] -Thu Dec 21 15:32:19 2006 Yukihiro Matsumoto - - * lib/cgi.rb (CGI::Cookie::initialize): option["value"] may or may - not be string. [ruby-core:09750] - Wed Dec 20 12:54:31 2006 Koichi Sasada * Convert CVS repository to Subversion repository. diff --git a/lib/cgi.rb b/lib/cgi.rb index b7b5c2b9f7..440d3bef90 100644 --- a/lib/cgi.rb +++ b/lib/cgi.rb @@ -811,7 +811,7 @@ class CGI end @name = options["name"] - @value = *options["value"] + @value = Array(options["value"]) # simple support for IE if options["path"] @path = options["path"] diff --git a/object.c b/object.c index b5f183fbf9..78e930ff38 100644 --- a/object.c +++ b/object.c @@ -2148,7 +2148,7 @@ rb_String(VALUE val) * to_s method. * * String(self) #=> "main" - * String(self.class #=> "Object" + * String(self.class) #=> "Object" * String(123456) #=> "123456" */ @@ -2164,7 +2164,10 @@ rb_Array(VALUE val) VALUE tmp = rb_check_array_type(val); if (NIL_P(tmp)) { - return rb_convert_type(val, T_ARRAY, "Array", "to_a"); + tmp = rb_check_convert_type(val, T_ARRAY, "Array", "to_a"); + if (NIL_P(tmp)) { + return rb_ary_new3(1, val); + } } return tmp; } -- cgit v1.2.3