<commit_before>require 'travis/config'

module Travis
  class Config < Hashr
    HOSTS = {
      production:  'travis-ci.org',
      staging:     'staging.travis-ci.org',
      development: 'localhost:3000'
    }

    define  host:  'travis-ci.org',
            shorten_host:  'trvs.io',
            tokens:        { internal: 'token' },
            auth:          { target_origin: nil },
            assets:        { host: HOSTS[Travis.env.to_sym] },
            amqp:          { username: 'guest', password: '<PASSWORD>', host: 'localhost', prefetch: 1 },
            database:      { adapter: 'postgresql', database: "travis_#{Travis.env}", encoding: 'unicode', min_messages: 'warning' },
            s3:            { access_key_id: '', secret_access_key: '' },
            pusher:        { app_id: 'app-id', key: 'key', secret: 'secret' },
            sidekiq:       { namespace: 'sidekiq', pool_size: 1 },
            smtp:          {},
            email:         {},
            github:        { api_url: 'https://api.github.com', token: '<PASSWORD>' },
            async:         {},
            notifications: [], # TODO rename to event.handlers
            metrics:       { reporter: 'librato' },
            logger:        { thread_id: true },
            queues:        [],
            default_queue: 'builds.linux',
            jobs:          { retry: { after: 60 * 60 * 2, max_attempts: 1, interval: 60 * 5 } },
            queue:         { limit: { default: 5, by_owner: {} }, interval: 3 },
            logs:          { shards: 1, intervals: { vacuum: 10, regular: 180, force: 3 * 60 * 60 } },
            email:         {},
            roles:         {},
            archive:       {},
            ssl:           {},
            redis:         { url: 'redis://localhost:6379' },
            repository_filter: { include: [/^rails\/rails/], exclude: [/\/rails$/] },
            encryption:    Travis.env == 'development' || Travis.env == 'test' ? { key: 'secret' * 10 } : {},
            sync:          { organizations: { repositories_limit: 1000 } },
            states_cache:  { memcached_servers: 'localhost:11211' },
            sentry:        { },
            services:      { find_requests: { max_limit: 100, default_limit: 25 } },
            settings:      { timeouts: { defaults: { hard_limit: 50, log_silence: 10 }, maximums: { hard_limit: 180, log_silence: 60 } } }

    default :_access => [:key]

    def endpoints
      super || Hashr.new
    end
  end
end<commit_msg>add a default hash for config.endpoints<commit_after>require 'travis/config'

module Travis
  class Config < Hashr
    HOSTS = {
      production:  'travis-ci.org',
      staging:     'staging.travis-ci.org',
      development: 'localhost:3000'
    }

    define  host:  'travis-ci.org',
            shorten_host:  'trvs.io',
            tokens:        { internal: 'token' },
            auth:          { target_origin: nil },
            assets:        { host: HOSTS[Travis.env.to_sym] },
            amqp:          { username: 'guest', password: '<PASSWORD>', host: 'localhost', prefetch: 1 },
            database:      { adapter: 'postgresql', database: "travis_#{Travis.env}", encoding: 'unicode', min_messages: 'warning' },
            s3:            { access_key_id: '', secret_access_key: '' },
            pusher:        { app_id: 'app-id', key: 'key', secret: 'secret' },
            sidekiq:       { namespace: 'sidekiq', pool_size: 1 },
            smtp:          {},
            email:         {},
            github:        { api_url: 'https://api.github.com', token: '<PASSWORD>' },
            async:         {},
            notifications: [], # TODO rename to event.handlers
            metrics:       { reporter: 'librato' },
            logger:        { thread_id: true },
            queues:        [],
            default_queue: 'builds.linux',
            jobs:          { retry: { after: 60 * 60 * 2, max_attempts: 1, interval: 60 * 5 } },
            queue:         { limit: { default: 5, by_owner: {} }, interval: 3 },
            logs:          { shards: 1, intervals: { vacuum: 10, regular: 180, force: 3 * 60 * 60 } },
            email:         {},
            roles:         {},
            archive:       {},
            ssl:           {},
            redis:         { url: 'redis://localhost:6379' },
            repository_filter: { include: [/^rails\/rails/], exclude: [/\/rails$/] },
            encryption:    Travis.env == 'development' || Travis.env == 'test' ? { key: 'secret' * 10 } : {},
            sync:          { organizations: { repositories_limit: 1000 } },
            states_cache:  { memcached_servers: 'localhost:11211' },
            sentry:        { },
            services:      { find_requests: { max_limit: 100, default_limit: 25 } },
            settings:      { timeouts: { defaults: { hard_limit: 50, log_silence: 10 }, maximums: { hard_limit: 180, log_silence: 60 } } },
            endpoints:     { }

    default :_access => [:key]
  end
end
{'fraction_non_alphanumeric': 0.148, 'fraction_numerical': 0.0232, 'mean_word_length': 1.5992723492723493, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, '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': '944219', 'n_tokens_mistral': 1584, 'n_tokens_neox': 1469, 'n_words': 338}