<commit_before>module Sprockets
  autoload :Helpers, "sprockets/helpers"
  autoload :LazyCompressor, "sprockets/compressors"
  autoload :NullCompressor, "sprockets/compressors"

  # TODO: Get rid of config.assets.enabled
  class Railtie < ::Rails::Railtie
    config.default_asset_host_protocol = :relative

    rake_tasks do
      load "sprockets/assets.rake"
    end

    initializer "sprockets.environment" do |app|
      config = app.config
      next unless config.assets.enabled

      require 'sprockets'

      app.assets = Sprockets::Environment.new(app.root.to_s) do |env|
        env.static_root = File.join(app.root.join('public'), config.assets.prefix)
        env.logger = ::Rails.logger
        env.version = ::Rails.env + '-' + env.version

        if config.assets.cache_store != false
          env.cache = ActiveSupport::Cache.lookup_store(config.assets.cache_store) || ::Rails.cache
        end
      end

      ActiveSupport.on_load(:action_view) do
        include ::Sprockets::Helpers::RailsHelper

        app.assets.context_class.instance_eval do
          include ::Sprockets::Helpers::RailsHelper
        end
      end
    end

    # We need to configure this after initialization to ensure we collect
    # paths from all engines. This hook is invoked exactly before routes
    # are compiled, and so that other Railties have an opportunity to
    # register compressors.
    config.after_initialize do |app|
      next unless app.assets
      config = app.config

      config.assets.paths.each { |path| app.assets.append_path(path) }

      if config.assets.compress
        # temporarily hardcode default JS compressor to uglify. Soon, it will work
        # the same as SCSS, where a default plugin sets the default.
        unless config.assets.js_compressor == false
          app.assets.js_compressor = LazyCompressor.new { expand_js_compressor(config.assets.js_compressor || :uglifier) }
        end<commit_msg>use assets.version in asset checksum to allow user to easily override<commit_after>module Sprockets
  autoload :Helpers, "sprockets/helpers"
  autoload :LazyCompressor, "sprockets/compressors"
  autoload :NullCompressor, "sprockets/compressors"

  # TODO: Get rid of config.assets.enabled
  class Railtie < ::Rails::Railtie
    config.default_asset_host_protocol = :relative

    rake_tasks do
      load "sprockets/assets.rake"
    end

    initializer "sprockets.environment" do |app|
      config = app.config
      next unless config.assets.enabled

      require 'sprockets'

      app.assets = Sprockets::Environment.new(app.root.to_s) do |env|
        env.static_root = File.join(app.root.join('public'), config.assets.prefix)
        env.logger = ::Rails.logger
        env.version = ::Rails.env + '-' + config.assets.version

        if config.assets.cache_store != false
          env.cache = ActiveSupport::Cache.lookup_store(config.assets.cache_store) || ::Rails.cache
        end
      end

      ActiveSupport.on_load(:action_view) do
        include ::Sprockets::Helpers::RailsHelper

        app.assets.context_class.instance_eval do
          include ::Sprockets::Helpers::RailsHelper
        end
      end
    end

    # We need to configure this after initialization to ensure we collect
    # paths from all engines. This hook is invoked exactly before routes
    # are compiled, and so that other Railties have an opportunity to
    # register compressors.
    config.after_initialize do |app|
      next unless app.assets
      config = app.config

      config.assets.paths.each { |path| app.assets.append_path(path) }

      if config.assets.compress
        # temporarily hardcode default JS compressor to uglify. Soon, it will work
        # the same as SCSS, where a default plugin sets the default.
        unless config.assets.js_compressor == false
          app.assets.js_compressor = LazyCompressor.new { expand_js_compressor(config.assets.js_compressor || :uglifier) }
        end
{'fraction_non_alphanumeric': 0.08737373737373737, 'fraction_numerical': 0.0, 'mean_word_length': 2.9729187562688066, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5506938', 'n_tokens_mistral': 1184, 'n_tokens_neox': 1153, 'n_words': 301}