Methods

Class Index [+]

Quicksearch

Merb::BootLoader::RackUpApplication

Public Class Methods

run() click to toggle source

Setup the Merb Rack App or read a rackup file located at Merb::Config[:rackup] with the same syntax as the rackup tool that comes with rack. Automatically evals the file in the context of a Rack::Builder.new { } block. Allows for mounting additional apps or middleware.

Returns

nil

:api: plugin

      # File lib/merb-core/bootloader.rb, line 1322
1322:   def self.run
1323:     require 'rack'
1324:     if File.exists?(Merb.dir_for(:config) / "rack.rb")
1325:       Merb::Config[:rackup] ||= Merb.dir_for(:config) / "rack.rb"
1326:     end
1327: 
1328:     if Merb::Config[:rackup]
1329:       rackup_code = File.read(Merb::Config[:rackup])
1330:       Merb::Config[:app] = eval("::Rack::Builder.new {( #{rackup_code}\n )}.to_app", TOPLEVEL_BINDING, Merb::Config[:rackup])
1331:     else
1332:       Merb::Config[:app] = ::Rack::Builder.new {
1333:          use Merb::Rack::Head # handle head requests
1334:          use Merb::Rack::ContentLength # report content length
1335:          if prefix = ::Merb::Config[:path_prefix]
1336:            use Merb::Rack::PathPrefix, prefix
1337:          end
1338:          use Merb::Rack::Static, Merb.dir_for(:public)
1339:          run Merb::Rack::Application.new
1340:        }.to_app
1341:     end
1342: 
1343:     nil
1344:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.