Sha256: 6d48cd167af142d7d82e2b1febf29300240660b595628a2d32d776f0f36cf603

Contents?: true

Size: 892 Bytes

Versions: 24

Compression:

Stored size: 892 Bytes

Contents

require "ftw"

# Experimentation with an agent configuration similar to Firefox's about:config
module FTW::Agent::Configuration
  # The config key for setting how many redirects will be followed before
  # giving up.
  REDIRECTION_LIMIT = "redirection-limit".freeze

  # SSL Trust Store
  SSL_TRUST_STORE = "ssl.trustdb".freeze

  private

  # Get the configuration hash
  def configuration
    return @configuration ||= default_configuration
  end # def configuration

  # default configuration
  def default_configuration
    require "tmpdir"
    home = File.join(ENV.fetch("HOME", tmpdir), ".ftw")
    return {
      REDIRECTION_LIMIT => 20,
      SSL_TRUST_STORE => File.join(home, "ssl-trust.db")
    }
  end # def default_configuration

  def tmpdir
    return File.join(Dir.tmpdir, "ftw-#{Process.uid}")
  end # def tmpdir

  public(:configuration)
end # def FTW::Agent::Configuration

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
ftw-0.0.40 lib/ftw/agent/configuration.rb
ftw-0.0.39 lib/ftw/agent/configuration.rb
ftw-0.0.38 lib/ftw/agent/configuration.rb
ftw-0.0.37 lib/ftw/agent/configuration.rb
ftw-0.0.36 lib/ftw/agent/configuration.rb
ftw-0.0.35 lib/ftw/agent/configuration.rb
ftw-0.0.34 lib/ftw/agent/configuration.rb
ftw-0.0.33 lib/ftw/agent/configuration.rb
ftw-0.0.32 lib/ftw/agent/configuration.rb
ftw-0.0.31 lib/ftw/agent/configuration.rb
ftw-0.0.30 lib/ftw/agent/configuration.rb
ftw-0.0.29 lib/ftw/agent/configuration.rb
ftw-0.0.28 lib/ftw/agent/configuration.rb
ftw-0.0.27 lib/ftw/agent/configuration.rb
ftw-0.0.26 lib/ftw/agent/configuration.rb
ftw-0.0.25 lib/ftw/agent/configuration.rb
ftw-0.0.24 lib/ftw/agent/configuration.rb
ftw-0.0.23 lib/ftw/agent/configuration.rb
ftw-0.0.22 lib/ftw/agent/configuration.rb
ftw-0.0.21 lib/ftw/agent/configuration.rb