Module: Sinatra::MoreServer

Defined in:
lib/sinatra/more_server.rb,
lib/sinatra/more_server/unicorn.rb,
lib/sinatra/more_server/zbatery.rb,
lib/sinatra/more_server/rainbows.rb

Overview

Adds more servers to Sinatra::Base#run! (currently unicorn and rainbows).

Defined Under Namespace

Modules: Rainbows, Unicorn

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.registered(klass) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/sinatra/more_server.rb', line 10

def self.registered(klass)
  ::Rack::Handler.register "unicorn",  "::Sinatra::MoreServer::Unicorn"
  ::Rack::Handler.register "rainbows", "::Sinatra::MoreServer::Rainbows"
  ::Rack::Handler.register "zbatery",  "::Sinatra::MoreServer::Zbatery"
  ::Rack::Handler.register "ebb",      "::Rack::Handler::Ebb"
  ::Rack::Handler.autoload :Ebb,       "ebb"
  klass.server += ["ebb", "zbatery", "rainbows", "unicorn"]
  klass.set :async_server, ["thin", "ebb", "zbatery", "rainbows"]
end

Instance Method Details

#has_async_callback!Object



20
21
22
23
# File 'lib/sinatra/more_server.rb', line 20

def has_async_callback!
  @has_async_callback = true
  set :server, async_server
end

#has_async_callback?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/sinatra/more_server.rb', line 25

def has_async_callback?
  !!@has_async_callback
end