ruby-bugzilla 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bugzilla/version.rb +1 -1
- metadata +11 -15
- data/lib/bugzilla/bugzilla.rb~ +0 -161
- data/lib/bugzilla/skeleton.rb~ +0 -48
- data/lib/bugzilla/user.rb~ +0 -146
- data/lib/bugzilla/version.rb~ +0 -31
- data/lib/bugzilla/xmlrpc.rb~ +0 -100
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70c304ab94d3415a420efdaa9e56db36cb6e97f1
|
4
|
+
data.tar.gz: df4153ad143ca24560a2d9af0ce4c37a585abbfc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b39f1d7b94b245423c9683d947a8ea4bfcb5ec25084b75930daee6ff0f58271c246e495b5f55cde967bf783bb426301700d5770f09ef814d1429b33c83a157c3
|
7
|
+
data.tar.gz: 1f24843f384cdf3764ee06392f2d73ba2064f858e576e39a3564863fe400f86ca4a58ae1229a7285cde8e203206e4f8b2b456a6a5934d483a7eed7f03c5032c8
|
data/lib/bugzilla/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-bugzilla
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Akira TAGOH
|
@@ -28,56 +28,56 @@ dependencies:
|
|
28
28
|
name: gruff
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: highline
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rmagick
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: bundler
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '1.0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '1.0'
|
83
83
|
description: This aims to provide similar features to access to Bugzilla through WebService
|
@@ -96,23 +96,19 @@ files:
|
|
96
96
|
- lib/bugzilla/api_tmpl.rb
|
97
97
|
- lib/bugzilla/bug.rb
|
98
98
|
- lib/bugzilla/bugzilla.rb
|
99
|
-
- lib/bugzilla/bugzilla.rb~
|
100
99
|
- lib/bugzilla/classification.rb
|
101
100
|
- lib/bugzilla/group.rb
|
102
101
|
- lib/bugzilla/plugin.rb
|
103
102
|
- lib/bugzilla/product.rb
|
104
103
|
- lib/bugzilla/skeleton.rb
|
105
|
-
- lib/bugzilla/skeleton.rb~
|
106
104
|
- lib/bugzilla/user.rb
|
107
|
-
- lib/bugzilla/user.rb~
|
108
105
|
- lib/bugzilla/version.rb
|
109
|
-
- lib/bugzilla/version.rb~
|
110
106
|
- lib/bugzilla/xmlrpc.rb
|
111
|
-
- lib/bugzilla/xmlrpc.rb~
|
112
107
|
- lib/ruby-bugzilla/nvbugzilla.rb
|
113
108
|
- lib/ruby-bugzilla/rhbugzilla.rb
|
114
109
|
homepage: http://rubygems.org/gems/ruby-bugzilla
|
115
|
-
licenses:
|
110
|
+
licenses:
|
111
|
+
- LGPL-3.0+
|
116
112
|
metadata: {}
|
117
113
|
post_install_message:
|
118
114
|
rdoc_options: []
|
data/lib/bugzilla/bugzilla.rb~
DELETED
@@ -1,161 +0,0 @@
|
|
1
|
-
# bugzilla.rb
|
2
|
-
# Copyright (C) 2010-2012 Red Hat, Inc.
|
3
|
-
#
|
4
|
-
# Authors:
|
5
|
-
# Akira TAGOH <tagoh@redhat.com>
|
6
|
-
#
|
7
|
-
# This library is free software: you can redistribute it and/or
|
8
|
-
# modify it under the terms of the GNU Lesser General Public
|
9
|
-
# License as published by the Free Software Foundation, either
|
10
|
-
# version 3 of the License, or (at your option) any later version.
|
11
|
-
#
|
12
|
-
# This library is distributed in the hope that it will be useful,
|
13
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
-
# GNU General Public License for more details.
|
16
|
-
#
|
17
|
-
# You should have received a copy of the GNU General Public License
|
18
|
-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
19
|
-
|
20
|
-
require 'bugzilla/skeleton'
|
21
|
-
|
22
|
-
module Bugzilla
|
23
|
-
|
24
|
-
=begin rdoc
|
25
|
-
|
26
|
-
=== Bugzilla::Bugzilla
|
27
|
-
|
28
|
-
Bugzilla::Bugzilla class is to access the
|
29
|
-
Bugzilla::WebService::Bugzilla API that provides functions
|
30
|
-
tell you about Bugzilla in general.
|
31
|
-
|
32
|
-
=end
|
33
|
-
|
34
|
-
class Bugzilla < Skeleton
|
35
|
-
|
36
|
-
=begin rdoc
|
37
|
-
|
38
|
-
==== Bugzilla::Bugzilla#check_version(version_)
|
39
|
-
|
40
|
-
Returns Array contains the result of the version check and
|
41
|
-
Bugzilla version that is running on.
|
42
|
-
|
43
|
-
=end
|
44
|
-
|
45
|
-
def check_version(version_)
|
46
|
-
v = version
|
47
|
-
f = false
|
48
|
-
if v.kind_of?(Hash) && v.include?("version") &&
|
49
|
-
v['version'] >= "#{version_}" then
|
50
|
-
f = true
|
51
|
-
end
|
52
|
-
|
53
|
-
[f, v['version']]
|
54
|
-
end # def check_version
|
55
|
-
|
56
|
-
=begin rdoc
|
57
|
-
|
58
|
-
==== Bugzilla::Bugzilla#requires_version(cmd, version_)
|
59
|
-
|
60
|
-
Raise an exception if the Bugzilla doesn't satisfy
|
61
|
-
the requirement of the _version_.
|
62
|
-
|
63
|
-
=end
|
64
|
-
|
65
|
-
def requires_version(cmd, version_)
|
66
|
-
v = check_version(version_)
|
67
|
-
raise NoMethodError, sprintf("%s is not supported in Bugzilla %s", cmd, v[1]) unless v[0]
|
68
|
-
end # def requires_version
|
69
|
-
|
70
|
-
=begin rdoc
|
71
|
-
|
72
|
-
==== Bugzilla::Bugzilla#version
|
73
|
-
|
74
|
-
Raw Bugzilla API to obtain the Bugzilla version.
|
75
|
-
|
76
|
-
See http://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Bugzilla.html
|
77
|
-
|
78
|
-
=end
|
79
|
-
|
80
|
-
=begin rdoc
|
81
|
-
|
82
|
-
==== Bugzilla::Bugzilla#extensions
|
83
|
-
|
84
|
-
Raw Bugzilla API to obtain the information about
|
85
|
-
the extensions that are currently installed and enabled in
|
86
|
-
the Bugzilla.
|
87
|
-
|
88
|
-
See http://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Bugzilla.html
|
89
|
-
|
90
|
-
=end
|
91
|
-
|
92
|
-
=begin rdoc
|
93
|
-
|
94
|
-
==== Bugzilla::Bugzilla#timezone
|
95
|
-
|
96
|
-
Raw Bugzilla API to obtain the timezone that Bugzilla
|
97
|
-
expects dates and times in.
|
98
|
-
|
99
|
-
See http://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Bugzilla.html
|
100
|
-
|
101
|
-
=end
|
102
|
-
|
103
|
-
=begin rdoc
|
104
|
-
|
105
|
-
==== Bugzilla::Bugzilla#time
|
106
|
-
|
107
|
-
Raw Bugzilla API to obtain the information about what time
|
108
|
-
the bugzilla server thinks it is, and what timezone it's
|
109
|
-
running on.
|
110
|
-
|
111
|
-
See http://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Bugzilla.html
|
112
|
-
|
113
|
-
=end
|
114
|
-
|
115
|
-
=begin rdoc
|
116
|
-
|
117
|
-
==== Bugzilla::Bugzilla#parameters
|
118
|
-
|
119
|
-
Raw Bugzilla API to obtain parameter values currently used in Bugzilla.
|
120
|
-
|
121
|
-
See http://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Bugzilla.html
|
122
|
-
|
123
|
-
=end
|
124
|
-
|
125
|
-
protected
|
126
|
-
|
127
|
-
def _version(cmd, *args)
|
128
|
-
@iface.call(cmd)
|
129
|
-
end # def _version
|
130
|
-
|
131
|
-
def _extensions(cmd, *args)
|
132
|
-
requires_version(cmd, 3.2)
|
133
|
-
|
134
|
-
@iface.call(cmd)
|
135
|
-
end # def _extensions
|
136
|
-
|
137
|
-
def _timezone(cmd, *args)
|
138
|
-
@iface.call(cmd)
|
139
|
-
end # def _timezone
|
140
|
-
|
141
|
-
def _time(cmd, *args)
|
142
|
-
requires_version(cmd, 3.4)
|
143
|
-
|
144
|
-
@iface.call(cmd)
|
145
|
-
end # def _time
|
146
|
-
|
147
|
-
def _parameters(cmd, *args)
|
148
|
-
requires_version(cmd, 4.4)
|
149
|
-
|
150
|
-
@iface.call(cmd)
|
151
|
-
end # def _parameters
|
152
|
-
|
153
|
-
def __last_audit_time(cmd, *args)
|
154
|
-
requires_version(cmd, 4.4)
|
155
|
-
|
156
|
-
# FIXME
|
157
|
-
end # def _last_audit_time
|
158
|
-
|
159
|
-
end # class Bugzilla
|
160
|
-
|
161
|
-
end # module Bugzilla
|
data/lib/bugzilla/skeleton.rb~
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
# skeleton.rb
|
2
|
-
# Copyright (C) 2010-2012 Red Hat, Inc.
|
3
|
-
#
|
4
|
-
# Authors:
|
5
|
-
# Akira TAGOH <tagoh@redhat.com>
|
6
|
-
#
|
7
|
-
# This library is free software: you can redistribute it and/or
|
8
|
-
# modify it under the terms of the GNU Lesser General Public
|
9
|
-
# License as published by the Free Software Foundation, either
|
10
|
-
# version 3 of the License, or (at your option) any later version.
|
11
|
-
#
|
12
|
-
# This library is distributed in the hope that it will be useful,
|
13
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
-
# GNU General Public License for more details.
|
16
|
-
#
|
17
|
-
# You should have received a copy of the GNU General Public License
|
18
|
-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
19
|
-
|
20
|
-
|
21
|
-
module Bugzilla
|
22
|
-
|
23
|
-
=begin rdoc
|
24
|
-
|
25
|
-
=== Bugzilla::Skeleton
|
26
|
-
|
27
|
-
=end
|
28
|
-
|
29
|
-
class Skeleton
|
30
|
-
|
31
|
-
def initialize(iface)
|
32
|
-
@iface = iface
|
33
|
-
end # def initialize
|
34
|
-
|
35
|
-
def method_missing(symbol, *args)
|
36
|
-
m = "_#{symbol}"
|
37
|
-
klass = self.class.to_s.sub(/\ABugzilla::/, '')
|
38
|
-
fm = "#{klass}.#{symbol}"
|
39
|
-
if self.respond_to?(m) then
|
40
|
-
__send__(m, fm, *args)
|
41
|
-
else
|
42
|
-
raise NoMethodError, sprintf("No such Bugzilla APIs: %s.%s", klass, symbol)
|
43
|
-
end
|
44
|
-
end # def method_missing
|
45
|
-
|
46
|
-
end # class Skeleton
|
47
|
-
|
48
|
-
end # module Bugzilla
|
data/lib/bugzilla/user.rb~
DELETED
@@ -1,146 +0,0 @@
|
|
1
|
-
# user.rb
|
2
|
-
# Copyright (C) 2010-2014 Red Hat, Inc.
|
3
|
-
#
|
4
|
-
# Authors:
|
5
|
-
# Akira TAGOH <tagoh@redhat.com>
|
6
|
-
#
|
7
|
-
# This library is free software: you can redistribute it and/or
|
8
|
-
# modify it under the terms of the GNU Lesser General Public
|
9
|
-
# License as published by the Free Software Foundation, either
|
10
|
-
# version 3 of the License, or (at your option) any later version.
|
11
|
-
#
|
12
|
-
# This library is distributed in the hope that it will be useful,
|
13
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
-
# GNU General Public License for more details.
|
16
|
-
#
|
17
|
-
# You should have received a copy of the GNU General Public License
|
18
|
-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
19
|
-
|
20
|
-
require 'yaml'
|
21
|
-
require 'bugzilla/api_tmpl'
|
22
|
-
|
23
|
-
module Bugzilla
|
24
|
-
|
25
|
-
=begin rdoc
|
26
|
-
|
27
|
-
=== Bugzilla::User
|
28
|
-
|
29
|
-
Bugzilla::User class is to access the
|
30
|
-
Bugzilla::WebService::User API that allows you to create
|
31
|
-
User Accounts and log in/out using an existing account.
|
32
|
-
|
33
|
-
=end
|
34
|
-
|
35
|
-
class User < APITemplate
|
36
|
-
|
37
|
-
=begin rdoc
|
38
|
-
|
39
|
-
==== Bugzilla::User#session(user, password)
|
40
|
-
|
41
|
-
Keeps the bugzilla session during doing something in the block.
|
42
|
-
|
43
|
-
=end
|
44
|
-
|
45
|
-
def session(user, password)
|
46
|
-
r = check_version('4.4.3')
|
47
|
-
key = :cookie
|
48
|
-
if r[0] then
|
49
|
-
# Usisng tokens
|
50
|
-
key = :token
|
51
|
-
fname = File.join(ENV['HOME'], '.ruby-bugzilla-token.yml')
|
52
|
-
else
|
53
|
-
fname = File.join(ENV['HOME'], '.ruby-bugzilla-cookie.yml')
|
54
|
-
end
|
55
|
-
host = @iface.instance_variable_get(:@xmlrpc).instance_variable_get(:@host)
|
56
|
-
val = nil
|
57
|
-
|
58
|
-
if File.exist?(fname) && File.lstat(fname).mode & 0600 == 0600 then
|
59
|
-
conf = YAML.load(File.open(fname).read)
|
60
|
-
val = conf[host]
|
61
|
-
else
|
62
|
-
conf = {}
|
63
|
-
end
|
64
|
-
if !val.nil? then
|
65
|
-
if key == :token then
|
66
|
-
print "Using token\n"
|
67
|
-
@iface.token = val
|
68
|
-
else
|
69
|
-
print "Using cookie\n"
|
70
|
-
@iface.cookie = cookie
|
71
|
-
end
|
72
|
-
yield
|
73
|
-
elsif user.nil? || password.nil? then
|
74
|
-
yield
|
75
|
-
return
|
76
|
-
else
|
77
|
-
login({'login'=>user, 'password'=>password, 'remember'=>true})
|
78
|
-
yield
|
79
|
-
end
|
80
|
-
if key == :token then
|
81
|
-
conf[host] = @iface.token
|
82
|
-
else
|
83
|
-
conf[host] = @iface.cookie
|
84
|
-
end
|
85
|
-
File.open(fname, 'w') {|f| f.chmod(0600); f.write(conf.to_yaml)}
|
86
|
-
|
87
|
-
return key
|
88
|
-
end # def session
|
89
|
-
|
90
|
-
=begin rdoc
|
91
|
-
|
92
|
-
==== Bugzilla::User#login(params)
|
93
|
-
|
94
|
-
Raw Bugzilla API to log into Bugzilla.
|
95
|
-
|
96
|
-
See http://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/User.html
|
97
|
-
|
98
|
-
=end
|
99
|
-
|
100
|
-
=begin rdoc
|
101
|
-
|
102
|
-
==== Bugzilla::User#logout
|
103
|
-
|
104
|
-
Raw Bugzilla API to log out the user.
|
105
|
-
|
106
|
-
See http://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/User.html
|
107
|
-
|
108
|
-
=end
|
109
|
-
|
110
|
-
protected
|
111
|
-
|
112
|
-
def _login(cmd, *args)
|
113
|
-
raise ArgumentError, "Invalid parameters" unless args[0].kind_of?(Hash)
|
114
|
-
|
115
|
-
res = @iface.call(cmd,args[0])
|
116
|
-
unless res['token'].nil? then
|
117
|
-
@iface.token = res['token']
|
118
|
-
end
|
119
|
-
|
120
|
-
return res
|
121
|
-
end # def _login
|
122
|
-
|
123
|
-
def _logout(cmd, *args)
|
124
|
-
@iface.call(cmd)
|
125
|
-
end # def _logout
|
126
|
-
|
127
|
-
def __offer_account_by_email(cmd, *args)
|
128
|
-
# FIXME
|
129
|
-
end # def _offer_account_by_email
|
130
|
-
|
131
|
-
def __create(cmd, *args)
|
132
|
-
# FIXME
|
133
|
-
end # def _create
|
134
|
-
|
135
|
-
def __update(cmd, *args)
|
136
|
-
# FIXME
|
137
|
-
end # def _update
|
138
|
-
|
139
|
-
def __get(cmd, *args)
|
140
|
-
requires_version(cmd, 3.4)
|
141
|
-
# FIXME
|
142
|
-
end # def _get
|
143
|
-
|
144
|
-
end # class User
|
145
|
-
|
146
|
-
end # module Bugzilla
|
data/lib/bugzilla/version.rb~
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
# version.rb
|
2
|
-
# Copyright (C) 2010-2012 Red Hat, Inc.
|
3
|
-
#
|
4
|
-
# Authors:
|
5
|
-
# Akira TAGOH <tagoh@redhat.com>
|
6
|
-
#
|
7
|
-
# This library is free software: you can redistribute it and/or
|
8
|
-
# modify it under the terms of the GNU Lesser General Public
|
9
|
-
# License as published by the Free Software Foundation, either
|
10
|
-
# version 3 of the License, or (at your option) any later version.
|
11
|
-
#
|
12
|
-
# This library is distributed in the hope that it will be useful,
|
13
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
-
# GNU General Public License for more details.
|
16
|
-
#
|
17
|
-
# You should have received a copy of the GNU General Public License
|
18
|
-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
19
|
-
|
20
|
-
|
21
|
-
=begin rdoc
|
22
|
-
|
23
|
-
== Bugzilla
|
24
|
-
|
25
|
-
=end
|
26
|
-
|
27
|
-
module Bugzilla
|
28
|
-
|
29
|
-
VERSION = "0.5.2"
|
30
|
-
|
31
|
-
end # module Bugzilla
|
data/lib/bugzilla/xmlrpc.rb~
DELETED
@@ -1,100 +0,0 @@
|
|
1
|
-
# xmlrpc.rb
|
2
|
-
# Copyright (C) 2010-2012 Red Hat, Inc.
|
3
|
-
#
|
4
|
-
# Authors:
|
5
|
-
# Akira TAGOH <tagoh@redhat.com>
|
6
|
-
#
|
7
|
-
# This library is free software: you can redistribute it and/or
|
8
|
-
# modify it under the terms of the GNU Lesser General Public
|
9
|
-
# License as published by the Free Software Foundation, either
|
10
|
-
# version 3 of the License, or (at your option) any later version.
|
11
|
-
#
|
12
|
-
# This library is distributed in the hope that it will be useful,
|
13
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
-
# GNU General Public License for more details.
|
16
|
-
#
|
17
|
-
# You should have received a copy of the GNU General Public License
|
18
|
-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
19
|
-
|
20
|
-
require 'xmlrpc/client'
|
21
|
-
|
22
|
-
module Bugzilla
|
23
|
-
|
24
|
-
=begin rdoc
|
25
|
-
|
26
|
-
=== Bugzilla::XMLRPC
|
27
|
-
|
28
|
-
=end
|
29
|
-
|
30
|
-
class XMLRPC
|
31
|
-
|
32
|
-
=begin rdoc
|
33
|
-
|
34
|
-
==== Bugzilla::XMLRPC#new(host, port = 443, path = '/xmlrpc.cgi', proxy_host = nil, proxy_port = nil)
|
35
|
-
|
36
|
-
=end
|
37
|
-
|
38
|
-
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)
|
39
|
-
path ||= '/xmlrpc.cgi'
|
40
|
-
use_ssl = port == 443 ? true : false
|
41
|
-
@xmlrpc = ::XMLRPC::Client.new(host, path, port, proxy_host, proxy_port, http_basic_auth_user, http_basic_auth_pass, use_ssl, timeout)
|
42
|
-
end # def initialize
|
43
|
-
|
44
|
-
=begin rdoc
|
45
|
-
|
46
|
-
==== Bugzilla::XMLRPC#call(cmd, params, user = nil, password = nil)
|
47
|
-
|
48
|
-
=end
|
49
|
-
|
50
|
-
def call(cmd, params = {}, user = nil, password = nil)
|
51
|
-
params = {} if params.nil?
|
52
|
-
params['Bugzilla_login'] = user unless user.nil? || password.nil?
|
53
|
-
params['Bugzilla_password'] = password unless user.nil? || password.nil?
|
54
|
-
params['Bugzilla_token'] = @token unless user.nil? || @token.nil?
|
55
|
-
@xmlrpc.call(cmd, params)
|
56
|
-
end # def call
|
57
|
-
|
58
|
-
=begin rdoc
|
59
|
-
|
60
|
-
==== Bugzilla::XMLRPC#cookie
|
61
|
-
|
62
|
-
=end
|
63
|
-
|
64
|
-
def cookie
|
65
|
-
@xmlrpc.cookie
|
66
|
-
end # def cookie
|
67
|
-
|
68
|
-
=begin rdoc
|
69
|
-
|
70
|
-
==== Bugzilla::XMLRPC#cookie=(val)
|
71
|
-
|
72
|
-
=end
|
73
|
-
|
74
|
-
def cookie=(val)
|
75
|
-
@xmlrpc.cookie = val
|
76
|
-
end # def cookie=
|
77
|
-
|
78
|
-
=begin rdoc
|
79
|
-
|
80
|
-
==== Bugzilla::XMLRPC#token
|
81
|
-
|
82
|
-
=end
|
83
|
-
|
84
|
-
def token
|
85
|
-
@token
|
86
|
-
end # def token
|
87
|
-
|
88
|
-
=begin rdoc
|
89
|
-
|
90
|
-
==== Bugzilla::XMLRPC#token=(val)
|
91
|
-
|
92
|
-
=end
|
93
|
-
|
94
|
-
def token=(val)
|
95
|
-
@token = val
|
96
|
-
end # def token=
|
97
|
-
|
98
|
-
end # class XMLRPC
|
99
|
-
|
100
|
-
end # module Bugzilla
|