[前][次][番号順一覧][スレッド一覧]

ruby-changes:11562

From: mame <ko1@a...>
Date: Fri, 17 Apr 2009 00:58:38 +0900 (JST)
Subject: [ruby-changes:11562] Ruby:r23196 (trunk): * lib/cgi/core.rb (read_multipart): When path is not defined,

mame	2009-04-17 00:58:23 +0900 (Fri, 17 Apr 2009)

  New Revision: 23196

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=23196

  Log:
    * lib/cgi/core.rb (read_multipart): When path is not defined,
      define local_path as a method always returning nil instead of
      aliasing.  This is because StringIO#path no longer exists.

  Modified files:
    trunk/ChangeLog
    trunk/lib/cgi/core.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 23195)
+++ ChangeLog	(revision 23196)
@@ -1,3 +1,9 @@
+Fri Apr 17 00:53:47 2009  Yusuke Endoh  <mame@t...>
+
+	* lib/cgi/core.rb (read_multipart): When path is not defined,
+	  define local_path as a method always returning nil instead of
+	  aliasing.  This is because StringIO#path no longer exists.
+
 Fri Apr 17 00:45:09 2009  Yusuke Endoh  <mame@t...>
 
 	* dir.c (bracket): fix escape handling for range character in bracket
Index: lib/cgi/core.rb
===================================================================
--- lib/cgi/core.rb	(revision 23195)
+++ lib/cgi/core.rb	(revision 23196)
@@ -440,7 +440,13 @@
         ## create body (StringIO or Tempfile)
         body = create_body(bufsize < content_length)
         class << body
-          alias local_path path
+          if method_defined?(:path)
+            alias local_path path
+          else
+            def local_path
+              nil
+            end
+          end
           attr_reader :original_filename, :content_type
         end
         ## find head and boundary

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]