<commit_before># frozen_string_literal: true

module Dry
  module System
    module Plugins
      module Bootsnap
        DEFAULT_OPTIONS = {
          load_path_cache: true,
          disable_trace: true,
          compile_cache_iseq: true,
          compile_cache_yaml: true,
          autoload_paths_cache: false
        }.freeze

        # @api private
        def self.extended(system)
          super
          system.use(:env)
          system.before(:configure) { setting :bootsnap, default: DEFAULT_OPTIONS }
          system.after(:configure, &:setup_bootsnap)
        end

        # @api private
        def self.dependencies
          {bootsnap: "bootsnap"}
        end

        # Set up bootsnap for faster booting
        #
        # @api public
        def setup_bootsnap
          return unless bootsnap_available?

          ::Bootsnap.setup(config.bootsnap.merge(cache_dir: root.join("tmp/cache").to_s))
        end

        # @api private
        def bootsnap_available?
          RUBY_ENGINE == "ruby" && RUBY_VERSION >= "2.3.0" && RUBY_VERSION < "2.5.0"
        end
      end
    end
  end
end<commit_msg>Allow bootsnap for Rubies up to 3.0.x<commit_after># frozen_string_literal: true

module Dry
  module System
    module Plugins
      module Bootsnap
        DEFAULT_OPTIONS = {
          load_path_cache: true,
          disable_trace: true,
          compile_cache_iseq: true,
          compile_cache_yaml: true,
          autoload_paths_cache: false
        }.freeze

        # @api private
        def self.extended(system)
          super
          system.use(:env)
          system.before(:configure) { setting :bootsnap, default: DEFAULT_OPTIONS }
          system.after(:configure, &:setup_bootsnap)
        end

        # @api private
        def self.dependencies
          {bootsnap: "bootsnap"}
        end

        # Set up bootsnap for faster booting
        #
        # @api public
        def setup_bootsnap
          return unless bootsnap_available?

          ::Bootsnap.setup(config.bootsnap.merge(cache_dir: root.join("tmp/cache").to_s))
        end

        # @api private
        def bootsnap_available?
          RUBY_ENGINE == "ruby" && RUBY_VERSION >= "2.3.0" && RUBY_VERSION < "3.1.0"
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.0843585237258348, 'fraction_numerical': 0.006151142355008787, 'mean_word_length': 1.8641509433962264, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5982088', 'n_tokens_mistral': 691, 'n_tokens_neox': 656, 'n_words': 155}