Class: Merb::BootLoader::SetupSession
- Inherits:
-
Merb::BootLoader
- Object
- Merb::BootLoader
- Merb::BootLoader::SetupSession
- Defined in:
- lib/merb-core/bootloader.rb
Class Method Summary collapse
-
.run ⇒ Object
Enable the configured session container(s); any class that inherits from SessionContainer will be considered by its session_store_type attribute.
Methods inherited from Merb::BootLoader
after, after_app_loads, before, before_app_loads, default_framework, finished?, inherited, move_klass
Class Method Details
.run ⇒ Object
Enable the configured session container(s); any class that inherits from SessionContainer will be considered by its session_store_type attribute.
Returns
nil
1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 |
# File 'lib/merb-core/bootloader.rb', line 1090 def self.run # Require all standard session containers. Dir[Merb.framework_root / "merb-core" / "dispatch" / "session" / "*.rb"].each do |file| base_name = File.basename(file, ".rb") require file unless base_name == "container" || base_name == "store_container" end # Set some defaults. Merb::Config[:session_id_key] ||= "_session_id" # List of all session_stores from :session_stores and :session_store config options. config_stores = Merb::Config.session_stores # Register all configured session stores - any loaded session container class # (subclassed from Merb::SessionContainer) will be available for registration. Merb::SessionContainer.subclasses.each do |class_name| if(store = Object.full_const_get(class_name)) && config_stores.include?(store.session_store_type) Merb::Request.register_session_type(store.session_store_type, class_name) end end # Mixin the Merb::Session module to add app-level functionality to sessions Merb::SessionContainer.send(:include, Merb::Session) nil end |