lib/core/facets/filetest/root.rb in facets-2.1.3 vs lib/core/facets/filetest/root.rb in facets-2.2.0
- old
+ new
@@ -1,13 +1,14 @@
-
module FileTest
module_function
- # Is this the root directory?
+ # Is the specified directory the root directory?
+ #
+ # CREDIT: Jeffrey Schwab
def root?(dir=nil)
- pth = File.expand_path(dir||work)
+ pth = File.expand_path(dir||Dir.pwd)
return true if pth == '/'
return true if pth =~ /^(\w:)?\/$/
false
end