Class: Waves::Rackup

Inherits:
Object show all
Includes:
Runtime
Defined in:
lib/waves/runtime/rackup.rb

Overview

Runtime to use with Rackup specifically.

The actual Rack application is built using ‘config.application` (see runtime/configuration.rb), not in the .ru file. Rackup expects to be used in the context of an already-running server. See the documentation for your webserver and Rack for details.

Your config.ru file should minimally look something like this:

require "waves"
require "waves/runtime/rackup"

run Waves::Rackup.load

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Runtime

#config, #debug?, #load, #logger, #mode, #reload, #synchronize, #synchronize?

Constructor Details

#initialize(options = {}) ⇒ Rackup

Returns a new instance of Rackup.



29
30
31
32
# File 'lib/waves/runtime/rackup.rb', line 29

def initialize( options = {} )
  @options = options
  load # load runtime
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



19
20
21
# File 'lib/waves/runtime/rackup.rb', line 19

def options
  @options
end

Class Method Details

.load(options = {}) ⇒ Object

Load the runtime and return an application.



24
25
26
27
# File 'lib/waves/runtime/rackup.rb', line 24

def self.load(options = {})
  new( options )
  config.application.to_app
end