Method: DataPaths::Finders#each_data_file

Defined in:
lib/data_paths/finders.rb

#each_data_file(path) {|data_file| ... } ⇒ Enumerator

Finds all occurrences of a given file path, within all data directories.

Parameters:

  • path (String)

    The file path to search for.

Yields:

  • (data_file)

    If a block is given, it will be passed every found path.

Yield Parameters:

  • data_file (String)

    The path of a file within a data directory.

Returns:

  • (Enumerator)

    If no block is given, an Enumerator object will be returned.



126
127
128
129
130
131
132
# File 'lib/data_paths/finders.rb', line 126

def each_data_file(path)
  return enum_for(:each_data_file,path) unless block_given?

  each_data_path(path) do |full_path|
    yield(full_path) if File.file?(full_path)
  end
end