Class: Merb::Rack::Mongrel

Inherits:
Object show all
Defined in:
lib/merb-core/rack/adapter/mongrel.rb

Direct Known Subclasses

EventedMongrel, SwiftipliedMongrel

Class Method Summary collapse

Class Method Details

.start(opts = {}) ⇒ Object

Parameters

opts<Hash>

Options for Mongrel (see below).

Options (opts)

:host<String>

The hostname that Mongrel should serve.

:port<Fixnum>

The port Mongrel should bind to.

:app<String>>

The application name.



17
18
19
20
21
22
23
# File 'lib/merb-core/rack/adapter/mongrel.rb', line 17

def self.start(opts={})
  Merb.logger.warn!("Using Mongrel adapter")
  server = ::Mongrel::HttpServer.new(opts[:host], opts[:port].to_i)
  Merb::Server.change_privilege
  server.register('/', ::Merb::Rack::Handler::Mongrel.new(opts[:app]))
  server.run.join
end