Module: Waitress

Defined in:
lib/waitress.rb,
lib/waitress/chef.rb,
lib/waitress/vhost.rb,
lib/waitress/server.rb,
lib/waitress/request.rb,
lib/waitress/version.rb,
lib/waitress/evalbind.rb,
lib/waitress/response.rb,
lib/waitress/configure.rb,
lib/waitress/util/util.rb,
lib/waitress/parse/query.rb,
lib/waitress/handlers/handler.rb,
lib/waitress/util/less_watcher.rb,
lib/waitress/handlers/dirhandler.rb,
lib/waitress/handlers/handler404.rb,
lib/waitress/handlers/handler500.rb,
lib/waitress/handlers/libhandler.rb,
lib/waitress/restful/restbuilder.rb,
ext/waitress_http11/http11.c

Overview

The Base module for the Waitress Web Server, containing all the required classes and utilities created by Waitress

Defined Under Namespace

Classes: Chef, Configuration, Configure, DirHandler, ErrorHandler, EvalBindings, Handler, Handler404, Handler500, HttpParser, HttpParserError, HttpServer, LESSWatcher, Launcher, LibraryHandler, QueryParser, REST, Request, Response, Util, Vhost

Constant Summary collapse

VERSION =
"0.5.0"

Class Method Summary collapse

Class Method Details

.configure!(*args, &block) ⇒ Object

Create a configuration for a single Waitress Server instance. This should be called from the config.rb file and nowhere else. Params:

args

The arguments to configure with. This should be a variable amount of arguments

representing what ports to run the server on. If no args are provided, port 80 will be used as a default

block

The block to call once the configuration has been created. Setup should be

done in here



50
51
52
# File 'lib/waitress.rb', line 50

def self.configure! *args, &block
  Waitress::Configure.configure! *args, &block
end

.new(*args) ⇒ Object

Create a new Launch Instance, used to serve a simple Waitress Server from either the filesystem, or embedded.



56
57
58
# File 'lib/waitress.rb', line 56

def self.new *args
  Waitress::Launcher.new *args
end

.serve!(filesystem = false, rootdir = :default) ⇒ Object

Create a new Waitress Server, or, in case of the Filesystem, create a Configuration for a set of Servers Params:

filesystem

True if waitress should be loaded from the Filesystem. Default: false

rootdir

The root directory to load waitress from, defaults to ~/.waitress



37
38
39
40
# File 'lib/waitress.rb', line 37

def self.serve! filesystem=false, rootdir=:default
  waitress = Waitress.new
  waitress.serve! filesystem, rootdir
end