Sha256: d32cf636213789b88204d26c60ea1a61e7b0fba01b5a799bc4f63e643b4b9a25

Contents?: true

Size: 700 Bytes

Versions: 2

Compression:

Stored size: 700 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 "", "Asset caching is disabled by configuration. " \
      "However, if you're using proxies, a cache might still be created."
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jekyll-assets-2.3.2 lib/jekyll/assets/hooks/cache.rb
jekyll-assets-2.3.0 lib/jekyll/assets/hooks/cache.rb