<commit_before># 3rd-party
require "sprockets"


module Jekyll
  module AssetsPlugin
    class Environment < Sprockets::Environment

      class AssetNotFound < StandardError
        def initialize path
          super "Couldn't find file '#{path}'"
        end
      end


      attr_reader :site


      def initialize site
        super site.source

        @site = site

        # append asset paths
        @site.assets_config.sources.each { |p| append_path p }

        self.js_compressor   = @site.assets_config.js_compressor
        self.css_compressor  = @site.assets_config.css_compressor

        # bind jekyll and Sprockets context together
        context_class.instance_variable_set :@site, @site

        context_class.send :include, Patches::ContextPatch
      end


      def find_asset path, *args
        super or raise AssetNotFound, path
      end

    end
  end
end<commit_msg>let use tmp/ as a cache for Sprockets<commit_after># 3rd-party
require "sprockets"


module Jekyll
  module AssetsPlugin
    class Environment < Sprockets::Environment

      class AssetNotFound < StandardError
        def initialize path
          super "Couldn't find file '#{path}'"
        end
      end


      attr_reader :site


      def initialize site
        super site.source

        @site = site

        # append asset paths
        @site.assets_config.sources.each { |p| append_path p }

        self.js_compressor   = @site.assets_config.js_compressor
        self.css_compressor  = @site.assets_config.css_compressor

        @sprockets_cache_path = File.join(@site.config['source'], 'tmp', 'cache')
        self.cache           = Sprockets::Cache::FileStore.new(@sprockets_cache_path)

        # bind jekyll and Sprockets context together
        context_class.instance_variable_set :@site, @site

        context_class.send :include, Patches::ContextPatch
      end


      def find_asset path, *args
        super or raise AssetNotFound, path
      end

    end
  end
end
{'fraction_non_alphanumeric': 0.07031642390758412, 'fraction_numerical': 0.0010045203415369162, 'mean_word_length': 2.3993174061433447, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3091672', 'n_tokens_mistral': 603, 'n_tokens_neox': 565, 'n_words': 152}