Method: DataPaths::Finders#find_data_file

Defined in:
lib/data_paths/finders.rb

#find_data_file(path) ⇒ String?

Searches for a file at the given path, within any data directory.

Parameters:

  • path (String)

    The file path to search for.

Returns:

  • (String, nil)

    Returns the first valid file at the given path within a data directory. Returns nil if the given path could not be found in any data directory.



60
61
62
# File 'lib/data_paths/finders.rb', line 60

def find_data_file(path)
  each_data_path(path).find { |full_path| File.file?(full_path) }
end