merb-cache DEFAULT_OPTIONS created on class load
Reported by Gabriel Handford | April 29th, 2008 @ 07:50 PM | in 0.9.8
In merb-cache.rb the DEFAULT_OPTIONS is initialized on class load but Merb.root isn't set at that point.
This causes merb to fail when it can't find the cache directory, and you are using the -m argument, and not starting from the project directory (like via an init script).
A possible fix is to wait to load the defaults until cache start:
def default_config
@default_config ||= {
:cache_html_directory => Merb.dir_for(:public) / "cache",
:store => "file",
:cache_directory => Merb.root_path("tmp/cache"),
}
Then in the start method:
default_config.merge(Merb::Plugins.config[:merb_cache] || {})
Comments and changes to this ticket
-
Michael Klishin (antares) May 11th, 2008 @ 07:48 AM
- → State changed from new to open
- → Milestone changed from to 1.0
-
Michael Klishin (antares) September 5th, 2008 @ 07:10 PM
- → Assigned user changed from to Daniel Neighman (hassox)
- → Milestone changed from 1.0 to 0.9.7
- → Tag changed from to merb-cache
-
Michael Klishin (antares) September 13th, 2008 @ 07:05 PM
- → Milestone changed from 0.9.7 to 0.9.8
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
