123456789_123456789_123456789_123456789_123456789_

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

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: YARD::Server::Commands::LibraryCommand
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

::YARD::Server::HTTPUtils - Included

DefaultMimeTypes, ESCAPED, NONASCII, UNESCAPED, UNESCAPED_FORM, UNESCAPED_PCHAR

Class Method Summary

LibraryCommand - Inherited

Base - Inherited

.new

Creates a new command object, setting attributes named by keys in the options hash.

Instance Attribute Summary

StaticFileHelpers - Included

#favicon?

Serves an empty favicon.

#static_template_file?

Attempts to route a path to a static template file.

LibraryCommand - Inherited

Base - Inherited

Instance Method Summary

StaticFileHelpers - Included

::YARD::Server::HTTPUtils - Included

#_escape, #_make_regex, #_make_regex!, #_unescape,
#dequote

Removes quotes and escapes from str.

#escape

Escapes HTTP reserved and unwise characters in str

#escape8bit

Escapes 8 bit characters in str

#escape_form

Escapes form reserved characters in str

#escape_path

Escapes path str

#load_mime_types

Loads Apache-compatible mime.types in file.

#mime_type

Returns the mime type of filename from the list in mime_tab.

#normalize_path

Normalizes a request path.

#parse_form_data

Parses form data in io with the given boundary.

#parse_header

Parses an HTTP header raw into a hash of header fields with an ::Array of values.

#parse_query

Parses the query component of a URI in str.

#parse_qvalues

Parses q values in value as used in Accept headers.

#parse_range_header

Parses a Range header value ranges_specifier.

#quote

Quotes and escapes quotes in str.

#split_header_value

Splits a header value str according to HTTP specification.

#unescape

Unescapes HTTP reserved and unwise characters in str

#unescape_form

Unescapes form reserved characters in str

LibraryCommand - Inherited

#call, #call_with_fork, #call_without_fork,
#fulldoc_template

Hack to load a custom fulldoc template object that does not do any rendering/generation.

#load_yardoc, #not_prepared, #restore_template_info, #save_default_template_info, #setup_library, #setup_yardopts

Base - Inherited

#call

The main method called by a router with a request object.

#run

Subclass this method to implement a custom command.

#add_cache_control

Add a conservative cache control policy to reduce load on requests served with "?1234567890" style timestamp query strings.

Constructor Details

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

Instance Method Details

#run

Since:

  • 0.6.0

[ GitHub ]

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

def run
  static_template_file? || not_found
end