aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-01-19 09:19:31 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-01-19 09:19:31 +0000
commit22c005569b8cd00ea6895dcc7b621b80d9f15068 (patch)
treed0e625ef655132a255fbe899d0bf6a361cec8bd5 /lib
parent8e877fc51727feed6c07292c3845970103ec109f (diff)
downloadruby-22c005569b8cd00ea6895dcc7b621b80d9f15068.tar.gz
* variable.c (rb_set_class_path): do not set path if
* lib/cgi.rb (CGI::QueryExtension): give extended string, not a delegater object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/cgi.rb14
-rw-r--r--lib/pathname.rb4
2 files changed, 10 insertions, 8 deletions
diff --git a/lib/cgi.rb b/lib/cgi.rb
index f8158858f3..5ec7e6a7b7 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
diff --git a/lib/pathname.rb b/lib/pathname.rb
index 724a8ff2eb..43b50e1f11 100644
--- a/lib/pathname.rb
+++ b/lib/pathname.rb
@@ -720,7 +720,7 @@ class Pathname # * FileTest *
def readable?() FileTest.readable?(@path) end
# See <tt>FileTest.readable_world?</tt>.
- def readable_world?() FileTest.readable_world?(@path) end
+ def world_readable?() FileTest.world_readable?(@path) end
# See <tt>FileTest.readable_real?</tt>.
def readable_real?() FileTest.readable_real?(@path) end
@@ -747,7 +747,7 @@ class Pathname # * FileTest *
def writable?() FileTest.writable?(@path) end
# See <tt>FileTest.writable_world?</tt>.
- def writable_world?() FileTest.writable_world?(@path) end
+ def world_writable?() FileTest.world_writable?(@path) end
# See <tt>FileTest.writable_real?</tt>.
def writable_real?() FileTest.writable_real?(@path) end