class Mongrel::Configurator

Implements a simple DSL for configuring a Mongrel server for your purposes. More used by framework implementers to setup Mongrel how they like, but could be used by regular folks to add more things to an existing mongrel configuration.

It is used like this:

require 'mongrel'
config = Mongrel::Configurator.new :host => "127.0.0.1" do
  listener :port => 3000 do
    uri "/app", :handler => Mongrel::DirHandler.new(".", load_mime_map("mime.yaml"))
  end
  run
end

This will setup a simple DirHandler at the current directory and load additional mime types from mimy.yaml. The :host => “127.0.0.1” is actually not specific to the servers but just a hash of default parameters that all server or uri calls receive.

When you are inside the block after Mongrel::Configurator.new you can simply call functions that are part of Configurator (like server, uri, daemonize, etc) without having to refer to anything else. You can also call these functions on the resulting object directly for additional configuration.

A major thing about Configurator is that it actually lets you configure multiple listeners for any hosts and ports you want. These are kept in a map config.listeners so you can get to them.