Class: Merb::BootLoader::RackUpApplication

Inherits:
Merb::BootLoader show all
Defined in:
lib/merb-core/bootloader.rb

Class Method Summary collapse

Methods inherited from Merb::BootLoader

after, after_app_loads, before, before_app_loads, default_framework, inherited, move_klass

Class Method Details

.runObject

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



550
551
552
553
554
555
556
# File 'lib/merb-core/bootloader.rb', line 550

def self.run
  if File.exists?(Merb.dir_for(:config) / "rack.rb")
    Merb::Config[:app] =  eval("::Rack::Builder.new {( #{IO.read(Merb.dir_for(:config) / 'rack.rb')}\n )}.to_app", TOPLEVEL_BINDING, __FILE__, __LINE__)
  else
    Merb::Config[:app] = ::Merb::Rack::Application.new
  end
end