diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-12-28 06:34:02 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-12-28 06:34:02 +0000 |
commit | 703532aa1c71addb3640d597c86f17c4e7feeb48 (patch) | |
tree | 54a1eb931ad401f9842cb57c8df6a86f84457f89 | |
parent | a77bb6b7a761ed7cab8e615284ef7344a571b8f4 (diff) | |
download | ruby-703532aa1c71addb3640d597c86f17c4e7feeb48.tar.gz |
* 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
-rw-r--r-- | ChangeLog | 15 | ||||
-rw-r--r-- | lib/cgi.rb | 2 | ||||
-rw-r--r-- | object.c | 7 |
3 files changed, 16 insertions, 8 deletions
@@ -1,9 +1,19 @@ +Thu Dec 28 15:27:38 2006 Yukihiro Matsumoto <matz@ruby-lang.org> + + * lib/cgi.rb (CGI::Cookie::initialize): use Array() again. + [ruby-core:09781] + Wed Dec 27 20:52:32 2006 Masaki Suketa <masaki.suketa@nifty.ne.jp> * ext/win32ole/win32ole.c: remove WIN32OLE::PROPERTY class. * ext/win32ole/tests/testWIN32OLE.rb: ditto. +Wed Dec 27 10:04:11 2006 Yukihiro Matsumoto <matz@ruby-lang.org> + + * 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 <masaki.suketa@nifty.ne.jp> * test/win32ole/test_folderitem2_invokeverb.rb: The argument @@ -19,11 +29,6 @@ Thu Dec 21 15:37:17 2006 Yukihiro Matsumoto <matz@ruby-lang.org> * string.c (rb_str_slice_bang): rdoc description bug fixed. [ruby-core:09754] -Thu Dec 21 15:32:19 2006 Yukihiro Matsumoto <matz@ruby-lang.org> - - * 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 <ko1@atdot.net> * 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"] @@ -2148,7 +2148,7 @@ rb_String(VALUE val) * <code>to_s</code> 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; } |