Module: Mongrel::Camping

### Home Classes Methods

### In Files

- lib/mongrel/camping.rb

### Namespace

- CLASS Mongrel::Camping::CampingHandler

### Methods

- ::start

### Files

- CHANGELOG
- COPYING
- LICENSE
- README
- Makefile

### Class/Module Index

Quicksearch

- Mongrel
- Mongrel::CGIWrapper
- Mongrel::Camping
- Mongrel::Camping::CampingHandler
- Mongrel::Command
- Mongrel::Command::Base
- Mongrel::Command::Registry
- Mongrel::Configurator
- Mongrel::Const
- Mongrel::DeflateFilter
- Mongrel::DirHandler
- Mongrel::Error404Handler
- Mongrel::Gems
- Mongrel::HeaderOut
- Mongrel::HttpHandler
- Mongrel::HttpHandlerPlugin
- Mongrel::HttpParams
- Mongrel::HttpParser
- Mongrel::HttpParserError
- Mongrel::HttpRequest
- Mongrel::HttpResponse
- Mongrel::HttpServer
- Mongrel::Rails
- Mongrel::Rails::RailsConfigurator
- Mongrel::Rails::RailsHandler
- Mongrel::RedirectHandler
- Mongrel::StatisticsFilter
- Mongrel::Stats
- Mongrel::StatusHandler
- Mongrel::StopServer
- Mongrel::TimeoutError
- Mongrel::URIClassifier
- Mongrel::URIClassifier::RegistrationError
- Mongrel::URIClassifier::UsageError
- RequestLog
- RequestLog::Access
- RequestLog::Files
- RequestLog::Objects
- RequestLog::Params
- RequestLog::Threads
- IO
- Kernel
- MongrelDbg
- TCPServer

No matching classes.

# Mongrel::Camping

Support for the Camping micro framework at camping.rubyforge.org This implements the unusually long Postamble that Camping usually needs and shrinks it down to just a single line or two.

Your Postamble would now be:

    Mongrel::Camping::start("0.0.0.0",3001,"/tepee",Tepee).join

If you wish to get fancier than this then you can use the Camping::CampingHandler directly instead and do your own wiring:

    h = Mongrel::HttpServer.new(server, port)
    h.register(uri, CampingHandler.new(Tepee))
    h.register("/favicon.ico", Mongrel::Error404Handler.new(""))

I add the /favicon.ico since camping apps typically don't have them and it's just annoying anyway.

### Public Class Methods

start(server, port, uri, klass) click to toggle source

This is a convenience method that wires up a CampingHandler for your application on a given port and uri. It's pretty much all you need for a camping application to work right.

It returns the Mongrel::HttpServer which you should either join or somehow manage. The thread is running when returned.

    # File lib/mongrel/camping.rb, line 99
    def Camping.start(server, port, uri, klass)
      h = Mongrel::HttpServer.new(server, port)
      h.register(uri, CampingHandler.new(klass))
      h.register("/favicon.ico", Mongrel::Error404Handler.new(""))
      h.run
      return h
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.