Method: Path#clean
- Defined in:
- lib/path/implementation.rb
#clean(consider_symlink = false) ⇒ Object Also known as: cleanpath
Returns a cleaned version of self with consecutive slashes and useless dots removed. The filesystem is not accessed.
If consider_symlink is true, then a more conservative algorithm is used to avoid breaking symbolic linkages. This may retain more .. entries than absolutely necessary, but without accessing the filesystem, this can’t be avoided. See #realpath.
18 19 20 |
# File 'lib/path/implementation.rb', line 18 def clean(consider_symlink = false) consider_symlink ? cleanpath_conservative : cleanpath_aggressive end |