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
  def root?(dir=nil)
    pth = File.expand_path(dir||Dir.pwd)
    return true if pth == '/'
    return true if pth =~ /^(\w:)?\/$/
    false
  end

[Validate]