Sha256: d9df5444c20a5b78a5ff5c8c4068f5ddc899ac5740f5d39201b5bad5fefd61ce
Contents?: true
Size: 273 Bytes
Versions: 7
Compression:
Stored size: 273 Bytes
Contents
module FileTest module_function # Is the specified directory the root directory? # # CREDIT: Jeffrey Schwab def root?(dir=nil) pth = File.expand_path(dir||Dir.pwd) return true if pth == '/' return true if pth =~ /^(\w:)?\/$/ false end end
Version data entries
7 entries across 7 versions & 2 rubygems