module Sprockets::Resolve

def resolve_main_under_path(load_path, logical_name, mime_exts)

Returns Array. First element is an Array of hashes or empty, second is a String

mime type that is included in `mime_exts` on the `load_path`.
Finds files that match a given `logical_name` with an acceptable

e.g. {".xml.builder"=>"application/xml+builder"}
mime_exts - Hash of file extensions and their mime types
e.g. "application" or "coffee/foo"
logical_name - String. A filename without extension
load_path - String. An absolute path to a directory

Internal: Finds candidate files on a given path
def resolve_main_under_path(load_path, logical_name, mime_exts)
  dirname    = File.dirname(File.join(load_path, logical_name))
  candidates = self.find_matching_path_for_extensions(dirname, File.basename(logical_name), mime_exts)
  candidates.map! do |c|
    { filename: c[0], type: c[1] }
  end
  return candidates, [ URIUtils.build_file_digest_uri(dirname) ]
end