Class | Merb::BootLoader::LoadClasses |
In: |
lib/merb-core/bootloader.rb
|
Parent: | Merb::BootLoader |
Load all classes inside the load paths.
This is used in conjunction with Merb::BootLoader::ReloadClasses to track files that need to be reloaded, and which constants need to be removed in order to reload a file.
This also adds the model, controller, and lib directories to the load path, so they can be required in order to avoid load-order issues.
LOADED_CLASSES | = | {} |
MTIMES | = | {} |
FILES_LOADED | = | {} |
Wait for any children to exit, remove the "main" PID, and exit.
(Does not return.)
:api: private
Load classes from given paths - using path/glob pattern.
*paths<Array>: | Array of paths to load classes from - may contain glob pattern |
nil
:api: private
Loads a file, tracking its modified time and, if necessary, the classes it declared.
file<String>: | The file to load. |
nil
:api: private
Reap any workers of the spawner process and exit with an appropriate status code.
Note that exiting the spawner process with a status code of 128 when a master process exists will cause the spawner process to be recreated, and the app code reloaded.
status<Integer>: | The status code to exit with. Defaults to 0. |
sig<String>: | The signal to send to workers |
(Does not return.)
:api: private
Reloads the classes in the specified file. If fork-based loading is used, this causes the current processes to be killed and and all classes to be reloaded. If class-based loading is not in use, the classes declared in that file are removed and the file is reloaded.
file<String>: | The file to reload. |
When fork-based loading is used:
(Does not return.)
When fork-based loading is not in use:
nil
:api: private
Removes all classes declared in the specified file. Any hashes which use classes as keys will be protected provided they have been added to Merb.klass_hashes. These hashes have their keys substituted with placeholders before the file‘s classes are unloaded. If a block is provided, it is called before the substituted keys are reconstituted.
file<String>: | The file to remove classes for. |
&block: | A block to call with the file that has been removed before klass_hashes are updated |
to use the current values of the constants they used as keys.
nil
:api: private
Removes the specified class.
Additionally, removes the specified class from the subclass list of every superclass that tracks it‘s subclasses in an array returned by _subclasses_list. Classes that wish to use this functionality are required to alias the reader for their list of subclasses to _subclasses_list. Plugins for ORMs and other libraries should keep this in mind.
const<Class>: | The class to remove. |
nil
:api: private
Load all classes from Merb‘s native load paths.
If fork-based loading is used, every time classes are loaded this will return in a new spawner process and boot loading will continue from this point in the boot loading process.
If fork-based loading is not in use, this only returns once and does not fork a new process.
Returns at least once:
nil
:api: plugin
Set up the BEGIN point for fork-based loading and sets up any signals in the parent and child. This is done by forking the app. The child process continues on to run the app. The parent process waits for the child process to finish and either forks again
Parent Process:
(Does not return.)
Child Process returns at least once:
nil
:api: private