class Bugzilla::XMLRPC

rdoc

Bugzilla::XMLRPC

Attributes

token[RW]

Public Class Methods

new(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) click to toggle source

rdoc

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

# 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

Public Instance Methods

call(cmd, params = {}, user = nil, password = nil) click to toggle source

rdoc

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

# 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
use_ssl?() click to toggle source
# File lib/bugzilla/xmlrpc.rb, line 43
def use_ssl?
  @xmlrpc.http.use_ssl?
end