<commit_before>module Spring
  @commands = {}

  class << self
    attr_reader :commands
  end

  def self.register_command(name, klass, options = {})
    commands[name] = klass

    if options[:alias]
      commands[options[:alias]] = klass
    end
  end

  def self.command?(name)
    commands.include? name
  end

  def self.command(name)
    commands.fetch name
  end

  # Load custom commands, if any
  config = File.expand_path("./config/spring.rb")
  require config if File.exist?(config)

  module Commands
    class Test
      def env
        "test"
      end

      def setup
        $LOAD_PATH.unshift "test"
        require "test_helper"
      end

      def call(args)
        ARGV.replace args
        path = File.expand_path(args.first)

        if File.directory?(path)
          Dir[File.join path, "**", "*_test.rb"].each { |f| require f }
        else
          require path
        end
      end
    end
    Spring.register_command "test", Test.new

    class RSpec
      def env
        "test"
      end

      def setup
        $LOAD_PATH.unshift "spec"
        require "spec_helper"
      end

      def call(args)
        ::RSpec::Core::Runner.run(args)
      end
    end
    Spring.register_command "rspec", RSpec.new

    class Cucumber
      def env
        "test"
      end<commit_msg>Fix rspec command when just 'rspec' is called<commit_after>module Spring
  @commands = {}

  class << self
    attr_reader :commands
  end

  def self.register_command(name, klass, options = {})
    commands[name] = klass

    if options[:alias]
      commands[options[:alias]] = klass
    end
  end

  def self.command?(name)
    commands.include? name
  end

  def self.command(name)
    commands.fetch name
  end

  # Load custom commands, if any
  config = File.expand_path("./config/spring.rb")
  require config if File.exist?(config)

  module Commands
    class Test
      def env
        "test"
      end

      def setup
        $LOAD_PATH.unshift "test"
        require "test_helper"
      end

      def call(args)
        ARGV.replace args
        path = File.expand_path(args.first)

        if File.directory?(path)
          Dir[File.join path, "**", "*_test.rb"].each { |f| require f }
        else
          require path
        end
      end
    end
    Spring.register_command "test", Test.new

    class RSpec
      def env
        "test"
      end

      def setup
        $LOAD_PATH.unshift "spec"
        require "spec_helper"
      end

      def call(args)
        $0 = "rspec"
        ::RSpec::Core::Runner.run(args)
      end
    end
    Spring.register_command "rspec", RSpec.new

    class Cucumber
      def env
        "test"
      end
{'fraction_non_alphanumeric': 0.09555804404628593, 'fraction_numerical': 0.0003732736095558044, 'mean_word_length': 1.9225736095965105, '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': '3790418', 'n_tokens_mistral': 843, 'n_tokens_neox': 826, 'n_words': 220}