Module: Watchr::Paths

Defined in:
lib/watchr/paths.rb

Class Method Summary collapse

Class Method Details

.files_by_dirs(extensions, *dirs) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/watchr/paths.rb', line 3

def self.files_by_dirs(extensions, *dirs)
  dirs.flatten.map { |dir|
    if File.directory?(dir) then
      Dir[File.join(dir, '**', "*.{#{extensions.join(',')}}")]
    else
      dir
    end
  }.flatten.sort
end