landline/LAYOUT.md

3.3 KiB

Internal structure of Landline lib

Note: If you want to start hacking on Landline and extending it, follow this layout as closely as possible.

Core classes

These are core classes of Landline and they are loaded as soon as the library is loaded.

  • Landline::Path [path.rb]
  • Landline::PathContext [path.rb]
  • Landline::Probe [probe.rb]
  • Landline::ProbeContext [probe.rb]
  • Landline::Node (parent of Path and Probe) [node.rb]
  • Landline::Server (Rack application interface) [server.rb]
  • Landline::ServerContext [server.rb]
  • Landline::Request (Rack request wrapper) [request.rb]
  • Landline::Response (Rack response wrapper) [response.rb]
  • Landline::Pattern [pattern_matching.rb]
  • Landline::TemplateContext [tempalte.rb]
  • Landline::Template (template engine interface) [template.rb]

Patterns

These are classes that Landline::Pattern can interface with to create Patterns.

  • Landline::PatternMatching::ReMatch [pattern_matching/rematch.rb]
  • Landline::PatternMatching::Glob [pattern_matching/glob.rb]

DSL Method mixins

These are module mixins that add common methods to DSL bindings.

  • Landline::DSL::PathConstructors [dsl/constructors_path.rb]
  • Landline::DSL::ProbeConstructures [dsl/constructors_probe.rb]
  • Landline::DSL::CommonMethods [dsl/methods_common.rb]
  • Landline::DSL::PathMethods [dsl/methods_path.rb]
  • Landline::DSL::ProbeMethods [dsl/methods_probe.rb]
  • Landline::DSL::TemplateMethods [dsl/methods_template.rb]

Utilities

These are self-contained classes and methods that add extra functionality to Landline.

  • Landline::Util::Lookup [util/lookup.rb]
  • Landline::PatternMatching [pattern_matching/util.rb]
  • Landline::Cookie (class) [util/cookie.rb]
  • Landline::Error (class) [util/errors.rb]
  • Landline::ParsingError (class) [util/errors.rb]
  • Landline::Util (html/http utilities) [util/html.rb]
  • Landline::MIME (MIME extension to type association) [util/mime.rb]
  • Landline::Util::ParserSorting (functions for sorting form/query hashes) [util/parsesorting.rb]
  • Landline::Util::Query (query class) [util/query.rb]
  • Landline::Util::FormPart (formparser struct) [util/multipart.rb]
  • Landline::Util::MultipartParser (multipart form parser) [util/multipart.rb]
  • Landline::Util::HeaderRegexp (helper regexps for headers) [util/parseutils.rb]
  • Landline::Util (parser methods) [util/parseutils.rb]

Probe subclasses

These are reactive request handlers with their own semantics, if needed.

  • Landline::Handlers::Handler [probe/handler.rb]
  • Landline::Handlers::GETHandler [probe/http_method.rb]
  • Landline::Handlers::POSTHandler [probe/http_method.rb]
  • Landline::Handlers::HEADHandler [probe/http_method.rb]
  • Landline::Handlers::PUTHandler [probe/http_method.rb]
  • Landline::Handlers::DELETEHandler [probe/http_method.rb]
  • Landline::Handlers::CONNECTHandler [probe/http_method.rb]
  • Landline::Handlers::OPTIONSHandler [probe/http_method.rb]
  • Landline::Handlers::TRACEHandler [probe/http_method.rb]
  • Landline::Handlers::PATCHHandler [probe/http_method.rb]
  • Landline::Handlers::Serve

Path subclasses

These are navigation handlers with their own semantics.

(currently none)

Template engine interfaces

These are uniform interfaces for various templating engines.

  • Landline::Templates::ERB [template/erb.rb]
  • Landline::Templates::Erubi [template/erubi.rb]