Class: Merb::BootLoader::Router
- Inherits:
-
Merb::BootLoader
- Object
- Merb::BootLoader
- Merb::BootLoader::Router
- 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
-
.router_file ⇒ Object
Tries to find the router file.
-
.run ⇒ Object
load the router file.
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_file ⇒ Object
Tries to find the router file.
Returns
- String
-
The path to the router file if it exists, nil otherwise.
:api: private
1074 1075 1076 1077 1078 1079 1080 |
# File 'lib/merb-core/bootloader.rb', line 1074 def router_file @router_file ||= begin if File.file?(router = Merb.dir_for(:router) / Merb.glob_for(:router)) router end end end |
.run ⇒ Object
load the router file
Returns
nil
:api: plugin
1062 1063 1064 1065 1066 |
# File 'lib/merb-core/bootloader.rb', line 1062 def run Merb::BootLoader::LoadClasses.load_file(router_file) if router_file nil end |