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

Version Path
facets-2.4.0 lib/facets/filetest/root.rb
facets-2.4.1 lib/facets/filetest/root.rb
facets-2.4.2 lib/core/facets/filetest/root.rb
facets-2.4.4 lib/core/facets/filetest/root.rb
facets-2.4.3 lib/core/facets/filetest/root.rb
facets-2.4.5 lib/core/facets/filetest/root.rb
mack-facets-0.8.2 lib/gems/facets-2.4.5/lib/core/facets/filetest/root.rb