lib/httpx/plugins/proxy/ssh.rb in httpx-0.15.4 vs lib/httpx/plugins/proxy/ssh.rb in httpx-0.16.0

- old
+ new

@@ -4,20 +4,20 @@ module HTTPX module Plugins module Proxy module SSH - def self.load_dependencies(*) - require "net/ssh/gateway" + class << self + def load_dependencies(*) + require "net/ssh/gateway" + end end - def self.extra_options(options) - Class.new(options.class) do - def_option(:proxy, <<-OUT) - Hash[value] - OUT - end.new(options) + module OptionsMethods + def option_proxy(value) + Hash[value] + end end module InstanceMethods private @@ -63,10 +63,10 @@ io.post_connection_check(request_uri.host) if ctx.verify_mode != OpenSSL::SSL::VERIFY_NONE io when "http" TCPSocket.open("localhost", port) else - raise Error, "unexpected scheme: #{request_uri.scheme}" + raise TypeError, "unexpected scheme: #{request_uri.scheme}" end end end module ConnectionMethods