Class: Merb::BootLoader::Dependencies
- Inherits:
-
Merb::BootLoader
- Object
- Merb::BootLoader
- Merb::BootLoader::Dependencies
- Defined in:
- lib/merb-core/bootloader.rb
Class Method Summary collapse
- .enable_json_gem ⇒ Object
- .load_dependencies ⇒ Object
-
.run ⇒ Object
Load the init_file specified in Merb::Config or if not specified, the init.rb file from the Merb configuration directory, and any environment files, which register the list of necessary dependencies and any after_app_loads hooks.
- .set_encoding ⇒ Object
- .update_logger ⇒ Object
Methods inherited from Merb::BootLoader
after, after_app_loads, before, before_app_loads, default_framework, finished?, inherited, move_klass
Class Method Details
.enable_json_gem ⇒ Object
283 284 285 286 287 288 289 |
# File 'lib/merb-core/bootloader.rb', line 283 def self.enable_json_gem gem "json" require "json/ext" rescue LoadError gem "json_pure" require "json/pure" end |
.load_dependencies ⇒ Object
279 280 281 |
# File 'lib/merb-core/bootloader.rb', line 279 def self.load_dependencies dependencies.each { |dependency| Kernel.load_dependency(dependency) } end |
.run ⇒ Object
Load the init_file specified in Merb::Config or if not specified, the init.rb file from the Merb configuration directory, and any environment files, which register the list of necessary dependencies and any after_app_loads hooks.
Dependencies can hook into the bootloader process itself by using before or after insertion methods. Since these are loaded from this bootloader (Dependencies), they can only adapt the bootloaders that haven’t been loaded up until this point.
270 271 272 273 274 275 276 277 |
# File 'lib/merb-core/bootloader.rb', line 270 def self.run set_encoding load_initfile load_env_config enable_json_gem unless Merb::disabled?(:json) load_dependencies update_logger end |
.set_encoding ⇒ Object
296 297 298 |
# File 'lib/merb-core/bootloader.rb', line 296 def self.set_encoding $KCODE = 'UTF8' if $KCODE == 'NONE' || $KCODE.blank? end |