Created
March 18, 2014 21:56
-
-
Save tenderlove/9630594 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/sprockets/cache_wrapper.rb b/lib/sprockets/cache_wrapper.rb | |
index 8301e67..c4c9f96 100644 | |
--- a/lib/sprockets/cache_wrapper.rb | |
+++ b/lib/sprockets/cache_wrapper.rb | |
@@ -38,21 +38,6 @@ module Sprockets | |
end | |
end | |
- class IndexWrapper < CacheWrapper | |
- def initialize(*args) | |
- @local = {} | |
- super | |
- end | |
- | |
- def [](key) | |
- @local[key] ||= @cache[key] | |
- end | |
- | |
- def []=(key, value) | |
- @local[key] = @cache[key] = value | |
- end | |
- end | |
- | |
class GetWrapper < CacheWrapper | |
def get(key) | |
@cache.get(key) | |
diff --git a/lib/sprockets/index.rb b/lib/sprockets/index.rb | |
index d57bf2f..b56c2b4 100644 | |
--- a/lib/sprockets/index.rb | |
+++ b/lib/sprockets/index.rb | |
@@ -21,7 +21,7 @@ module Sprockets | |
# Copy environment attributes | |
@logger = environment.logger | |
@context_class = environment.context_class | |
- @cache = IndexWrapper.new(self, environment.cache) | |
+ @cache = environment.cache.class.new(self, environment.cache) | |
@trail = environment.trail.index | |
@digest = environment.digest | |
@digest_class = environment.digest_class |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment