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, before_master_shutdown, before_worker_shutdown, 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.

:api: private



1107
1108
1109
1110
1111
1112
1113
# File 'lib/merb-core/bootloader.rb', line 1107

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

:api: plugin



1095
1096
1097
1098
1099
# File 'lib/merb-core/bootloader.rb', line 1095

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

  nil
end