Class: Merb::BootLoader::Router

Inherits:
Merb::BootLoader show all
Defined in:
merb-core/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_fileString?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Tries to find the router file.

Returns:

  • (String, nil)

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



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

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

.runnil

Load the router file.

Returns:

  • (nil)


1024
1025
1026
1027
1028
# File 'merb-core/lib/merb-core/bootloader.rb', line 1024

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

  nil
end