CGI::Cookie.new を高速化するバッチ

e$B7,ED$H$$$$$^$9!#e(B
cgi.rb e$B$K$$$$F!"e(BCGI::Cookie.new e$B$re(B (e$BB?>/$G$9$,e(B)
e$B9bB.2=$9$ke(B
e$B%Q%C%A$G$9!#e(B
e$B6qBNE
$K$O!e(BCGI::cookie::parse() e$B$He(B CGI#initialize()
e$B$K$*$$$Fe(B
e$BL5BL$Je(B Hash e$B$,@8@.$5$l$k$N$r$5$1$F$$$^$9!#e(B
e$B$b$7$h$m$7$1$l$P!$H$j$3$`$3$H$r$48!F$$/[email protected]$5$$!#e(B

lib/cgi.rb

diff -r a23fc207b656 lib/cgi.rb
a/lib/cgi.rb Fri Mar 14 15:33:22 2008 +0900
+++ b/lib/cgi.rb Fri Mar 14 15:57:36 2008 +0900
@@ -792,11 +792,16 @@ class CGI
#
# These keywords correspond to attributes of the cookie object.
def initialize(name = , *value)

  •  options = if name.kind_of?(String)
    
  •              { "name" => name, "value" => value }
    
  •            else
    
  •              name
    
  •            end
    
  •  if name.kind_of?(String)
    
  •    @name = name
    
  •    @value = value
    
  •    %r|^(.*/)|.match(ENV["SCRIPT_NAME"])
    
  •    @path = ($1 or "")
    
  •    @secure = false
    
  •    return super(@value)
    
  •  end
    
  •  options = name
     unless options.has_key?("name")
       raise ArgumentError, "`name' required"
     end
    

@@ -880,7 +885,7 @@ class CGI
if cookies.has_key?(name)
values = cookies[name].value + values
end

  •  cookies[name] = Cookie::new({ "name" => name, "value" => values 
    

})

  •  cookies[name] = Cookie::new(name, *values)
    

    end

    cookies


e$B0J>e$G$9!#e(B

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message Re: [ruby-dev:34048] CGI::Cookie.new
e$B$r9bB.2=$9$k%P%C%Ae(B
on Fri, 14 Mar 2008 16:29:37 +0900, Makoto Kuwata
[email protected] writes:

|e$B7,ED$H$$$$$^$9!#e(B
|cgi.rb e$B$K$$$$F!"e(BCGI::Cookie.new e$B$re(B (e$BB?>/$G$9$,e(B) e$B9bB.2=$9$ke(B
|e$B%Q%C%A$G$9!#e(B
|e$B6qBNE
$K$O!e(BCGI::cookie::parse() e$B$He(B CGI#initialize() e$B$K$*$$$Fe(B
|e$BL5BL$Je(B Hash e$B$,@8@.$5$l$k$N$r$5$1$F$$$^$9!#e(B
|e$B$b$7$h$m$7$1$l$P!$H$j$3$`$3$H$r$48!F$$/[email protected]$5$$!#e(B

e$B<h$j9~$_$^$7$?!#e(B

e$B7,ED$G$9!#e(B

2008/3/14 Yukihiro M. [email protected]:

e$B<h$j9~$_$^$7$?!#e(B

e$B$9$P$d$$BP1~!"$"$j$,$H$&$4$6$$$^$7$?!#e(B

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs