Sha256: 9ebbf95d7a233df63a45edc5d96566ddc571ef992605d64ab49967867dfe773d

Contents?: true

Size: 1.04 KB

Versions: 32

Compression:

Stored size: 1.04 KB

Contents

require 'bearcat/version'
require 'bearcat/client'

module Bearcat
  class << self
    require 'logger'
    attr_writer :enforce_rate_limits, :rate_limit_min, :rate_limits, :max_sleep_seconds,
                :min_sleep_seconds, :logger, :master_rate_limit, :master_mutex,
                :rate_limit_threshold

    def configure
      yield self if block_given?
    end

    def rate_limit_min
      @rate_limit_min ||= 175
    end

    def enforce_rate_limits
      @enforce_rate_limits ||= false
    end

    def rate_limits
      @rate_limits ||= {}
    end

    def max_sleep_seconds
      @max_sleep_seconds ||= 60
    end

    def master_rate_limit
      @master_rate_limit ||= false
    end

    def master_mutex
      @master_mutex ||= Mutex.new
    end

    def rate_limit_threshold
      @rate_limit_threshold ||= 125
    end

    def logger
      return @logger if defined? @logger
      @logger = Logger.new(STDOUT)
      @logger.level = Logger::DEBUG
      @logger
    end

    def min_sleep_seconds
      @min_sleep_seconds ||= 5
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
bearcat-1.4.13 lib/bearcat.rb
bearcat-1.4.12 lib/bearcat.rb
bearcat-1.4.11 lib/bearcat.rb
bearcat-1.4.10 lib/bearcat.rb
bearcat-1.4.9 lib/bearcat.rb
bearcat-1.4.8 lib/bearcat.rb
bearcat-1.4.7 lib/bearcat.rb
bearcat-1.4.6 lib/bearcat.rb
bearcat-1.4.5 lib/bearcat.rb
bearcat-1.4.4 lib/bearcat.rb
bearcat-1.4.3 lib/bearcat.rb
bearcat-1.4.2 lib/bearcat.rb
bearcat-1.4.1 lib/bearcat.rb
bearcat-1.4.0 lib/bearcat.rb
bearcat-1.3.55 lib/bearcat.rb
bearcat-1.3.53 lib/bearcat.rb
bearcat-1.3.52 lib/bearcat.rb
bearcat-1.3.51 lib/bearcat.rb
bearcat-1.3.49 lib/bearcat.rb
bearcat-1.3.48 lib/bearcat.rb