Class: Merb::BootLoader::Router

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

Overview

Loads the router file. This needs to happen after everything else is loaded while merb is starting up to ensure the router has everything it needs to run.

Class Method Summary collapse

Methods inherited from Merb::BootLoader

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

Class Method Details

.router_fileObject

Tries to find the router file.

Returns

String

The path to the router file if it exists, nil otherwise.



975
976
977
978
979
980
981
# File 'lib/merb-core/bootloader.rb', line 975

def router_file
  @router_file ||= begin
    if File.file?(router = Merb.dir_for(:router) / Merb.glob_for(:router))
      router
    end
  end
end

.runObject

load the router file

Returns

nil



965
966
967
968
969
# File 'lib/merb-core/bootloader.rb', line 965

def run
  Merb::BootLoader::LoadClasses.load_file(router_file) if router_file
  
  nil
end