* lib/cgi.rb (CGI::Cookie::initialize): performance patch from
Makoto Kuwata <kwa@kuwata-lab.com> in [ruby-dev:34048]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
657429b75b
commit
8ead071828
@ -8,6 +8,11 @@ Fri Mar 14 16:59:23 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
|||||||
|
|
||||||
* configure.in (RUBY_LIB_PREFIX): fix for prefix.
|
* configure.in (RUBY_LIB_PREFIX): fix for prefix.
|
||||||
|
|
||||||
|
Fri Mar 14 16:35:11 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/cgi.rb (CGI::Cookie::initialize): performance patch from
|
||||||
|
Makoto Kuwata <kwa@kuwata-lab.com> in [ruby-dev:34048].
|
||||||
|
|
||||||
Fri Mar 14 15:49:05 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Fri Mar 14 15:49:05 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* configure.in (RUBY_LIB_PREFIX): use libdir.
|
* configure.in (RUBY_LIB_PREFIX): use libdir.
|
||||||
|
17
lib/cgi.rb
17
lib/cgi.rb
@ -802,11 +802,16 @@ class CGI
|
|||||||
#
|
#
|
||||||
# These keywords correspond to attributes of the cookie object.
|
# These keywords correspond to attributes of the cookie object.
|
||||||
def initialize(name = "", *value)
|
def initialize(name = "", *value)
|
||||||
options = if name.kind_of?(String)
|
if name.kind_of?(String)
|
||||||
{ "name" => name, "value" => value }
|
@name = name
|
||||||
else
|
@value = value
|
||||||
name
|
%r|^(.*/)|.match(ENV["SCRIPT_NAME"])
|
||||||
end
|
@path = ($1 or "")
|
||||||
|
@secure = false
|
||||||
|
return super(@value)
|
||||||
|
end
|
||||||
|
|
||||||
|
options = name
|
||||||
unless options.has_key?("name")
|
unless options.has_key?("name")
|
||||||
raise ArgumentError, "`name' required"
|
raise ArgumentError, "`name' required"
|
||||||
end
|
end
|
||||||
@ -890,7 +895,7 @@ class CGI
|
|||||||
if cookies.has_key?(name)
|
if cookies.has_key?(name)
|
||||||
values = cookies[name].value + values
|
values = cookies[name].value + values
|
||||||
end
|
end
|
||||||
cookies[name] = Cookie::new({ "name" => name, "value" => values })
|
cookies[name] = Cookie::new(name, *values)
|
||||||
end
|
end
|
||||||
|
|
||||||
cookies
|
cookies
|
||||||
|
Loading…
x
Reference in New Issue
Block a user