From 785b31bed4fbe10dd8fe92a7ef52782d2d1d1123 Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 7 Mar 2010 04:55:34 +0000 Subject: * 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 --- lib/pathname.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') 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. -- cgit v1.2.3