module Sprockets::Resolve
def path_matches(load_path, logical_name, logical_basename)
def path_matches(load_path, logical_name, logical_basename) dirname = File.dirname(File.join(load_path, logical_name)) candidates = dirname_matches(dirname, logical_basename) deps = file_digest_dependency_set(dirname) result = resolve_alternates(load_path, logical_name) result[0].each do |fn| candidates << [fn, parse_path_extnames(fn)[1]] end deps.merge(result[1]) dirname = File.join(load_path, logical_name) if directory? dirname result = dirname_matches(dirname, "index") candidates.concat(result) end deps.merge(file_digest_dependency_set(dirname)) return candidates.select { |fn, _| file?(fn) }, deps end