lib/jekyll/assets/hooks/cache.rb in jekyll-assets-2.1.3 vs lib/jekyll/assets/hooks/cache.rb in jekyll-assets-2.2.0

- old
+ new

@@ -1,9 +1,17 @@ +# ---------------------------------------------------------------------------- # Frozen-string-literal: true -# Copyright: 2012-2015 - MIT License +# Copyright: 2012 - 2016 - MIT License # Encoding: utf-8 +# ---------------------------------------------------------------------------- Jekyll::Assets::Hook.register :env, :init do - if (cache_dir = asset_config.fetch("cache", ".asset-cache")) - self.cache = Sprockets::Cache::FileStore.new(jekyll.in_source_dir(cache_dir)) + cache_dir = asset_config.fetch("cache", + ".asset-cache" + ) + + if cache_dir + self.cache = Sprockets::Cache::FileStore.new( + jekyll.in_source_dir(cache_dir) + ) end end