module Jekyll::Assets::Patches::CachedEnv

Patches `Sprockets::CachedEnvironment` with some of the stuff that we would like available. Including our `Util` methods, the `#manifest`, the `#asset_config`, and even `#jekyll`, so that we can remain fast while having some of the stuff that we need access to. –

Attributes

asset_config[R]
jekyll[R]
manifest[R]

Public Class Methods

new(env) click to toggle source

– @param [Env] env the environment. Patches initialize so we can give access to `#jekyll`. @return [self] –

Calls superclass method
# File lib/jekyll/assets/patches/cached.rb, line 30
def initialize(env)
  super

  @manifest = env.manifest
  @asset_config = env.asset_config
  @jekyll = env.jekyll
end

Public Instance Methods

find_asset(*) click to toggle source

Calls superclass method
# File lib/jekyll/assets/patches/cached.rb, line 39
def find_asset(*)
  super.tap do |v|
    v&.environment = self
  end
end
find_asset!(*a) click to toggle source

# File lib/jekyll/assets/patches/cached.rb, line 46
def find_asset!(*a)
  load(resolve!(*a).first).tap do |v|
    v.environment = self
  end
end