<commit_before>require 'yaml'
require 'hashie/dash'

module Travis
  module Worker
    DIRECTORIES = ['.', '~', '/etc']

    # Environment-aware worker configuration.
    #
    # ### Environment variables
    #
    # Environment (development, test, production and so on) is set using TRAVIS_ENV env variable, default value is *test*.
    # Redis connection URI is set using REDIS_URL env variable.
    #
    # @see Travis::Job::Base
    class Config < Hashie::Dash

      #
      # API
      #

      property :redis,    :default => Hashie::Mash.new(:url => ENV['REDIS_URL'])
      property :reporter, :default => Hashie::Mash.new(:http => Hashie::Mash.new)
      property :shell,    :default => Hashie::Mash.new(:buffer => 0)
      property :workers,  :default => 3
      property :timeouts, :default => Hashie::Mash.new(:before_script => 120, :after_script => 120, :script => 600, :bundle => 300)

      def initialize
        super(Hashie::Mash.new(load[environment]))
      end

      # @return [String] Environment Travis worker runs in. Typically one of: development, test, staging, production
      def environment
        ENV['TRAVIS_ENV'] || 'test'
      end

      def load
        YAML.load_file(filename)
      end

      def filename
        DIRECTORIES.each do |directory|
          filename = File.expand_path('.travis.yml', directory)
          return filename if File.exists?(filename)
        end
        raise "Could not find a .travis.yml configuration file. Valid locations are: #{DIRECTORIES.join(', ')}"
      end
    end # Config
  end # Worker
end # Travis
<commit_msg>Add AMQP options to app-wide configuration<commit_after>require 'yaml'
require 'hashie/dash'

module Travis
  module Worker
    DIRECTORIES = ['.', '~', '/etc']

    # Environment-aware worker configuration.
    #
    # ### Environment variables
    #
    # Environment (development, test, production and so on) is set using TRAVIS_ENV env variable, default value is *test*.
    # Redis connection URI is set using REDIS_URL env variable.
    #
    # @see Travis::Job::Base
    class Config < Hashie::Dash

      #
      # API
      #

      property :amqp,     :default => Hashie::Mash.new(:username => "guest", :password => "<PASSWORD>", :host => "localhost", :vhost => "travis")

      property :redis,    :default => Hashie::Mash.new(:url => ENV['REDIS_URL'])
      property :reporter, :default => Hashie::Mash.new(:http => Hashie::Mash.new)
      property :shell,    :default => Hashie::Mash.new(:buffer => 0)
      property :workers,  :default => 3
      property :timeouts, :default => Hashie::Mash.new(:before_script => 120, :after_script => 120, :script => 600, :bundle => 300)

      def initialize
        super(Hashie::Mash.new(load[environment]))
      end

      # @return [String] Environment Travis worker runs in. Typically one of: development, test, staging, production
      def environment
        ENV['TRAVIS_ENV'] || 'test'
      end

      def load
        YAML.load_file(filename)
      end

      def filename
        DIRECTORIES.each do |directory|
          filename = File.expand_path('.travis.yml', directory)
          return filename if File.exists?(filename)
        end
        raise "Could not find a .travis.yml configuration file. Valid locations are: #{DIRECTORIES.join(', ')}"
      end
    end # Config
  end # Worker
end # Travis

{'fraction_non_alphanumeric': 0.12604042806183116, 'fraction_numerical': 0.008323424494649227, 'mean_word_length': 2.77665544332211, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 33, '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': '3683095', 'n_tokens_mistral': 1047, 'n_tokens_neox': 981, 'n_words': 288}