]> gitweb.michael.orlitzky.com - mailshears.git/blobdiff - lib/common/filesystem.rb
Document everything with YARD and fix some bugs along the way.
[mailshears.git] / lib / common / filesystem.rb
index b44e52ce3979506a82155a9db9ac658257c6b19a..0c80b59e55f98488a118faf5251e8b1a372af551 100644 (file)
@@ -1,8 +1,8 @@
+# Convenience methods for working with the filesystem. This class
+# only provides static methods, to be used analogously to the File
+# class (for example, <tt>File.directory?</tt>).
+#
 class Filesystem
 class Filesystem
-  # Convenience methods for working with the filesystem. This class
-  # only provides static methods, to be used analogously to the File
-  # class (for example, File.directory?).
-
 
   # Return whether or not the given path begins with a dot (ASCII
   # period).
 
   # Return whether or not the given path begins with a dot (ASCII
   # period).
@@ -26,6 +26,7 @@ class Filesystem
   #
   def self.get_subdirs(dir)
     subdirs = []
   #
   def self.get_subdirs(dir)
     subdirs = []
+    return subdirs if not File.directory?(dir)
 
     Dir.open(dir) do |d|
       d.each do |entry|
 
     Dir.open(dir) do |d|
       d.each do |entry|