Module: Ackr::Finder

Defined in:
lib/ackr/finder.rb

Overview

All ‘find a file’ relatives.

Class Method Summary collapse

Class Method Details

.all_filesObject

Public: Get all files to look for.

Files of interest are those who are

+ not directory
+ not binary
+ not hidden

Returns an Enumerator of String filename.



16
17
18
19
20
21
22
23
24
25
# File 'lib/ackr/finder.rb', line 16

def self.all_files
  Dir.glob('**/*').each do |file|
    next if (File.directory?(file) || Ackr::binary?(file))
    next if EXCLUDE_DIRS.any? do |dir|
      file.start_with?(dir + File::Separator) || 
        file.include?(File::Separator + dir + File::Separator)
    end
    yield(file)
  end
end