Sha256: 1e6f1dab9c7097920d90d2bb5ed45b24b4914d6e93e0a981e1b281f4a03d5271

Contents?: true

Size: 272 Bytes

Versions: 20

Compression:

Stored size: 272 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

20 entries across 19 versions & 2 rubygems

Version Path
facets-glimmer-3.2.0 lib/core/facets/filetest/root.rb
facets-3.1.0 lib/core/facets/filetest/root.rb
facets-3.0.0 lib/core/facets/filetest/root.rb
facets-2.9.3 lib/core/facets/filetest/root.rb
facets-2.9.2 src/core/facets/filetest/root.rb
facets-2.9.2 lib/core/facets/filetest/root.rb
facets-2.9.1 lib/core/facets/filetest/root.rb
facets-2.9.0 lib/core/facets/filetest/root.rb
facets-2.9.0.pre.2 lib/core/facets/filetest/root.rb
facets-2.9.0.pre.1 lib/core/facets/filetest/root.rb
facets-2.8.4 lib/core/facets/filetest/root.rb
facets-2.8.3 lib/core/facets/filetest/root.rb
facets-2.8.2 lib/core/facets/filetest/root.rb
facets-2.8.1 lib/core/facets/filetest/root.rb
facets-2.8.0 lib/core/facets/filetest/root.rb
facets-2.7.0 lib/core/facets/filetest/root.rb
facets-2.6.0 lib/core/facets/filetest/root.rb
facets-2.5.1 lib/core/facets/filetest/root.rb
facets-2.5.0 lib/core/facets/filetest/root.rb
facets-2.5.2 lib/core/facets/filetest/root.rb