<commit_before>lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'ci'

logger = Logger.new(STDOUT)

# thanks integrity!
def ansi_color_codes(string)
  return
  string.gsub("\e[0m", '</span>').
    gsub(/\e\[(\d+)m/, "<span class=\"color\\1\">")
end

first_result = nil
f = Thread.new do
  command = CI::Command.new(logger)
  command.cd "~/Development/mailmask-ruby" do
    first_result = command.run "rspec" do |chunk|
      print ansi_color_codes(chunk)
    end
  end
end

second_result = nil
s = Thread.new do
  command = CI::Command.new(logger)
  command.cd "~/Development/mailmask" do
    second_result = command.run "bundle exec rake" do |chunk|
      print ansi_color_codes(chunk)
    end
  end
end

command = CI::Command.new(logger)
third_result = command.run "asdf" do |chunk|
  print ansi_color_codes(chunk)
end

puts third_result.output

File.open('test.html', 'w+') do |f|
  f.write ansi_color_codes(first_result.output)
end<commit_msg>Fixed the test script.<commit_after>lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'ci'

logger = Logger.new(STDOUT)

# thanks integrity!
def ansi_color_codes(string)
  string.gsub("\e[0m", '</span>').
    gsub(/\e\[(\d+)m/, "<span class=\"color\\1\">")
end

first_result = nil
f = Thread.new do
  command = CI::Command.new(logger)
  command.cd "~/Development/mailmask-ruby" do
    first_result = command.run "rspec" do |chunk|
      print ansi_color_codes(chunk)
    end
  end
end

second_result = nil
s = Thread.new do
  command = CI::Command.new(logger)
  command.cd "~/Development/mailmask" do
    second_result = command.run "bundle exec rake" do |chunk|
      print ansi_color_codes(chunk)
    end
  end
end

command = CI::Command.new(logger)
t = Thread.new do
  command = CI::Command.new(logger)
  command.cd "~/Development/mailmask" do
    third_result = command.run "blah" do |chunk|
      print ansi_color_codes(chunk)
    end
  end
end

[ f, s, t ].each &:join

File.open('test.html', 'w+') do |f|
  f.write ansi_color_codes(first_result.output)
end
{'fraction_non_alphanumeric': 0.1483050847457627, 'fraction_numerical': 0.0018832391713747645, 'mean_word_length': 3.9765807962529274, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2777845', 'n_tokens_mistral': 806, 'n_tokens_neox': 776, 'n_words': 178}