<commit_before>require 'trusty_cms/task_support'
namespace :trusty_cms do
  namespace :config do
    desc 'Export TrustyCms::Config to Rails.root/config/trusty_config.yml. Specify a path with TRUSTY_CONFIG_PATH - defaults to Rails.root/config/trusty_config.yml'
    task export: :environment do
      config_path = ENV.fetch('TRUSTY_CONFIG_PATH', nil) || "#{Rails.root}/config/trusty_config.yml"
      clear = ENV.fetch('CLEAR_CONFIG', nil)
      TrustyCms::TaskSupport.config_export(config_path)
    end

    desc 'Import TrustyCms::Config from Rails.root/config/trusty_config.yml. Specify a path with TRUSTY_CONFIG_PATH - defaults to Rails.root/config/trusty_config.yml Set CLEAR_CONFIG=true to delete all existing settings before import'
    task import: :environment do
      config_path = ENV.fetch('TRUSTY_CONFIG_PATH', nil) || "#{Rails.root}/config/trusty_config.yml"
      clear = ENV.fetch('CLEAR_CONFIG', nil)
      TrustyCms::TaskSupport.config_import(config_path, clear)
    end
  end
end<commit_msg>use given path instead of nil<commit_after>require 'trusty_cms/task_support'
namespace :trusty_cms do
  namespace :config do
    desc 'Export TrustyCms::Config to Rails.root/config/trusty_config.yml. Specify a path with TRUSTY_CONFIG_PATH - defaults to Rails.root/config/trusty_config.yml'
    task export: :environment do
      config_path = ENV.fetch('TRUSTY_CONFIG_PATH') { "#{Rails.root}/config/trusty_config.yml" }
      clear = ENV.fetch('CLEAR_CONFIG', nil)
      TrustyCms::TaskSupport.config_export(config_path)
    end

    desc 'Import TrustyCms::Config from Rails.root/config/trusty_config.yml. Specify a path with TRUSTY_CONFIG_PATH - defaults to Rails.root/config/trusty_config.yml Set CLEAR_CONFIG=true to delete all existing settings before import'
    task import: :environment do
      config_path = ENV('TRUSTY_CONFIG_PATH') { "#{Rails.root}/config/trusty_config.yml" }
      clear = ENV.fetch('CLEAR_CONFIG', nil)
      TrustyCms::TaskSupport.config_import(config_path, clear)
    end
  end
end
{'fraction_non_alphanumeric': 0.09921026653504442, 'fraction_numerical': 0.0, 'mean_word_length': 4.584022038567493, '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': '1658453', 'n_tokens_mistral': 698, 'n_tokens_neox': 653, 'n_words': 146}