module FileTest module_function # Is this the root directory? def root?(dir=nil) pth = File.expand_path(dir||work) return true if pth == '/' return true if pth =~ /^(\w:)?\/$/ false end end