<commit_before># encoding: utf-8
require 'rubygems/requirement'

module Guard
  class Minitest
    class Runner

      def self.run(paths = [], options = {})
        Runner.new(options).run(paths, options)
      end

      def initialize(options = {})
        @options = {
          bundler:            File.exist?("#{Dir.pwd}/Gemfile"),
          rubygems:           false,
          drb:                false,
          zeus:               false,
          spring:             false,
          include:            [],
          test_folders:       %w[test spec],
          test_file_patterns: %w[*_test.rb test_*.rb *_spec.rb],
          cli:                nil
        }.merge(options)

        parse_deprecated_options

        [:test_folders, :test_file_patterns].each do |k|
          @options[k] = Array(@options[k]).uniq.compact
        end
      end

      def run(paths, options = {})
        message = options[:message] || "Running: #{paths.join(' ')}"
        UI.info message, reset: true

        status = if bundler?
          system(minitest_command(paths))
        else
          if defined?(::Bundler)
            ::Bundler.with_clean_env do
              system(minitest_command(paths))
            end
          else
            system(minitest_command(paths))
          end
        end

        # When using zeus or spring, the Guard::Minitest::Reporter can't be used because the minitests run in another
        # process, but we can use the exit status of the client process to distinguish between :success and :failed.
        if zeus? || spring?<commit_msg>No need to check for bundler? if checking for defined?(::Bundlier)<commit_after># encoding: utf-8
require 'rubygems/requirement'

module Guard
  class Minitest
    class Runner

      def self.run(paths = [], options = {})
        Runner.new(options).run(paths, options)
      end

      def initialize(options = {})
        @options = {
          bundler:            File.exist?("#{Dir.pwd}/Gemfile"),
          rubygems:           false,
          drb:                false,
          zeus:               false,
          spring:             false,
          include:            [],
          test_folders:       %w[test spec],
          test_file_patterns: %w[*_test.rb test_*.rb *_spec.rb],
          cli:                nil
        }.merge(options)

        parse_deprecated_options

        [:test_folders, :test_file_patterns].each do |k|
          @options[k] = Array(@options[k]).uniq.compact
        end
      end

      def run(paths, options = {})
        message = options[:message] || "Running: #{paths.join(' ')}"
        UI.info message, reset: true

        status = if defined?(::Bundler)
                   ::Bundler.with_clean_env do
                     system(minitest_command(paths))
                   end
                 else
                   system(minitest_command(paths))
                 end

        # When using zeus or spring, the Guard::Minitest::Reporter can't be used because the minitests run in another
        # process, but we can use the exit status of the client process to distinguish between :success and :failed.
        if zeus? || spring?
{'fraction_non_alphanumeric': 0.10321969696969698, 'fraction_numerical': 0.0006313131313131314, 'mean_word_length': 1.6607892527287993, 'pattern_counts': {'":': 0, '<': 3, '<?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': '897842', 'n_tokens_mistral': 899, 'n_tokens_neox': 871, 'n_words': 229}