Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 96784 | Differences between
and this patch

Collapse All | Expand All

(-)lib/xmlrpc/client.rb.org (-9 / +20 lines)
Lines 69-74 Link Here
69
    Parameter ((|timeout|)) is the time to wait for a XML-RPC response, defaults to 30.
69
    Parameter ((|timeout|)) is the time to wait for a XML-RPC response, defaults to 30.
70
70
71
--- XMLRPC::Client.new2( uri, proxy=nil, timeout=nil)
71
--- XMLRPC::Client.new2( uri, proxy=nil, timeout=nil)
72
--- XMLRPC::Client.new_from_uri( uri, proxy=nil, timeout=nil)
72
:   uri
73
:   uri
73
    URI specifying protocol (http or https), host, port, path, user and password.
74
    URI specifying protocol (http or https), host, port, path, user and password.
74
    Example: https://user:password@host:port/path
75
    Example: https://user:password@host:port/path
Lines 80-85 Link Here
80
    Defaults to 30. 
81
    Defaults to 30. 
81
82
82
--- XMLRPC::Client.new3( hash={} )
83
--- XMLRPC::Client.new3( hash={} )
84
--- XMLRPC::Client.new_from_hash( hash={} )
83
    Parameter ((|hash|)) has following case-insensitive keys:
85
    Parameter ((|hash|)) has following case-insensitive keys:
84
    * host
86
    * host
85
    * path
87
    * path
Lines 135-140 Link Here
135
    (({XMLRPC::FaultException})). 
137
    (({XMLRPC::FaultException})). 
136
    Both are explained in ((<call|XMLRPC::Client#call>)).
138
    Both are explained in ((<call|XMLRPC::Client#call>)).
137
139
140
    Simple to remember: The "2" in "call2" denotes the number of values it returns.
141
138
--- XMLRPC::Client#multicall( *methods )
142
--- XMLRPC::Client#multicall( *methods )
139
    You can use this method to execute several methods on a XMLRPC server which supports
143
    You can use this method to execute several methods on a XMLRPC server which supports
140
    the multi-call extension.
144
    the multi-call extension.
Lines 264-270 Link Here
264
268
265
269
266
= History
270
= History
267
    $Id: client.rb,v 1.2 2003/11/17 21:30:31 mneumann Exp $
271
    $Id: client.rb,v 1.4 2005/06/19 15:47:31 mneumann Exp $
268
272
269
=end
273
=end
270
274
Lines 331-337 Link Here
331
    end
335
    end
332
336
333
337
334
    def self.new2(uri, proxy=nil, timeout=nil)
338
    class << self
339
340
    def new2(uri, proxy=nil, timeout=nil)
335
      if match = /^([^:]+):\/\/(([^@]+)@)?([^\/]+)(\/.*)?$/.match(uri)
341
      if match = /^([^:]+):\/\/(([^@]+)@)?([^\/]+)(\/.*)?$/.match(uri)
336
        proto = match[1]
342
        proto = match[1]
337
        user, passwd = (match[3] || "").split(":")
343
        user, passwd = (match[3] || "").split(":")
Lines 350-358 Link Here
350
356
351
      self.new(host, path, port, proxy_host, proxy_port, user, passwd, (proto == "https"), timeout)
357
      self.new(host, path, port, proxy_host, proxy_port, user, passwd, (proto == "https"), timeout)
352
    end
358
    end
353
 
354
359
355
    def self.new3(hash={})
360
    alias new_from_uri new2
361
362
    def new3(hash={})
356
363
357
      # convert all keys into lowercase strings
364
      # convert all keys into lowercase strings
358
      h = {}
365
      h = {}
Lines 362-367 Link Here
362
               h['use_ssl'], h['timeout'])
369
               h['use_ssl'], h['timeout'])
363
    end
370
    end
364
371
372
    alias new_from_hash new3
373
374
    end
375
365
376
366
    # Attribute Accessors -------------------------------------------------------------------
377
    # Attribute Accessors -------------------------------------------------------------------
367
378
Lines 457-475 Link Here
457
468
458
    # Proxy generating methods ------------------------------------------
469
    # Proxy generating methods ------------------------------------------
459
    
470
    
460
    def proxy(prefix, *args)
471
    def proxy(prefix=nil, *args)
461
      Proxy.new(self, prefix, args, :call)
472
      Proxy.new(self, prefix, args, :call)
462
    end
473
    end
463
474
464
    def proxy2(prefix, *args)
475
    def proxy2(prefix=nil, *args)
465
      Proxy.new(self, prefix, args, :call2)
476
      Proxy.new(self, prefix, args, :call2)
466
    end
477
    end
467
478
468
    def proxy_async(prefix, *args)
479
    def proxy_async(prefix=nil, *args)
469
      Proxy.new(self, prefix, args, :call_async)
480
      Proxy.new(self, prefix, args, :call_async)
470
    end
481
    end
471
482
472
    def proxy2_async(prefix, *args)
483
    def proxy2_async(prefix=nil, *args)
473
      Proxy.new(self, prefix, args, :call2_async)
484
      Proxy.new(self, prefix, args, :call2_async)
474
    end
485
    end
475
486
Lines 586-592 Link Here
586
597
587
      def initialize(server, prefix, args=[], meth=:call, delim=".")
598
      def initialize(server, prefix, args=[], meth=:call, delim=".")
588
	@server = server
599
	@server = server
589
	@prefix = prefix + delim
600
	@prefix = prefix ? prefix + delim : ""
590
	@args   = args 
601
	@args   = args 
591
        @meth   = meth
602
        @meth   = meth
592
      end
603
      end

Return to bug 96784