<commit_before>require 'rake/testtask'

class Ecrire::TestTask < Rake::TestTask
  attr_accessor :theme

  def define
    desc @description
    task @name do
      Rake::FileUtilsExt.verbose(@verbose) do
        args =
          "#{ruby_opts_string} #{run_code} " +
          "#{file_list_string} #{option_list}" +
          "#{theme}"

        ruby args do |ok, status|
          if !ok && status.respond_to?(:signaled?) && status.signaled?
            raise SignalException.new(status.termsig)
          elsif !ok
            fail "Command failed with status (#{status.exitstatus}): " +
              "[ruby #{args}]"
          end
        end
      end
    end
    self
  end

end
<commit_msg>Check if theme exists before adding it to the list of args<commit_after>require 'rake/testtask'

class Ecrire::TestTask < Rake::TestTask
  attr_accessor :theme

  def define
    desc @description
    task @name do
      Rake::FileUtilsExt.verbose(@verbose) do
        args = [
          "#{ruby_opts_string} #{run_code} ",
          "#{file_list_string} #{option_list}"
        ]

        if File.exists?(theme)
          args << theme
        end

        ruby args.join do |ok, status|
          if !ok && status.respond_to?(:signaled?) && status.signaled?
            raise SignalException.new(status.termsig)
          elsif !ok
            fail "Command failed with status (#{status.exitstatus}): " +
              "[ruby #{args}]"
          end
        end
      end
    end
    self
  end

end

{'fraction_non_alphanumeric': 0.11163101604278075, 'fraction_numerical': 0.0, 'mean_word_length': 2.0181451612903225, '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': '3902261', 'n_tokens_mistral': 460, 'n_tokens_neox': 450, 'n_words': 115}