Module Picnic::Postambles
In: lib/picnic/postambles.rb

In Camping, "postambles" are wrappers used to make your application run under some given web server. They are called "postambles" because traditionally this was a piece of code included at the bottom of your Camping script. Picnic provides postambles for two popular Ruby-based web servers: webrick and mongrel. These postambles take care of all the complications of launching and managing the web server for you.

Methods

cgi   fastcgi   mongrel   webrick  

Public Instance methods

Theoretically this should launch your Picnic app as a CGI process. I say "theoretically" because this has never actually been tested.

Theoretically this should launch your Picnic app as a FastCGI process. I say "theoretically" because this has never actually been tested.

Launches your Camping application using a mongrel server.

Mongrel is much faster than webrick, but has two limitations:

  1. You must install the mongrel gem before you can run your server using mongrel. This is not necessary with webrick, since webrick is included by default with Ruby.
  2. Unlike webrick, mongrel can‘t be run using SSL. You will have to use a reverse proxy like Pound or Apache if you want to use mongrel with SSL.

If $DAEMONIZE is true, the mongrel server will be forked to a background process. Note that this may have some strange effects, since any open IOs or threads will not be carried over to the forked daemon process.

Module#start_picnic automatically calls this method to launch your Picnic app if your app‘s :server configuration option is set to mongrel.

Usage example:

  require 'picnic/postambles'
  self.extend self::Postambles
  mongrel

Launches your Camping application using a webrick server.

It is possible to run using SSL by providing an :ssl_cert path in your app‘s configuration file, pointing to a valid SSL certificate file.

If $DAEMONIZE is true, the webrick server will be forked to a background process. Note that this may have some strange effects, since any open IOs or threads will not be carried over to the forked daemon process.

Module#start_picnic automatically calls this method to launch your Picnic app if your app‘s :server configuration option is set to webrick.

Usage example:

  require 'picnic/postambles'
  self.extend self::Postambles
  webrick

[Validate]