<commit_before>module AsteriskMonitorConfig
  CONFIG_FILE_NAME = "config/asterisk.yml"

  private
  def self.load_config_from_file
    if File.exists? CONFIG_FILE_NAME
      YAML::load File.new(CONFIG_FILE_NAME).readlines.to_s
    else
      {}
    end
  end

  @config ||= load_config_from_file

  public
  def self.set_new_config(config)
    @config = config
  end

  class << self
    def host_data
      {:host => (@config["host"] or '127.0.0.1'), :port => (@config["port"] or 5038)}
    end

    def login_data
      {:username => @config["username"], :secret => @config["secret"]}
    end

    def originate_data
      {:channel => @config["channel"],
        :context => @config["secret"],
        :priority => (@config["priority"] or 1),
        :timeout => (@config["timeout"] or 10000)}
    end
  end
end
<commit_msg>Asterisk password was being sent instead of context<commit_after>module AsteriskMonitorConfig
  CONFIG_FILE_NAME = "config/asterisk.yml"

  private
  def self.load_config_from_file
    if File.exists? CONFIG_FILE_NAME
      YAML::load File.new(CONFIG_FILE_NAME).readlines.to_s
    else
      {}
    end
  end

  @config ||= load_config_from_file

  public
  def self.set_new_config(config)
    @config = config
  end

  class << self
    def host_data
      {:host => (@config["host"] or '127.0.0.1'), :port => (@config["port"] or 5038)}
    end

    def login_data
      {:username => @config["username"], :secret => @config["secret"]}
    end

    def originate_data
      {:channel => @config["channel"],
        :context => @config["context"],
        :priority => (@config["priority"] or 1),
        :timeout => (@config["timeout"] or 10000)}
    end
  end
end

{'fraction_non_alphanumeric': 0.14057885410513882, 'fraction_numerical': 0.018901358535144713, 'mean_word_length': 3.0721153846153846, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '4097544', 'n_tokens_mistral': 584, 'n_tokens_neox': 541, 'n_words': 127}