# Frozen-string-literal: true # Copyright: 2012 - 2018 - MIT License # Encoding: utf-8 require "pathutil" require "forwardable/extended" require "jekyll/sanity" require "sprockets" require "jekyll" require_all "patches/*" require_relative "utils" require_relative "drop" require_relative "version" require_relative "filters" require_relative "manifest" require_relative "writer" require_relative "reader" require_relative "config" require_relative "logger" require_relative "hook" require_relative "tag" require_relative "url" module Jekyll module Assets class Env < Sprockets::Environment extend Forwardable::Extended include Utils # -- attr_reader :manifest attr_accessor :assets_to_write attr_reader :asset_config attr_reader :jekyll # -- rb_delegate :old?, to: :"self.class" rb_delegate :old_sprockets?, { to: :"self.class", } # -- def initialize(jekyll = nil) @asset_config = Config.new(jekyll.config["assets"] ||= {}) Hook.trigger :env, :before_init do |h| instance_eval(&h) end super() @jekyll = jekyll @assets_to_write = [] @manifest = Manifest.new(self, in_dest_dir) @jekyll.sprockets = self @total_time = 0.000000 @logger = Logger @cache = nil setup_sources! enable_compression! ignore_caches! setup_drops! precompile! copy_raw! Hook.trigger :env, :after_init do |h| instance_eval(&h) end end # -- def skip_gzip? !asset_config[:gzip] end # -- def find_asset(v, *a) msg = "Searched for, and rendered #{v} in %