diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-07-14 14:22:11 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-07-14 14:22:11 +0000 |
commit | b2b23fb1cdb54d5a9141867947b2ca77bf3730a3 (patch) | |
tree | ec2f7c5a884c4f259f7b4971e9ce5664952d35aa /lib/cgi.rb | |
parent | bde894ffc933e13007a68627f0f5fe02ed1f2b7e (diff) | |
download | ruby-b2b23fb1cdb54d5a9141867947b2ca77bf3730a3.tar.gz ruby-b2b23fb1cdb54d5a9141867947b2ca77bf3730a3.tar.xz ruby-b2b23fb1cdb54d5a9141867947b2ca77bf3730a3.zip |
* gc.c, parse.y, lib/cgi.rb, lib/date.rb: last minute backports from HEAD.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@6628 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/cgi.rb')
-rw-r--r-- | lib/cgi.rb | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/cgi.rb b/lib/cgi.rb index 17bbdbeab..3141d3d69 100644 --- a/lib/cgi.rb +++ b/lib/cgi.rb @@ -1125,17 +1125,16 @@ class CGI @multipart end - class Value < DelegateClass(String) # :nodoc: - def initialize(str, params) + module Value # :nodoc: + def set_params(params) @params = params - super(str) end def [](idx, *args) if args.size == 0 warn "#{caller(1)[0]}:CAUTION! cgi['key'] == cgi.params['key'][0]; if want Array, use cgi.params['key']" - self + @params[idx] else - self.to_s[idx,*args] + super[idx,*args] end end def first @@ -1165,7 +1164,10 @@ class CGI Tempfile.new("CGI") end else - Value.new(value || "", params) + str = if value then value.dup else "" end + str.extend(Value) + str.set_params(params) + str end end @@ -2310,4 +2312,3 @@ class CGI end end # class CGI - |