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

ruby-changes:13822

From: yugui <ko1@a...>
Date: Mon, 2 Nov 2009 00:48:57 +0900 (JST)
Subject: [ruby-changes:13822] Ruby:r25621 (ruby_1_9_1): merges r24914 from trunk into ruby_1_9_1.

yugui	2009-11-02 00:48:39 +0900 (Mon, 02 Nov 2009)

  New Revision: 25621

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

  Log:
    merges r24914 from trunk into ruby_1_9_1.
    --
    * lib/cgi/cookie.rb (value): Keep CGI::Cookie#value in sync with the cookie itself. Based on a patch by Arthur Schreiber [ruby-core:17634]

  Modified files:
    branches/ruby_1_9_1/ChangeLog
    branches/ruby_1_9_1/lib/cgi/cookie.rb
    branches/ruby_1_9_1/version.h

Index: ruby_1_9_1/ChangeLog
===================================================================
--- ruby_1_9_1/ChangeLog	(revision 25620)
+++ ruby_1_9_1/ChangeLog	(revision 25621)
@@ -1,3 +1,8 @@
+Mon Sep 14 06:42:21 2009  Marc-Andre Lafortune  <ruby-core@m...>
+
+	* lib/cgi/cookie.rb (value): Keep CGI::Cookie#value in sync with the
+	  cookie itself. Based on a patch by Arthur Schreiber [ruby-core:17634]
+
 Mon Sep 14 05:21:12 2009  Marc-Andre Lafortune  <ruby-core@m...>
 
 	* lib/net/http.rb (fetch): Handle properly default values; a patch by
Index: ruby_1_9_1/lib/cgi/cookie.rb
===================================================================
--- ruby_1_9_1/lib/cgi/cookie.rb	(revision 25620)
+++ ruby_1_9_1/lib/cgi/cookie.rb	(revision 25621)
@@ -55,11 +55,10 @@
     def initialize(name = "", *value)
       if name.kind_of?(String)
         @name = name
-        @value = value
         %r|^(.*/)|.match(ENV["SCRIPT_NAME"])
         @path = ($1 or "")
         @secure = false
-        return super(@value)
+        return super(value)
       end
 
       options = name
@@ -68,7 +67,7 @@
       end
 
       @name = options["name"]
-      @value = Array(options["value"])
+      value = Array(options["value"])
       # simple support for IE
       if options["path"]
         @path = options["path"]
@@ -80,12 +79,20 @@
       @expires = options["expires"]
       @secure = options["secure"] == true ? true : false
 
-      super(@value)
+      super(value)
     end
 
-    attr_accessor("name", "value", "path", "domain", "expires")
+    attr_accessor("name", "path", "domain", "expires")
     attr_reader("secure")
 
+    def value
+      self
+    end
+
+    def value=(val)
+      replace(Array(val))
+    end
+
     # Set whether the Cookie is a secure cookie or not.
     #
     # +val+ must be a boolean.
@@ -96,7 +103,7 @@
 
     # Convert the Cookie to its string representation.
     def to_s
-      val = @value.kind_of?(String) ? CGI::escape(@value) : @value.collect{|v| CGI::escape(v) }.join("&")
+      val = collect{|v| CGI::escape(v) }.join("&")
       buf = "#{@name}=#{val}"
       buf << "; domain=#{@domain}" if @domain
       buf << "; path=#{@path}"     if @path
Index: ruby_1_9_1/version.h
===================================================================
--- ruby_1_9_1/version.h	(revision 25620)
+++ ruby_1_9_1/version.h	(revision 25621)
@@ -1,5 +1,5 @@
 #define RUBY_VERSION "1.9.1"
-#define RUBY_PATCHLEVEL 331
+#define RUBY_PATCHLEVEL 332
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 9
 #define RUBY_VERSION_TEENY 1

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

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