Class: Bugzilla::XMLRPC

Inherits:
Object
  • Object
show all
Defined in:
lib/bugzilla/xmlrpc.rb

Overview

rdoc

Bugzilla::XMLRPC

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host, port: 443, path: '/xmlrpc.cgi', proxy_host: nil, proxy_port: nil, timeout: 60, http_basic_auth_user: nil, http_basic_auth_pass: nil, debug: false) ⇒ XMLRPC

rdoc

Bugzilla::XMLRPC#new(host, port = 443, path = ‘/xmlrpc.cgi’, proxy_host = nil, proxy_port = nil)



33
34
35
36
37
38
39
40
41
# File 'lib/bugzilla/xmlrpc.rb', line 33

def initialize(host, port: 443, path: '/xmlrpc.cgi', proxy_host: nil,
               proxy_port: nil, timeout: 60, http_basic_auth_user: nil, http_basic_auth_pass: nil, debug: false)
  path ||= '/xmlrpc.cgi'
  use_ssl = port == 443
  @xmlrpc = ::XMLRPC::Client.new(host, path, port, proxy_host, proxy_port, http_basic_auth_user, http_basic_auth_pass, use_ssl, timeout)
  # workaround for https://bugs.ruby-lang.org/issues/8182
  @xmlrpc.http_header_extra = { 'accept-encoding' => 'identity' }
  @xmlrpc.http.set_debug_output($stdout) if debug
end

Instance Attribute Details

#tokenObject

rdoc

Bugzilla::XMLRPC#token



83
84
85
# File 'lib/bugzilla/xmlrpc.rb', line 83

def token
  @token
end

Instance Method Details

#call(cmd, params = {}, user = nil, password = nil) ⇒ Object

rdoc

Bugzilla::XMLRPC#call(cmd, params, user = nil, password = nil)



52
53
54
55
56
57
58
# File 'lib/bugzilla/xmlrpc.rb', line 52

def call(cmd, params = {}, user = nil, password = nil)
  params = {} if params.nil?
  params['Bugzilla_login'] = user unless user.nil? || password.nil?
  params['Bugzilla_password'] = password unless user.nil? || password.nil?
  params['Bugzilla_token'] = @token unless @token.nil?
  @xmlrpc.call(cmd, params)
end

rdoc

Bugzilla::XMLRPC#cookie



65
66
67
# File 'lib/bugzilla/xmlrpc.rb', line 65

def cookie
  @xmlrpc.cookie
end

#cookie=(val) ⇒ Object

rdoc

Bugzilla::XMLRPC#cookie=(val)



74
75
76
# File 'lib/bugzilla/xmlrpc.rb', line 74

def cookie=(val)
  @xmlrpc.cookie = val
end

#use_ssl?Boolean

def initialize

Returns:

  • (Boolean)


43
44
45
# File 'lib/bugzilla/xmlrpc.rb', line 43

def use_ssl?
  @xmlrpc.http.use_ssl?
end