<commit_before>module VoxeoLabs
  class Config
    require 'pathname'
    require 'yaml'

    attr_reader :bucket_name, :aws_secret, :aws_key, :project_name

    def initialize(dir,file_name=".deployer")

      Pathname.new(dir).ascend do |dir|
        config_file = dir + file_name

        if dir.children.include?(config_file)
          merge_config(YAML::load_file(config_file))
        end

      end

    end

    private

    def merge_config(config)

      if config['bucket_name']
        @bucket_name = config['bucket_name'] unless @bucket_name
      end

      if config['aws_secret']
        @aws_secret = config['aws_secret'] unless @aws_secret
      end

      if config['aws_key']
        @aws_key = config['aws_key'] unless @aws_key
      end

      if config['project_name']
        @project_name = c['project_name'] unless @project_name
      end

    end

  end
end

a = VoxeoLabs::Config.new
p a#.project_name<commit_msg>removed some code no longer in use<commit_after>module VoxeoLabs
  class Config
    require 'pathname'
    require 'yaml'

    attr_reader :bucket_name, :aws_secret, :aws_key, :project_name

    def initialize(dir,file_name=".deployer")

      Pathname.new(dir).ascend do |dir|
        config_file = dir + file_name

        if dir.children.include?(config_file)
          merge_config(YAML::load_file(config_file))
        end

      end

    end

    private

    def merge_config(config)

      if config['bucket_name']
        @bucket_name = config['bucket_name'] unless @bucket_name
      end

      if config['aws_secret']
        @aws_secret = config['aws_secret'] unless @aws_secret
      end

      if config['aws_key']
        @aws_key = config['aws_key'] unless @aws_key
      end

      if config['project_name']
        @project_name = c['project_name'] unless @project_name
      end

    end

  end
end
{'fraction_non_alphanumeric': 0.09580193756727665, 'fraction_numerical': 0.0, 'mean_word_length': 2.6522593320235757, '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': '635826', 'n_tokens_mistral': 613, 'n_tokens_neox': 577, 'n_words': 131}