Skip to content

Instantly share code, notes, and snippets.

@tenderlove
Created Mar 18, 2014
Embed
What would you like to do?
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