123456789_123456789_123456789_123456789_123456789_

Class: YARD::Server::Commands::RootRequestCommand

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Base
Instance Chain:
Inherits: YARD::Server::Commands::Base
Defined in: lib/yard/server/commands/root_request_command.rb

Overview

Serves requests from the root of the server

Since:

  • 0.6.0

Constant Summary

::YARD::Server::HTTPUtils - Included

DefaultMimeTypes, ESCAPED, NONASCII, UNESCAPED, UNESCAPED_FORM, UNESCAPED_PCHAR

Class Method Summary

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.

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

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::Base

Instance Method Details

#run

Since:

  • 0.6.0

[ GitHub ]

  
# File 'lib/yard/server/commands/root_request_command.rb', line 9

def run
  static_template_file? || favicon? || not_found
end