<commit_before>require 'integrity'
require 'metric_fu'

require 'pythagoras/runner'

module Pythagoras
  CONFIG_FILE = "config.yml"

  def self.run
    begin
      config = YAML.load_file(CONFIG_FILE)
    rescue Exception => e
      STDERR.puts "There was a problem reading your #{CONFIG_FILE} file: #{e}"
      return
    end

    if config
      Integrity.new(config['integrity_config'])
    else
      STDERR.puts "Your config file is blank."
      return
    end

    ignore = config['ignore'] ? Regexp.new(config['ignore']) : /[^\w\d\s]+/

    begin
      Integrity::Project.all.each do |project|
        Pythagoras::Runner.new(project, config).run if project.name !~ ignore
      end
    rescue Exception => e
      STDERR.puts "There was a problem loading your projects from integrity: #{e}"
      return
    end
  end
end
<commit_msg>Adding lib to the load path<commit_after>require 'integrity'
require 'metric_fu'

$:.unshift(File.dirname(__FILE__))
require 'pythagoras/runner'

module Pythagoras
  CONFIG_FILE = "config.yml"

  def self.run
    begin
      config = YAML.load_file(CONFIG_FILE)
    rescue Exception => e
      STDERR.puts "There was a problem reading your #{CONFIG_FILE} file: #{e}"
      return
    end

    if config
      Integrity.new(config['integrity_config'])
    else
      STDERR.puts "Your config file is blank."
      return
    end

    ignore = config['ignore'] ? Regexp.new(config['ignore']) : /[^\w\d\s]+/

    begin
      Integrity::Project.all.each do |project|
        Pythagoras::Runner.new(project, config).run if project.name !~ ignore
      end
    rescue Exception => e
      STDERR.puts "There was a problem loading your projects from integrity: #{e}"
      return
    end
  end
end

{'fraction_non_alphanumeric': 0.10848240046162723, 'fraction_numerical': 0.0, 'mean_word_length': 2.827814569536424, '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': '7202588', 'n_tokens_mistral': 568, 'n_tokens_neox': 552, 'n_words': 154}