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

ruby-changes:13161

From: marcandre <ko1@a...>
Date: Mon, 14 Sep 2009 07:35:27 +0900 (JST)
Subject: [ruby-changes:13161] Ruby:r24913 (ruby_1_8): * lib/cgi/cookie.rb (value=): Keep CGI::Cookie#value in sync with the

marcandre	2009-09-14 07:35:12 +0900 (Mon, 14 Sep 2009)

  New Revision: 24913

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

  Log:
    * lib/cgi/cookie.rb (value=): Keep CGI::Cookie#value in sync with the
      cookie itself. A patch by Arthur Schreiber [ruby-core:17634]

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/lib/cgi.rb

Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 24912)
+++ ruby_1_8/ChangeLog	(revision 24913)
@@ -1,3 +1,8 @@
+Mon Sep 14 07:30:56 2009  Marc-Andre Lafortune  <ruby-core@m...>
+
+	* lib/cgi/cookie.rb (value): Keep CGI::Cookie#value in sync with the
+	  cookie itself. A patch by Arthur Schreiber [ruby-core:17634]
+
 Mon Sep 14 04:57:27 2009  Marc-Andre Lafortune  <ruby-core@m...>
 
 	* lib/irb/ext/multi-irb.rb: Fix arguments handling for shell commands
Index: ruby_1_8/lib/cgi.rb
===================================================================
--- ruby_1_8/lib/cgi.rb	(revision 24912)
+++ ruby_1_8/lib/cgi.rb	(revision 24913)
@@ -822,8 +822,8 @@
       super(@value)
     end
 
-    attr_accessor("name", "value", "path", "domain", "expires")
-    attr_reader("secure")
+    attr_accessor("name", "path", "domain", "expires")
+    attr_reader("secure", "value")
 
     # Set whether the Cookie is a secure cookie or not.
     #
@@ -833,16 +833,16 @@
       @secure
     end
 
+    def value=(val)
+      @value.replace(Array(val))
+    end
+
     # Convert the Cookie to its string representation.
     def to_s
       buf = ""
       buf += @name + '='
 
-      if @value.kind_of?(String)
-        buf += CGI::escape(@value)
-      else
-        buf += @value.collect{|v| CGI::escape(v) }.join("&")
-      end
+      buf += @value.map { |v| CGI::escape(v) }.join("&")
 
       if @domain
         buf += '; domain=' + @domain

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

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