module Sprockets::Resolve

def path_matches(load_path, logical_name, logical_basename)

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