method
new2

v1_9_3_125 -
Show latest stable
-
0 notes -
Class: Client
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125 (0)
- 1_9_3_392 (0)
- 2_1_10 (38)
- 2_2_9 (0)
- 2_4_6
- 2_5_5
- 2_6_3
- What's this?
new2(uri, proxy=nil, timeout=nil)
public
Hide source
# File lib/xmlrpc/client.rb, line 340 def new2(uri, proxy=nil, timeout=nil) if match = /^([^:]+):\/\/(([^@]+)@)?([^\/]+)(\/.*)?$/.match(uri) proto = match[1] user, passwd = (match[3] || "").split(":") host, port = match[4].split(":") path = match[5] if proto != "http" and proto != "https" raise "Wrong protocol specified. Only http or https allowed!" end else raise "Wrong URI as parameter!" end proxy_host, proxy_port = (proxy || "").split(":") self.new(host, path, port, proxy_host, proxy_port, user, passwd, (proto == "https"), timeout) end