lib/jekyll/assets/cached.rb in jekyll-assets-2.1.3 vs lib/jekyll/assets/cached.rb in jekyll-assets-2.2.0
- old
+ new
@@ -1,16 +1,27 @@
+# ----------------------------------------------------------------------------
# Frozen-string-literal: true
-# Copyright: 2012-2015 - MIT License
+# Copyright: 2012 - 2016 - MIT License
# Encoding: utf-8
+# ----------------------------------------------------------------------------
module Jekyll
module Assets
class Cached < Sprockets::CachedEnvironment
- attr_reader :jekyll, :parent
+ attr_reader :jekyll
+ attr_reader :parent
+
+ # ----------------------------------------------------------------------
+
def initialize(env)
@parent = env
@jekyll = env.jekyll
+ @resolve_cache = {}
super env
+ end
+
+ def resolve(*args)
+ @resolve_cache[args] ||= super
end
end
end
end