Class: DirectoryFinder
- Inherits:
-
Object
- Object
- DirectoryFinder
- Defined in:
- lib/directory_finder.rb
Instance Method Summary collapse
- #complete ⇒ Object
- #find(files) ⇒ Object
-
#initialize(file, filter) ⇒ DirectoryFinder
constructor
A new instance of DirectoryFinder.
Constructor Details
#initialize(file, filter) ⇒ DirectoryFinder
Returns a new instance of DirectoryFinder.
3 4 5 6 |
# File 'lib/directory_finder.rb', line 3 def initialize(file, filter) @file = file @filter = filter end |
Instance Method Details
#complete ⇒ Object
19 20 |
# File 'lib/directory_finder.rb', line 19 def complete end |
#find(files) ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/directory_finder.rb', line 8 def find(files) dirs = [] files.each do |file_name| dir = @file.dirname file_name dirs << dir if @filter.filter(File.basename(dir)) end return dirs end |