Sha256: ebc072ea5d90b81365e1cd75a46c87a86cc4dd883d5c8e617c0cfad9a6bcdbbe

Contents?: true

Size: 845 Bytes

Versions: 3

Compression:

Stored size: 845 Bytes

Contents

module OpenX
  autoload :Image, 'openx/image'
  autoload :Invocation, 'openx/invocation'
  autoload :Services, 'openx/services'
  autoload :XmlrpcClient, 'openx/xmlrpc_client'
  autoload :XmlrpcSessionClient, 'openx/xmlrpc_client'

  @@env           = ENV['OPENX_ENV'] || 'production'
  @@config_file   = File.join(ENV['HOME'], '.openx', 'credentials.yml')
  @@configuration = nil

  DEFAULT_OPTIONS = { 'retry' => true, 'timeout' => 10 }

  class << self

    def env
      @@env
    end

    def env=(value)
      @@env = value
    end

    def configuration
      @@configuration ||= DEFAULT_OPTIONS.merge(YAML.load_file(config_file)[env])
    end

    def configuration=(value)
      @@configuration = value
    end

    def config_file
      @@config_file
    end

    def config_file=(value)
      @@config_file = value
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bsm-openx-1.9.3 lib/openx.rb
bsm-openx-1.9.2 lib/openx.rb
bsm-openx-1.9.1 lib/openx.rb