<commit_before># frozen_string_literal: true

module ConfigHelper
  def global_config
    config = {
      env: Rails.env.to_s,
      default_currency: Settings.default_currency,
      facebook: Settings.facebook.to_hash.slice(:pixel_id),
      recaptcha3: Settings.recaptcha3.to_hash.slice(:site_key),
      recaptcha2: Settings.recaptcha2.to_hash.slice(:site_key)
    }.deep_transform_keys! do |key|
      key.to_s.camelize(:lower)
    end
    return config unless Settings.end_of_year == true

    config.merge(
      eoyThermometer: eoy_thermometer_config
    )
  end

  def eoy_thermometer_config
    start_date = Date.new(2019, 11, 0o1)
    end_date = Date.new(2019, 12, 31)
    # end of year goal in cents
    eoy_goal = 60_000_000<commit_msg>Use EOY dates for the eoy thermometer data<commit_after># frozen_string_literal: true

module ConfigHelper
  def global_config
    config = {
      env: Rails.env.to_s,
      default_currency: Settings.default_currency,
      facebook: Settings.facebook.to_hash.slice(:pixel_id),
      recaptcha3: Settings.recaptcha3.to_hash.slice(:site_key),
      recaptcha2: Settings.recaptcha2.to_hash.slice(:site_key)
    }.deep_transform_keys! do |key|
      key.to_s.camelize(:lower)
    end
    return config unless Settings.end_of_year == true

    config.merge(
      eoyThermometer: eoy_thermometer_config
    )
  end

  def eoy_thermometer_config
    start_date = Date.new(2019, 11, 29)
    end_date = Date.new(2019, 12, 31)
    # end of year goal in cents
    eoy_goal = 60_000_000
{'fraction_non_alphanumeric': 0.08900523560209424, 'fraction_numerical': 0.03664921465968586, 'mean_word_length': 3.4707602339181287, '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': '6410039', 'n_tokens_mistral': 583, 'n_tokens_neox': 528, 'n_words': 106}