Skip to content

Instantly share code, notes, and snippets.

@tenderlove
Created March 18, 2014 21:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tenderlove/9630594 to your computer and use it in GitHub Desktop.
Save tenderlove/9630594 to your computer and use it in GitHub Desktop.
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