def search_files(directories, extensions)
      extensions.each_with_object([]) do |ext, obj|
        directories.each do |dir|
          obj << FileList["#{dir}/*#{ext}"]
        end
      end.flatten.compact
    end
def search_files(directories, extensions)
      extensions.each_with_object([]) do |ext, obj|
        directories.each do |dir|
          obj << FileList["#{dir}/*#{ext}"]
        end
      end.flatten.compact
    end
Search files recursively in directory with given extensions

 @param [Array]  directories   Array of directories to search
 @param [Array]  extensions    Array of file extensions to use for search

 @return [Array]   list of all found files