vendor/bundle/ruby/2.1.0/gems/httparty-0.13.0/lib/httparty/connection_adapter.rb
def connection
      host = clean_host(uri.host)
      if options[:http_proxyaddr]
        http = Net::HTTP.new(host, uri.port, options[:http_proxyaddr], options[:http_proxyport], options[:http_proxyuser], options[:http_proxypass])
      else
        http = Net::HTTP.new(host, uri.port)
      end

      http.use_ssl = ssl_implied?(uri)

      attach_ssl_certificates(http, options)

      if options[:timeout] && (options[:timeout].is_a?(Integer) || options[:timeout].is_a?(Float))
        http.open_timeout = options[:timeout]
        http.read_timeout = options[:timeout]
      end

      if options[:debug_output]
        http.set_debug_output(options[:debug_output])
      end

      if options[:ciphers]
        http.ciphers = options[:ciphers]
      end

      # Bind to a specific local address or port
      #
      # @see https://bugs.ruby-lang.org/issues/6617
      if options[:local_host]
        if RUBY_VERSION >= "2.0.0"
          http.local_host = options[:local_host]
        else
          Kernel.warn("Warning: option :local_host requires Ruby version 2.0 or later")
        end
      end

      if options[:local_port]
        if RUBY_VERSION >= "2.0.0"
          http.local_port = options[:local_port]
        else
          Kernel.warn("Warning: option :local_port requires Ruby version 2.0 or later")
        end
      end

      return http
    end
# Private: Regex used to strip brackets from IPv6 URIs.
Regex used to strip brackets from IPv6 URIs.
Regex used to strip brackets from IPv6 URIs .
def connection
      host = clean_host(uri.host)
      if options[:http_proxyaddr]
        http = Net::HTTP.new(host, uri.port, options[:http_proxyaddr], options[:http_proxyport], options[:http_proxyuser], options[:http_proxypass])
      else
        http = Net::HTTP.new(host, uri.port)
      end
      http.use_ssl = ssl_implied?(uri)
      attach_ssl_certificates(http, options)
      if options[:timeout] && (options[:timeout].is_a?(Integer) || options[:timeout].is_a?(Float))
        http.open_timeout = options[:timeout]
        http.read_timeout = options[:timeout]
      end
      if options[:debug_output]
        http.set_debug_output(options[:debug_output])
      end
      if options[:ciphers]
        http.ciphers = options[:ciphers]
      end
       @see https://bugs.ruby-lang.org/issues/6617
      if options[:local_host]
        if RUBY_VERSION >= "2.0.0"
          http.local_host = options[:local_host]
        else
          Kernel.warn("Warning: option :local_host requires Ruby version 2.0 or later")
        end
      end
      if options[:local_port]
        if RUBY_VERSION >= "2.0.0"
          http.local_port = options[:local_port]
        else
          Kernel.warn("Warning: option :local_port requires Ruby version 2.0 or later")
        end
      end
      return http
    end
def connection host = clean_host ( uri . host ) if options [ :http_proxyaddr ] http = Net :: HTTP . new ( host , uri . port , options [ :http_proxyaddr ] , options [ :http_proxyport ] , options [ :http_proxyuser ] , options [ :http_proxypass ] ) else http = Net :: HTTP . new ( host , uri . port ) end http . use_ssl = ssl_implied? ( uri ) attach_ssl_certificates ( http , options ) if options [ :timeout ] && ( options [ :timeout ] . is_a? ( Integer ) || options [ :timeout ] . is_a? ( Float ) ) http . open_timeout = options [ :timeout ] http . read_timeout = options [ :timeout ] end if options [ :debug_output ] http . set_debug_output ( options [ :debug_output ] ) end if options [ :ciphers ] http . ciphers = options [ :ciphers ] end if options [ :local_host ] if RUBY_VERSION >= "2.0.0" http . local_host = options [ :local_host ] else Kernel . warn ( "Warning: option :local_host requires Ruby version 2.0 or later" ) end end if options [ :local_port ] if RUBY_VERSION >= "2.0.0" http . local_port = options [ :local_port ] else Kernel . warn ( "Warning: option :local_port requires Ruby version 2.0 or later" ) end end return http end
Private: Regex used to strip brackets from IPv6 URIs.
Private : Regex used to strip brackets from IPv6 URIs .
# Bind to a specific local address or port # # @see https://bugs.ruby-lang.org/issues/6617