<commit_before>namespace :bs do
  desc 'Bootstrap the application'
  task :init => %i[db:create db:migrate db:seed] do
    run_auto_wizard
  end

  desc 'Reset the application to its initial state'
  task :reset => %i[db:reset] do
    run_auto_wizard
    flush_cache_and_logs
  end
end

APP_CACHE   = Dir.glob(Rails.root.join('tmp', 'cache*'))
SERVER_LOG  = Rails.root.join('log', Rails.env)
AUTO_WIZARD = { source:      Rails.root.join('contrib', 'auto_wizard_test.json'),
                destination: Rails.root.join('auto_wizard.json') }.freeze

def flush_cache_and_logs
  FileUtils.rm_rf(APP_CACHE)
  File.write(SERVER_LOG, '')
end

def run_auto_wizard
  FileUtils.ln(AUTO_WIZARD[:source], AUTO_WIZARD[:destination], force: true)
  system('rails runner "AutoWizard.setup"')
end<commit_msg>Fixed bug: Missing file extension causes flushing of wrong file.<commit_after>namespace :bs do
  desc 'Bootstrap the application'
  task :init => %i[db:create db:migrate db:seed] do
    run_auto_wizard
  end

  desc 'Reset the application to its initial state'
  task :reset => %i[db:reset] do
    run_auto_wizard
    flush_cache_and_logs
  end
end

APP_CACHE   = Dir.glob(Rails.root.join('tmp', 'cache*'))
SERVER_LOG  = Rails.root.join('log', "#{Rails.env}.log")
AUTO_WIZARD = { source:      Rails.root.join('contrib', 'auto_wizard_test.json'),
                destination: Rails.root.join('auto_wizard.json') }.freeze

def flush_cache_and_logs
  FileUtils.rm_rf(APP_CACHE)
  File.write(SERVER_LOG, '')
end

def run_auto_wizard
  FileUtils.ln(AUTO_WIZARD[:source], AUTO_WIZARD[:destination], force: true)
  system('rails runner "AutoWizard.setup"')
end
{'fraction_non_alphanumeric': 0.12515188335358446, 'fraction_numerical': 0.0, 'mean_word_length': 4.5641891891891895, 'pattern_counts': {'":': 0, '<': 3, '<?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': '779456', 'n_tokens_mistral': 595, 'n_tokens_neox': 588, 'n_words': 126}