diff --git a/ChangeLog b/ChangeLog index a40e5b560f8dc5..6f55ba7fddf76a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon Dec 13 00:58:02 2004 Tanaka Akira + + * lib/pathname.rb (cleanpath_aggressive): make it private. + (cleanpath_conservative): ditto. + Suggested by Daniel Berger. [ruby-core:3914] + Sun Dec 12 21:32:14 2004 Nobuyoshi Nakada * test/ruby/test_super.rb (TestSuper#test_define_method): now methods diff --git a/lib/pathname.rb b/lib/pathname.rb index bd8afb081dc9b1..be1cb29b43c27a 100644 --- a/lib/pathname.rb +++ b/lib/pathname.rb @@ -256,7 +256,7 @@ def cleanpath(consider_symlink=false) # 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 @@ -282,8 +282,9 @@ def cleanpath_aggressive # :nodoc: 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 == '.' @@ -301,6 +302,7 @@ def cleanpath_conservative # :nodoc: end Pathname.new(path) end + private :cleanpath_conservative # # Returns a real (absolute) pathname of +self+ in the actual filesystem.