Serves static content when no other router matches a request
Defines the paths used to search for static assets. To define an extra path, use {YARD::Server.register_static_path} rather than modifying this constant directly. Also note that files in the document root will always take precedence over these paths.
# File lib/yard/server/commands/static_file_command.rb, line 21 def run path = File.cleanpath(request.path).gsub(%{^(../)+}, '') ([adapter.document_root] + STATIC_PATHS.reverse).compact.each do |path_prefix| file = File.join(path_prefix, path) if File.exist?(file) ext = "." + (request.path[/\.(\w+)$/, 1] || "html") headers['Content-Type'] = mime_type(ext, DefaultMimeTypes) self.body = File.read(file) return end end favicon? self.status = 404 end
Generated with the Darkfish Rdoc Generator 2.