]> gitweb.michael.orlitzky.com - mailshears.git/blob - lib/mailshears/filesystem.rb
473a1ed16a46032a1c4c6f37be56a8bd81f6a9e3
[mailshears.git] / lib / mailshears / filesystem.rb
1 class Filesystem
2
3 def self.begins_with_dot(path)
4 return (path[0..0] == '.')
5 end
6
7 def self.get_subdirs(dir)
8 subdirs = []
9
10 Dir.open(dir) do |d|
11 d.each do |entry|
12 relative_path = File.join(dir, entry)
13 if (File.directory?(relative_path) and not begins_with_dot(entry))
14 subdirs << entry
15 end
16 end
17 end
18
19 return subdirs
20 end
21
22 end