Class: Ramaze::Adapter::WEBrick

Inherits:
Base show all
Defined in:
lib/ramaze/adapter/webrick.rb

Overview

Our WEBrick adapter acts as wrapper for the Rack::Handler::WEBrick.

Constant Summary collapse

OPTIONS =
{
  :Logger      => Log,
  :AccessLog   => [
    [Log, ::WEBrick::AccessLog::COMMON_LOG_FORMAT],
    [Log, ::WEBrick::AccessLog::REFERER_LOG_FORMAT]
  ]
}

Class Method Summary collapse

Methods inherited from Base

before_call, call, join, respond, shutdown, start

Class Method Details

.startup(host, port) ⇒ Object



19
20
21
22
23
24
# File 'lib/ramaze/adapter/webrick.rb', line 19

def self.startup(host, port)
  options = OPTIONS.merge(:BindAddress => host, :Port => port)
  @server = ::WEBrick::HTTPServer.new(options)
  @server.mount('/', ::Rack::Handler::WEBrick, self)
  Thread.new{ @server.start }
end