<commit_before>module Pronto
  class Config
    def initialize(config_hash = ConfigFile.new.to_h)
      @config_hash = config_hash
    end

    def excluded_files
      @excluded_files ||= exclude.flat_map { |path| Dir[path] }
    end

    def github_access_token
      ENV['GITHUB_ACCESS_TOKEN'] || @config_file['github']['access_token']
    end

    def github_slug
      @config_file['github']['slug']
    end

    def gitlab_private_token
      ENV['GITLAB_API_PRIVATE_TOKEN'] || @config_file['gitlab']['private_token']
    end

    def gitlab_endpoint
      ENV['GITLAB_API_ENDPOINT'] || @config_file['gitlab']['endpoint']
    end

    private

    def exclude
      @config_file['all']['exclude']
    end
  end
end<commit_msg>Rename config_file to config_hash<commit_after>module Pronto
  class Config
    def initialize(config_hash = ConfigFile.new.to_h)
      @config_hash = config_hash
    end

    def excluded_files
      @excluded_files ||= exclude.flat_map { |path| Dir[path] }
    end

    def github_access_token
      ENV['GITHUB_ACCESS_TOKEN'] || @config_hash['github']['access_token']
    end

    def github_slug
      @config_hash['github']['slug']
    end

    def gitlab_private_token
      ENV['GITLAB_API_PRIVATE_TOKEN'] || @config_hash['gitlab']['private_token']
    end

    def gitlab_endpoint
      ENV['GITLAB_API_ENDPOINT'] || @config_hash['gitlab']['endpoint']
    end

    private

    def exclude
      @config_hash['all']['exclude']
    end
  end
end
{'fraction_non_alphanumeric': 0.11320754716981132, 'fraction_numerical': 0.0, 'mean_word_length': 3.419642857142857, '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': '3058159', 'n_tokens_mistral': 503, 'n_tokens_neox': 482, 'n_words': 88}