<commit_before>module EmberCLI
  module Helpers
    extend self

    def match_version?(version, requirement)
      version = Gem::Version.new(version)
      requirement = Gem::Requirement.new(requirement)
      requirement.satisfied_by?(version)
    end

    def which(cmd)
      exts = ENV.fetch("PATHEXT", ?;).split(?;, -1).uniq

      ENV.fetch("PATH").split(File::PATH_SEPARATOR).each do |path|
        exts.each do |ext|
          exe = File.join(path, "#{cmd}#{ext}")
          return exe if File.executable?(exe) && !File.directory?(exe)
        end
      end

      nil
    end

    def non_production?
      !Rails.env.production? && rails_config_for(:consider_all_requests_local)
    end

    def use_middleware?
      rails_config_for(:use_ember_middleware) || non_production?
    end

    def use_live_recompilation?
      rails_config_for(:use_ember_live_recompilation) || Rails.env.development?
    end

    def rails_config_for(key)
      config = Rails.configuration
      config.respond_to?(key) && config.public_send(key)
    end

    def override_assets_precompile_task!
      Rake.application.instance_eval do
        @tasks["assets:precompile:original"] = @tasks.delete("assets:precompile")
        Rake::Task.define_task "assets:precompile", [:assets, :precompile] => "ember-cli:install_dependencies" do
          EmberCLI.compile!
          Rake::Task["assets:precompile:original"].execute
        end
      end
    end
  end
end<commit_msg>Make sure optional config settings actually override defaults<commit_after>module EmberCLI
  module Helpers
    extend self

    def match_version?(version, requirement)
      version = Gem::Version.new(version)
      requirement = Gem::Requirement.new(requirement)
      requirement.satisfied_by?(version)
    end

    def which(cmd)
      exts = ENV.fetch("PATHEXT", ?;).split(?;, -1).uniq

      ENV.fetch("PATH").split(File::PATH_SEPARATOR).each do |path|
        exts.each do |ext|
          exe = File.join(path, "#{cmd}#{ext}")
          return exe if File.executable?(exe) && !File.directory?(exe)
        end
      end

      nil
    end

    def non_production?
      !Rails.env.production? && rails_config_for(:consider_all_requests_local)
    end

    def use_middleware?
      rails_config_for(:use_ember_middleware, non_production?)
    end

    def use_live_recompilation?
      rails_config_for(:use_ember_live_recompilation, Rails.env.development?)
    end

    def rails_config_for(key, default=false)
      config = Rails.configuration
      config.respond_to?(key) ? config.public_send(key) : default
    end

    def override_assets_precompile_task!
      Rake.application.instance_eval do
        @tasks["assets:precompile:original"] = @tasks.delete("assets:precompile")
        Rake::Task.define_task "assets:precompile", [:assets, :precompile] => "ember-cli:install_dependencies" do
          EmberCLI.compile!
          Rake::Task["assets:precompile:original"].execute
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.11207471647765177, 'fraction_numerical': 0.00066711140760507, 'mean_word_length': 3.159500693481276, 'pattern_counts': {'":': 0, '<': 3, '<?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': '481646', 'n_tokens_mistral': 966, 'n_tokens_neox': 933, 'n_words': 168}