Class: Referral::ExpandsDirectories

Inherits:
Object
  • Object
show all
Defined in:
lib/referral/expands_directories.rb

Instance Method Summary collapse

Instance Method Details

#call(files_and_directories) ⇒ Object



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

def call(files_and_directories)
  files_and_directories.flat_map { |f_or_d|
    if File.directory?(f_or_d)
      Dir["#{f_or_d}/**/*.rb"]
    else
      f_or_d
    end
  }
end