summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-07 04:55:34 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-07 04:55:34 +0000
commit785b31bed4fbe10dd8fe92a7ef52782d2d1d1123 (patch)
treee72e793ea4c5bc6bbc4e8dfb4d56c32ac45a5b4d /lib
parent8a144fdedc2df7ee87e21ad805fcbcbd18209533 (diff)
* file.c: add optional basedir argument for realpath/realdirpath.
(realpath_internal): handle basedir. (rb_file_s_realpath): extract basedir from argument list. (rb_file_s_realdirpath): extract basedir from argument list. * lib/pathname.rb (realpath): pass basedir. (realdirpath): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/pathname.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/pathname.rb b/lib/pathname.rb
index bfd3771c28..cede33d273 100644
--- a/lib/pathname.rb
+++ b/lib/pathname.rb
@@ -442,8 +442,8 @@ class Pathname
# All components of the pathname must exist when this method is
# called.
#
- def realpath
- self.class.new(File.realpath(@path))
+ def realpath(basedir=nil)
+ self.class.new(File.realpath(@path, basedir))
end
#
@@ -452,8 +452,8 @@ class Pathname
#
# The last component of the real pathname can be nonexistent.
#
- def realdirpath
- self.class.new(File.realdirpath(@path))
+ def realdirpath(basedir=nil)
+ self.class.new(File.realdirpath(@path, basedir))
end
# #parent returns the parent directory.