Class: YARD::Server::Commands::StaticFileCommand

Inherits:
LibraryCommand show all
Includes:
StaticFileHelpers
Defined in:
lib/yard/server/commands/static_file_command.rb

Overview

Serves static content when no other router matches a request

Since:

  • 0.6.0

Constant Summary collapse

STATIC_PATHS =

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.

Since:

  • 0.6.0

[]

Constants included from HTTPUtils

HTTPUtils::DefaultMimeTypes, HTTPUtils::ESCAPED, HTTPUtils::NONASCII, HTTPUtils::UNESCAPED, HTTPUtils::UNESCAPED_FORM, HTTPUtils::UNESCAPED_PCHAR

Instance Attribute Summary

Attributes inherited from LibraryCommand

#incremental, #library, #options, #serializer, #single_library, #use_fork

Attributes inherited from Base

#adapter, #body, #caching, #command_options, #headers, #path, #request, #status

Instance Method Summary collapse

Methods included from StaticFileHelpers

#favicon?, find_file, #static_template_file?

Methods included from HTTPUtils

_escape, _make_regex, _make_regex!, _unescape, dequote, escape, escape8bit, escape_form, escape_path, load_mime_types, mime_type, normalize_path, parse_form_data, parse_header, parse_query, parse_qvalues, parse_range_header, quote, split_header_value, unescape, unescape_form

Methods inherited from LibraryCommand

#call, #initialize

Methods inherited from Base

#call, #initialize

Constructor Details

This class inherits a constructor from YARD::Server::Commands::LibraryCommand

Instance Method Details

#runObject

Since:

  • 0.6.0



17
18
19
# File 'lib/yard/server/commands/static_file_command.rb', line 17

def run
  static_template_file? || not_found
end