Sha256: c3712964ac633ad1e16b9d5973668332b8fe3f5146f14b0c15722bd12d3a8f45

Contents?: true

Size: 694 Bytes

Versions: 1

Compression:

Stored size: 694 Bytes

Contents

# Frozen-string-literal: true
# Copyright: 2012 - 2016 - MIT License
# Encoding: utf-8

Jekyll::Assets::Hook.register :env, :init do
  cache = asset_config.fetch("cache", ".asset-cache")
  type  = asset_config.fetch("cache_type",
    "filesystem"
  )

  if cache != false && type != "memory"
    self.cache = begin
      Sprockets::Cache::FileStore.new(
        jekyll.in_source_dir(
          cache
        )
      )
    end

  elsif cache && type == "memory"
    self.cache = begin
      Sprockets::Cache::MemoryStore.new
    end

  else
    Jekyll.logger.info "", "Caching is disabled by configuration. " \
      "However, if you're using proxies, a cache might still be created."
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jekyll-assets-2.2.8 lib/jekyll/assets/hooks/cache.rb