<commit_before>require 'shipitron/version'
require 'hashie'
require 'shipitron/logger'
require 'metaractor'
require 'shipitron/smash'

module Shipitron
  CONFIG_FILE = 'shipitron/config.yml'.freeze
  SECRETS_FILE = 'shipitron/secrets.yml'.freeze

  class << self
    def config_file
      @config_file ||= CONFIG_FILE
    end

    def config_file=(file)
      @config_file = file
    end

    def config
      @config ||= Smash.load(config_file).merge(secrets)
    end

    def secrets_file
      @secrets_file ||= SECRETS_FILE
    end

    def secrets_file=(file)
      @secrets_file = file
    end

    def secrets
      @secrets ||= Smash.load(secrets_file)
    end
  end
end
<commit_msg>Handle missing config files<commit_after>require 'shipitron/version'
require 'hashie'
require 'shipitron/logger'
require 'metaractor'
require 'shipitron/smash'

module Shipitron
  CONFIG_FILE = 'shipitron/config.yml'.freeze
  SECRETS_FILE = 'shipitron/secrets.yml'.freeze

  class << self
    def config_file
      @config_file ||= CONFIG_FILE
    end

    def config_file=(file)
      @config_file = file
    end

    def config
      @config ||= Smash.load(config_file).merge(secrets)
    rescue ArgumentError
      Logger.warn "Config file '#{config_file}' does not exist"
      @config = secrets
    end

    def secrets_file
      @secrets_file ||= SECRETS_FILE
    end

    def secrets_file=(file)
      @secrets_file = file
    end

    def secrets
      @secrets ||= Smash.load(secrets_file)
    rescue ArgumentError
      Logger.warn "Secrets file '#{secrets_file}' does not exist"
      @secrets = Smash.new
    end
  end
end

{'fraction_non_alphanumeric': 0.09280885064535956, 'fraction_numerical': 0.0, 'mean_word_length': 3.0397022332506203, 'pattern_counts': {'":': 0, '<': 7, '<?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': '7272522', 'n_tokens_mistral': 572, 'n_tokens_neox': 543, 'n_words': 125}