<commit_before>require 'rake'

dependencies = ['environment', 'db:test:prepare']
unless defined?(Rails)
  dependencies.each do |t|
    task t do; end
  end
end

task :close => dependencies do |t, args|
  options = [
    'DRIVER=' + (ENV['DRIVER'] || 'poltergeist'),
    'PAUSE=' + (ENV['PAUSE'] || '0'),
    'COVERAGE=' + (ENV['COVERAGE'] || 'true'),
    'ACCEPTANCE_TEST=true',
    'EXPAND=' + (ENV['EXPAND'] || 'true')
  ].join(' ')
  
  features = []
  ARGV[1..-1].each do |arg|
    unless arg.index('=')
      task arg.to_sym do ; end
      features << arg.gsub(/:/, '\:')
    end
  end

  format = ENV['FORMAT']
  if format.to_s.length > 0
    case format
    when 'junit'
      output = "test/reports" if format == 'junit'
    else
      output = "features/reports/index.html"
    end
    additional_format = "--format #{format} --out #{output}"
  end

  run "bundle exec cucumber --guess --quiet --no-multiline -r features --format pretty #{additional_format} #{features.join(' ')} #{options}"
end<commit_msg>rake close<commit_after>require 'rake'

dependencies = ['environment', 'db:test:prepare']
unless defined?(Rails)
  dependencies.each do |t|
    task t do; end
  end
end

task :close => dependencies do |t, args|
  options = [
    'DRIVER=' + (ENV['DRIVER'] || 'poltergeist'),
    'PAUSE=' + (ENV['PAUSE'] || '0'),
    'COVERAGE=' + (ENV['COVERAGE'] || 'true'),
    'ACCEPTANCE_TEST=true',
    'EXPAND=' + (ENV['EXPAND'] || 'true')
  ].join(' ')
  
  features = []
  ARGV[1..-1].each do |arg|
    unless arg.index('=')
      task arg.to_sym do ; end
      features << arg.gsub(/:/, '\:')
    end
  end

  format = ENV['FORMAT']
  if format.to_s.length > 0
    case format
    when 'junit'
      output = "test/reports" if format == 'junit'
    else
      output = "features/reports/index.html"
    end
    additional_format = "--format #{format} --out #{output}"
  end

  fail unless system("bundle exec cucumber --guess --quiet --no-multiline -r features --format pretty #{additional_format} #{features.join(' ')} #{options}")
end
{'fraction_non_alphanumeric': 0.19070904645476772, 'fraction_numerical': 0.003911980440097799, 'mean_word_length': 3.035502958579882, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '771623', 'n_tokens_mistral': 726, 'n_tokens_neox': 704, 'n_words': 181}