1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/pathname.rb (cleanpath_aggressive): make it private.

(cleanpath_conservative): ditto.
  Suggested by Daniel Berger.  [ruby-core:3914]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2004-12-12 16:04:31 +00:00
parent fce66ceec5
commit 24056dbf4d
2 changed files with 10 additions and 2 deletions

View file

@ -254,7 +254,7 @@ class Pathname
# Clean the path simply by resolving and removing excess "." and ".." entries.
# Nothing more, nothing less.
#
def cleanpath_aggressive # :nodoc:
def cleanpath_aggressive
# cleanpath_aggressive assumes:
# * no symlink
# * all pathname prefix contained in the pathname is existing directory
@ -280,8 +280,9 @@ class Pathname
path << names.join('/')
Pathname.new(path)
end
private :cleanpath_aggressive
def cleanpath_conservative # :nodoc:
def cleanpath_conservative
return Pathname.new('') if @path == ''
names = @path.scan(%r{[^/]+})
last_dot = names.last == '.'
@ -299,6 +300,7 @@ class Pathname
end
Pathname.new(path)
end
private :cleanpath_conservative
#
# Returns a real (absolute) pathname of +self+ in the actual filesystem.