module YARD::Server::Commands::StaticFileHelpers

def find_file(adapter, url)

def find_file(adapter, url)
  # this const was defined in StaticFileCommand originally
  static_paths = StaticFileCommand::STATIC_PATHS
  file = nil
  ([adapter.document_root] + static_paths.reverse).compact.each do |path_prefix|
    file = File.join(path_prefix, url)
    break if File.exist?(file)
    file = nil
  end
  # Search in default/fulldoc/html template if nothing in static asset paths
  assets_template = Templates::Engine.template(:default, :fulldoc, :html)
  file || assets_template.find_file(url)
end