Module: FileTest
- Defined in:
- lib/core/facets/filetest/root.rb
Class Method Summary collapse
-
.root?(dir = nil) ⇒ Boolean
Is the specified directory the root directory?.
Class Method Details
.root?(dir = nil) ⇒ Boolean
Is the specified directory the root directory?
CREDIT: Jeffrey Schwab
9 10 11 12 13 14 |
# File 'lib/core/facets/filetest/root.rb', line 9 def root?(dir=nil) pth = File.(dir||Dir.pwd) return true if pth == '/' return true if pth =~ /^(\w:)?\/$/ false end |