Skip to content

Commit

Permalink
* lib/pathname.rb (cleanpath_aggressive): make it private.
Browse files Browse the repository at this point in the history
  (cleanpath_conservative): ditto.
  Suggested by Daniel Berger.  [ruby-core:3914]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
akr committed Dec 12, 2004
1 parent 329c2cd commit 4627c5a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Mon Dec 13 00:58:02 2004 Tanaka Akira <akr@m17n.org>

* 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 <nobu@ruby-lang.org>

* test/ruby/test_super.rb (TestSuper#test_define_method): now methods
Expand Down
6 changes: 4 additions & 2 deletions lib/pathname.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 == '.'
Expand All @@ -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.
Expand Down

0 comments on commit 4627c5a

Please sign in to comment.