Module: Rake::Path

Defined in:
lib/rake/path.rb

Class Method Summary collapse

Class Method Details

.find_files(paths, extension) ⇒ Object


3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/rake/path.rb', line 3

def self.find_files(paths, extension)
  files = paths.reduce([]) do |memo, path|
    case
    when File.file?(path)
      files = FileList[path]
    when path.match(/[\*\?]/)
      files = FileList[path]
    else
      files = FileList[path + '/*.' + extension]
    end
    memo + files
  end
end