<commit_before>require 'yaml'

class TotrelloConfig

  def read_config
    config = YAML.load_file("totrello_config.yml")

    @project_name = config['totrello']['project_name']
    @board_name   = config['totrello']['board']
    @default_list = config['totrello']['list']
    @excludes     = config['totrello']['exclude']

    {
     :project_name => @project_name,
     :board_name   => @board_name,
     :default_list => @default_list,
     :excludes     => @excludes
    }
  end

end<commit_msg>Fixed issue where if no .yml file was found nothing was returned causing crashes.<commit_after>require 'yaml'

class TotrelloConfig

  def read_config(directory)

    begin

      rbfiles = File.join("#{Dir.pwd}/**", ".totrello.yml")
      config = YAML.load_file( Dir.glob(rbfiles)[0])

      puts 'Found a .totrello.yml file!'

      project_name = config['totrello']['project_name']
      board_name   = config['totrello']['board']
      default_list = config['totrello']['list']
      excludes     = Array(config['totrello']['exclude'])

    rescue

      puts 'No .yml file found or your yml file is corrupt. Making assumptions.'

      project_name =  directory.split('/').last
      board_name   = directory.split('/').last
      default_list = 'To Do'
      excludes     = Array(nil)

    end

    {
     :project_name => project_name,
     :board_name   => board_name,
     :default_list => default_list,
     :excludes     => excludes
    }

  end

end
{'fraction_non_alphanumeric': 0.13415468856947296, 'fraction_numerical': 0.0006844626967830253, 'mean_word_length': 3.0164835164835164, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '5794339', 'n_tokens_mistral': 488, 'n_tokens_neox': 461, 'n_words': 98}