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



1049
1050
1051
1052
1053
1054
1055
# File 'lib/merb-core/bootloader.rb', line 1049

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



1037
1038
1039
1040
1041
# File 'lib/merb-core/bootloader.rb', line 1037

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

  nil
end