Module FileTest
In: lib/core/facets/filetest/root.rb

Methods

root?  

Public Instance methods

Is the specified directory the root directory?

CREDIT: Jeffrey Schwab

[Source]

    # File lib/core/facets/filetest/root.rb, line 9
 9:   def root?(dir=nil)
10:     pth = File.expand_path(dir||Dir.pwd)
11:     return true if pth == '/'
12:     return true if pth =~ /^(\w:)?\/$/
13:     false
14:   end

[Validate]