Module FileTest
In: lib/core/facets/filetest/safe.rb
lib/core/facets/filetest/contains.rb
lib/core/facets/filetest/relative.rb
lib/core/facets/filetest/root.rb
lib/core/facets/filetest/separator_pattern.rb

Methods

Constants

SEPARATOR_PATTERN = ( if File::ALT_SEPARATOR  

Public Instance methods

Predicate method for testing whether a path is absolute. It returns true if the pathname begins with a slash.

List File.split, but preserves the file separators.

  FileTest.chop_basename('/usr/lib') #=> ['/usr/', 'lib']
  FileTest.chop_basename('/') #=> nil

Returns Array of `[pre-basename, basename]` or `nil`.

This method is here simply to support the relative? and absolute? methods.

Does the parent contain the child?

The opposite of absolute?

Is the specified directory the root directory?

CREDIT: Jeffrey Schwab

Is a path considered reasonably "safe"?

Do not mistake this for a perfect solution!

[Validate]