Sha256: 5d06f8e89b29f81c7a79a0e587d7e05c17ae0e515fa63ed393c475c82adb8294

Contents?: true

Size: 519 Bytes

Versions: 33

Compression:

Stored size: 519 Bytes

Contents

module CFoundry
  module ProxyOptions
    def proxy_options_for(uri)
      ssl = uri.is_a?(URI::HTTPS)
      proxy_to_use = (ssl ? https_proxy : http_proxy)

      if proxy_to_use.blank?
        []
      else
        proxy_to_use = "proto://#{proxy_to_use}" unless proxy_to_use =~ /:\/\//
        proxy_uri = URI.parse(proxy_to_use)
        proxy_user, proxy_password = proxy_uri.userinfo.split(/:/) if proxy_uri.userinfo
        [proxy_uri.host, proxy_uri.port, proxy_user, proxy_password]
      end
    end
  end
end

Version data entries

33 entries across 33 versions & 2 rubygems

Version Path
new_cfoundry-4.8.3 lib/cfoundry/concerns/proxy_options.rb
new_cfoundry-4.8.2 lib/cfoundry/concerns/proxy_options.rb
cfoundry-4.7.2.rc1 lib/cfoundry/concerns/proxy_options.rb
cfoundry-4.7.1 lib/cfoundry/concerns/proxy_options.rb
cfoundry-4.7.1.rc1 lib/cfoundry/concerns/proxy_options.rb
cfoundry-4.7.0 lib/cfoundry/concerns/proxy_options.rb
cfoundry-4.6.3.rc3 lib/cfoundry/concerns/proxy_options.rb
cfoundry-4.6.3.rc2 lib/cfoundry/concerns/proxy_options.rb
cfoundry-4.6.3.rc1 lib/cfoundry/concerns/proxy_options.rb
cfoundry-4.6.2 lib/cfoundry/concerns/proxy_options.rb
cfoundry-4.6.1 lib/cfoundry/concerns/proxy_options.rb
cfoundry-4.6.0 lib/cfoundry/concerns/proxy_options.rb
cfoundry-4.5.3 lib/cfoundry/concerns/proxy_options.rb
cfoundry-4.5.2 lib/cfoundry/concerns/proxy_options.rb
cfoundry-4.5.1 lib/cfoundry/concerns/proxy_options.rb
cfoundry-4.5.0 lib/cfoundry/concerns/proxy_options.rb
cfoundry-4.3.12 lib/cfoundry/concerns/proxy_options.rb
cfoundry-4.3.11 lib/cfoundry/concerns/proxy_options.rb
cfoundry-4.3.10 lib/cfoundry/concerns/proxy_options.rb
cfoundry-4.3.9 lib/cfoundry/concerns/proxy_options.rb