I was a fan of the config/initializers directory functionality recently added into Rails. I want it in Merb. So, to get this add the following into the Merb::BootLoader.before_app_loads block in config/init.rb.
Merb::BootLoader.before_app_loads do
Dir["#{Merb.root}/config/initializers/**/*.rb"].sort.each do |initializer|
require(initializer)
end
end
This code was taken from the Rails source (modified slightly of course).
back to Merb index

0 comments:
Post a Comment