<commit_before>require_relative '../lib/cman/record'
require_relative '../lib/cman/repository'
require_relative '../lib/cman/executor'

require 'yaml'
require 'pathname'
require 'fakefs/spec_helpers'

def touch(*files)
  files.each do |file|
    FileUtils.mkdir_p File.dirname file
    File.open(file, 'w') { |f| f.write 'TEST' }
  end
end

def cat(file)
  puts "\n\n--- File #{file}:"
  File.readlines(file).each do |line|
    puts line
  end
  puts "\n\n--- #{file} ends here\n\n"
end

BASE_DIR = Cman.config['base_dir']
Cman::Logger.debug enabled: false<commit_msg>supressed app output in tests<commit_after>require_relative '../lib/cman/record'
require_relative '../lib/cman/repository'
require_relative '../lib/cman/executor'

require 'yaml'
require 'pathname'
require 'fakefs/spec_helpers'
require 'singleton'

def touch(*files)
  files.each do |file|
    FileUtils.mkdir_p File.dirname file
    File.open(file, 'w') { |f| f.write 'TEST' }
  end
end

def cat(file)
  puts "\n\n--- File #{file}:"
  File.readlines(file).each do |line|
    puts line
  end
  puts "\n\n--- #{file} ends here\n\n"
end

BASE_DIR = Cman.config['base_dir']

class DummyOutput
  include Singleton
  def write(*)
  end
end

RSpec.configure do |config|
  # original_stderr = $stderr
  original_stdout = $stdout

  config.before(:all) do
    # $stderr = nil
    $stdout = DummyOutput.instance
  end

  config.after(:all) do
    # $stderr = original_stderr
    $stdout = original_stdout
  end
end
{'fraction_non_alphanumeric': 0.1452817379497624, 'fraction_numerical': 0.0, 'mean_word_length': 3.6352201257861636, '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': '5768326', 'n_tokens_mistral': 529, 'n_tokens_neox': 532, 'n_words': 132}