Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I used the instructions in the docs for Sass::Plugin::Rack to set the :cache_location option to something other than '.sass-cache'. But the cache_location was being ignored and the default '.sass-cache' was being used. I dug into the code and found out why: Sass::Plugin::Configuration#options was prematurely instantiating a new Sass::CacheStores::Filesystem object with the value of options[:cache_location]. The problem with this is that when I set the :cache_location like in the Sass::Plugin::Rack docs, calling options() immediately instantiates the Filesystem cache store even before I have a chance to change :cache_location. So setting :cache_location is useless.
To fix this, I set the default_proc in the default_options hash to set and instantiate the Sass::CacheStores::Filesystem object. This effectively delays the instantiation until it is needed. By that time, the :cache_location option can be set to something else.
I added the default_proc to the Rails and Merb plugins as well. I wrote tests for them in separate files for each. They were just copies of plugin_configuration_test.rb, but requiring the respective plugin file beforehand. But the Merb plugin required the Merb constant to be defined, which I didn't know how to do, so I removed that test.
So that's 1 commit. The other commit is a small one in the Sass::Plugin::Rack docs where 'merge' should be 'merge!'.