Methods

FileTest

Public Instance Methods

root?(dir=nil) click to toggle source

Is the specified directory the root directory?

CREDIT: Jeffrey Schwab

    # 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

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.