Sha256: 47164283c96edce892ecbb431cead8e11a7bbca178018e828e2c9d5c687dd480

Contents?: true

Size: 1.3 KB

Versions: 16

Compression:

Stored size: 1.3 KB

Contents

# frozen_string_literal: true
require 'contracts'

require 'proxy_rb/version'
require 'proxy_rb/basic_configuration'

require 'proxy_rb/password_fetchers/basic_password_fetcher'
require 'proxy_rb/password_fetchers/environment_password_fetcher'

require 'proxy_rb/drivers/webkit_driver'

# ProxyRb
module ProxyRb
  # ProxyRb Configuration
  #
  # This defines the configuration options of proxy_rb
  class Configuration < BasicConfiguration
    option_accessor :password_fetcher, contract: { PasswordFetchers::BasicPasswordFetcher => PasswordFetchers::BasicPasswordFetcher }, default: ProxyRb::PasswordFetchers::EnvironmentPasswordFetcher.new(prefix: 'SECRET')
    option_accessor :driver, contract: { Drivers::BasicDriver => Drivers::BasicDriver }, default: ProxyRb::Drivers::WebkitDriver.new
    option_accessor :console_history_file, contract: { String => String }, default: '~/.proxy_rb_history'
    option_accessor :strict, contract: { Bool => Bool }, default: true
  end
end

# ProxyRb
module ProxyRb
  @config = Configuration.new

  class << self
    attr_reader :config

    # Configure proxy_rb
    #
    # @example How to configure proxy_rb
    #
    #   ProxyRb.configure do |config|
    #     config.<option> = <value>
    #   end
    #
    def configure(&block)
      @config.configure(&block)

      self
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
proxy_rb-1.0.0 lib/proxy_rb/configuration.rb
proxy_rb-0.10.6 lib/proxy_rb/configuration.rb
proxy_rb-0.10.5 lib/proxy_rb/configuration.rb
proxy_rb-0.10.4 lib/proxy_rb/configuration.rb
proxy_rb-0.10.3 lib/proxy_rb/configuration.rb
proxy_rb-0.10.2 lib/proxy_rb/configuration.rb
proxy_rb-0.10.1 lib/proxy_rb/configuration.rb
proxy_rb-0.10.0 lib/proxy_rb/configuration.rb
proxy_rb-0.9.3 lib/proxy_rb/configuration.rb
proxy_rb-0.9.2 lib/proxy_rb/configuration.rb
proxy_rb-0.9.1 lib/proxy_rb/configuration.rb
proxy_rb-0.9.0 lib/proxy_rb/configuration.rb
proxy_rb-0.8.3 lib/proxy_rb/configuration.rb
proxy_rb-0.8.2 lib/proxy_rb/configuration.rb
proxy_rb-0.8.1 lib/proxy_rb/configuration.rb
proxy_rb-0.8.0 lib/proxy_rb/configuration.rb