ruby-bugzilla 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/bzconsole +4 -0
- data/lib/bugzilla/classification.rb +2 -0
- data/lib/bugzilla/group.rb +2 -0
- data/lib/bugzilla/version.rb +1 -1
- metadata +3 -17
- data/lib/bugzilla.rb~ +0 -24
- data/lib/bugzilla/api_tmpl.rb~ +0 -52
- data/lib/bugzilla/bug.rb~ +0 -346
- data/lib/bugzilla/bugzilla.rb~ +0 -141
- data/lib/bugzilla/classification.rb~ +0 -76
- data/lib/bugzilla/group.rb~ +0 -66
- data/lib/bugzilla/plugin.rb~ +0 -82
- data/lib/bugzilla/product.rb~ +0 -156
- data/lib/bugzilla/skeleton.rb~ +0 -50
- data/lib/bugzilla/skelton.rb~ +0 -50
- data/lib/bugzilla/user.rb~ +0 -114
- data/lib/bugzilla/version.rb~ +0 -33
- data/lib/bugzilla/xmlrpc.rb~ +0 -81
- data/lib/ruby-bugzilla/rhbugzilla.rb~ +0 -223
data/lib/bugzilla/bugzilla.rb~
DELETED
@@ -1,141 +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 program is free software; you can redistribute it and/or modify
|
8
|
-
# it under the terms of the GNU General Public License as published by
|
9
|
-
# the Free Software Foundation; either version 2 of the License, or
|
10
|
-
# (at your option) any later version.
|
11
|
-
#
|
12
|
-
# This program 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, write to the Free Software
|
19
|
-
# Foundation, Inc., 59 Temple Place - Suite 330,
|
20
|
-
# Boston, MA 02111-1307, USA.
|
21
|
-
|
22
|
-
require 'bugzilla/skeleton'
|
23
|
-
|
24
|
-
module Bugzilla
|
25
|
-
|
26
|
-
=begin rdoc
|
27
|
-
|
28
|
-
=== Bugzilla::Bugzilla
|
29
|
-
|
30
|
-
Bugzilla::Bugzilla class is to access the
|
31
|
-
Bugzilla::WebService::Bugzilla API that provides functions
|
32
|
-
tell you about Bugzilla in general.
|
33
|
-
|
34
|
-
=end
|
35
|
-
|
36
|
-
class Bugzilla < Skeleton
|
37
|
-
|
38
|
-
=begin rdoc
|
39
|
-
|
40
|
-
==== Bugzilla::Bugzilla#check_version(version_)
|
41
|
-
|
42
|
-
Returns Array contains the result of the version check and
|
43
|
-
Bugzilla version that is running on.
|
44
|
-
|
45
|
-
=end
|
46
|
-
|
47
|
-
def check_version(version_)
|
48
|
-
v = version
|
49
|
-
f = false
|
50
|
-
if v.kind_of?(Hash) && v.include?("version") &&
|
51
|
-
v['version'] >= "#{version_}" then
|
52
|
-
f = true
|
53
|
-
end
|
54
|
-
|
55
|
-
[f, v['version']]
|
56
|
-
end # def check_version
|
57
|
-
|
58
|
-
=begin rdoc
|
59
|
-
|
60
|
-
==== Bugzilla::Bugzilla#requires_version(cmd, version_)
|
61
|
-
|
62
|
-
Raise an exception if the Bugzilla doesn't satisfy
|
63
|
-
the requirement of the _version_.
|
64
|
-
|
65
|
-
=end
|
66
|
-
|
67
|
-
def requires_version(cmd, version_)
|
68
|
-
v = check_version(version_)
|
69
|
-
raise NoMethodError, sprintf("%s is not supported in Bugzilla %s", cmd, v[1]) unless v[0]
|
70
|
-
end # def requires_version
|
71
|
-
|
72
|
-
=begin rdoc
|
73
|
-
|
74
|
-
==== Bugzilla::Bugzilla#version
|
75
|
-
|
76
|
-
Raw Bugzilla API to obtain the Bugzilla version.
|
77
|
-
|
78
|
-
See http://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Bugzilla.html
|
79
|
-
|
80
|
-
=end
|
81
|
-
|
82
|
-
=begin rdoc
|
83
|
-
|
84
|
-
==== Bugzilla::Bugzilla#extensions
|
85
|
-
|
86
|
-
Raw Bugzilla API to obtain the information about
|
87
|
-
the extensions that are currently installed and enabled in
|
88
|
-
the Bugzilla.
|
89
|
-
|
90
|
-
See http://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Bugzilla.html
|
91
|
-
|
92
|
-
=end
|
93
|
-
|
94
|
-
=begin rdoc
|
95
|
-
|
96
|
-
==== Bugzilla::Bugzilla#timezone
|
97
|
-
|
98
|
-
Raw Bugzilla API to obtain the timezone that Bugzilla
|
99
|
-
expects dates and times in.
|
100
|
-
|
101
|
-
See http://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Bugzilla.html
|
102
|
-
|
103
|
-
=end
|
104
|
-
|
105
|
-
=begin rdoc
|
106
|
-
|
107
|
-
==== Bugzilla::Bugzilla#time
|
108
|
-
|
109
|
-
Raw Bugzilla API to obtain the information about what time
|
110
|
-
the bugzilla server thinks it is, and what timezone it's
|
111
|
-
running on.
|
112
|
-
|
113
|
-
See http://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Bugzilla.html
|
114
|
-
|
115
|
-
=end
|
116
|
-
|
117
|
-
protected
|
118
|
-
|
119
|
-
def _version(cmd, *args)
|
120
|
-
@iface.call(cmd)
|
121
|
-
end # def _version
|
122
|
-
|
123
|
-
def _extensions(cmd, *args)
|
124
|
-
requires_version(cmd, 3.2)
|
125
|
-
|
126
|
-
@iface.call(cmd)
|
127
|
-
end # def _extensions
|
128
|
-
|
129
|
-
def _timezone(cmd, *args)
|
130
|
-
@iface.call(cmd)
|
131
|
-
end # def _timezone
|
132
|
-
|
133
|
-
def _time(cmd, *args)
|
134
|
-
requires_version(cmd, 3.4)
|
135
|
-
|
136
|
-
@iface.call(cmd)
|
137
|
-
end # def _time
|
138
|
-
|
139
|
-
end # class Bugzilla
|
140
|
-
|
141
|
-
end # module Bugzilla
|
@@ -1,76 +0,0 @@
|
|
1
|
-
# classification.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/api_tmpl'
|
21
|
-
|
22
|
-
module Bugzilla
|
23
|
-
|
24
|
-
=begin rdoc
|
25
|
-
|
26
|
-
=== Bugzilla::Classification
|
27
|
-
|
28
|
-
Bugzilla::Classification class is to access
|
29
|
-
the Bugzilla::WebService::Classification API that allows you
|
30
|
-
to deal with the available Classifications.
|
31
|
-
|
32
|
-
=end
|
33
|
-
|
34
|
-
class Classification < APITemplate
|
35
|
-
|
36
|
-
=begin rdoc
|
37
|
-
|
38
|
-
==== Bugzilla::Classification#get(params)
|
39
|
-
|
40
|
-
Raw Bugzilla API to obtain the information about a set of
|
41
|
-
classifications.
|
42
|
-
|
43
|
-
See http://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Classification.html
|
44
|
-
|
45
|
-
=end
|
46
|
-
|
47
|
-
def _get(cmd, args[0])
|
48
|
-
requires_version(cmd, 4.4)
|
49
|
-
|
50
|
-
params = {}
|
51
|
-
|
52
|
-
if ids.kind_of?(Hash) then
|
53
|
-
raise ArgumentError, sprintf("Invalid parameter: %s", ids.inspect) unless ids.include?('ids') || ids.include?('names')
|
54
|
-
params[:ids] = ids['ids'] || ids['names']
|
55
|
-
elsif ids.kind_of?(Array) then
|
56
|
-
r = ids.map {|x| x.kind_of?(Integer) ? x : nil}.compact
|
57
|
-
if r.length != ids.length then
|
58
|
-
params[:names] = ids
|
59
|
-
else
|
60
|
-
params[:ids] = ids
|
61
|
-
end
|
62
|
-
else
|
63
|
-
if ids.kind_of?(Integer) then
|
64
|
-
params[:ids] = [ids]
|
65
|
-
else
|
66
|
-
params[:names] = [ids]
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
@iface.call(cmd, params)
|
71
|
-
end # def _get
|
72
|
-
|
73
|
-
end # class Classification
|
74
|
-
|
75
|
-
end # module Bugzilla
|
76
|
-
|
data/lib/bugzilla/group.rb~
DELETED
@@ -1,66 +0,0 @@
|
|
1
|
-
# group.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/api_tmpl'
|
21
|
-
|
22
|
-
module Bugzilla
|
23
|
-
|
24
|
-
=begin rdoc
|
25
|
-
|
26
|
-
=== Bugzilla::Group
|
27
|
-
|
28
|
-
Bugzilla::Group class is to access
|
29
|
-
the Bugzilla::WebService::Group API that allows you to
|
30
|
-
create Groups and get information about them.
|
31
|
-
|
32
|
-
=end
|
33
|
-
|
34
|
-
class Group < APITemplate
|
35
|
-
|
36
|
-
=begin rdoc
|
37
|
-
|
38
|
-
==== Bugzilla::Group#create(params)
|
39
|
-
|
40
|
-
Raw Bugzilla API to create a new group in Bugzilla.
|
41
|
-
|
42
|
-
See http://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Group.html
|
43
|
-
|
44
|
-
=end
|
45
|
-
|
46
|
-
=begin rdoc
|
47
|
-
|
48
|
-
==== Bugzilla::Group#update(params)
|
49
|
-
|
50
|
-
Raw Bugzilla APi to update a group in Bugzilla.
|
51
|
-
|
52
|
-
See http://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Group.html
|
53
|
-
|
54
|
-
=end
|
55
|
-
|
56
|
-
def __create(cmd, *args)
|
57
|
-
# FIXME
|
58
|
-
end # def _create
|
59
|
-
|
60
|
-
def __update(cmd, *args)
|
61
|
-
# FIXME
|
62
|
-
end # def _update
|
63
|
-
|
64
|
-
end # class Group
|
65
|
-
|
66
|
-
end # module Bugzilla
|
data/lib/bugzilla/plugin.rb~
DELETED
@@ -1,82 +0,0 @@
|
|
1
|
-
# plugin.rb
|
2
|
-
# Copyright (C) 2010-2012 Red Hat, Inc.
|
3
|
-
#
|
4
|
-
# Authors:
|
5
|
-
# Akira TAGOH <tagoh@redhat.com>
|
6
|
-
#
|
7
|
-
# This program is free software; you can redistribute it and/or modify
|
8
|
-
# it under the terms of the GNU General Public License as published by
|
9
|
-
# the Free Software Foundation; either version 2 of the License, or
|
10
|
-
# (at your option) any later version.
|
11
|
-
#
|
12
|
-
# This program 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, write to the Free Software
|
19
|
-
# Foundation, Inc., 59 Temple Place - Suite 330,
|
20
|
-
# Boston, MA 02111-1307, USA.
|
21
|
-
|
22
|
-
|
23
|
-
module Bugzilla
|
24
|
-
|
25
|
-
=begin rdoc
|
26
|
-
|
27
|
-
=== Bugzilla::Plugin
|
28
|
-
|
29
|
-
=end
|
30
|
-
|
31
|
-
module Plugin
|
32
|
-
|
33
|
-
=begin rdoc
|
34
|
-
|
35
|
-
==== Bugzilla::Plugin::Template
|
36
|
-
|
37
|
-
=end
|
38
|
-
|
39
|
-
class Template
|
40
|
-
@@plugins = []
|
41
|
-
|
42
|
-
def initialize
|
43
|
-
@hostname = nil
|
44
|
-
end # def initialize
|
45
|
-
|
46
|
-
attr_reader :hostname
|
47
|
-
|
48
|
-
def Template.inherited(subclass)
|
49
|
-
@@plugins << subclass
|
50
|
-
end # def inherited
|
51
|
-
|
52
|
-
def run(hook, host, *args)
|
53
|
-
@@plugins.each do |k|
|
54
|
-
i = k.new
|
55
|
-
if i.hostname == host || host.nil? then
|
56
|
-
case hook
|
57
|
-
when :parser
|
58
|
-
i.parserhook(*args)
|
59
|
-
when :pre
|
60
|
-
i.prehook(*args)
|
61
|
-
when :post
|
62
|
-
i.posthook(*args)
|
63
|
-
else
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end # def run
|
68
|
-
|
69
|
-
def parserhook(parser, argv, opts)
|
70
|
-
end # def parserhook
|
71
|
-
|
72
|
-
def prehook(cmd, opts)
|
73
|
-
end # def prehook
|
74
|
-
|
75
|
-
def posthook(cmd, opts)
|
76
|
-
end # def posthook
|
77
|
-
|
78
|
-
end # class Template
|
79
|
-
|
80
|
-
end # module Plugin
|
81
|
-
|
82
|
-
end # module Bugzilla
|
data/lib/bugzilla/product.rb~
DELETED
@@ -1,156 +0,0 @@
|
|
1
|
-
# product.rb
|
2
|
-
# Copyright (C) 2010-2012 Red Hat, Inc.
|
3
|
-
#
|
4
|
-
# Authors:
|
5
|
-
# Akira TAGOH <tagoh@redhat.com>
|
6
|
-
#
|
7
|
-
# This program is free software; you can redistribute it and/or modify
|
8
|
-
# it under the terms of the GNU General Public License as published by
|
9
|
-
# the Free Software Foundation; either version 2 of the License, or
|
10
|
-
# (at your option) any later version.
|
11
|
-
#
|
12
|
-
# This program 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, write to the Free Software
|
19
|
-
# Foundation, Inc., 59 Temple Place - Suite 330,
|
20
|
-
# Boston, MA 02111-1307, USA.
|
21
|
-
|
22
|
-
require 'bugzilla/api_tmpl'
|
23
|
-
|
24
|
-
module Bugzilla
|
25
|
-
|
26
|
-
=begin rdoc
|
27
|
-
|
28
|
-
=== Bugzilla::Product
|
29
|
-
|
30
|
-
Bugzilla::Product class is to access
|
31
|
-
the Bugzilla::WebService::Product API that allows you to
|
32
|
-
list the available Products and get information about them.
|
33
|
-
|
34
|
-
=end
|
35
|
-
|
36
|
-
class Product < APITemplate
|
37
|
-
|
38
|
-
=begin rdoc
|
39
|
-
|
40
|
-
==== Bugzilla::Product#selectable_products
|
41
|
-
|
42
|
-
Returns the products that the user can search on as Hash
|
43
|
-
contains the product name as the Hash key and Array as the
|
44
|
-
value. Array contains the list of _id_, _name_,
|
45
|
-
_description_ and _internals_ according to API documentation
|
46
|
-
though, actually the component, the version and the target
|
47
|
-
milestone.
|
48
|
-
|
49
|
-
=end
|
50
|
-
|
51
|
-
def selectable_products
|
52
|
-
ids = get_selectable_products
|
53
|
-
get(ids)
|
54
|
-
end # def selectable_products
|
55
|
-
|
56
|
-
=begin rdoc
|
57
|
-
|
58
|
-
==== Bugzilla::Product#enterable_products
|
59
|
-
|
60
|
-
Returns the products that the user can enter bugs against
|
61
|
-
as Hash contains the product name as the Hash key and Array
|
62
|
-
as the value. Array contains the list of _id_, _name_,
|
63
|
-
_description_ and _internals_ according to API documentation
|
64
|
-
though, actually the component, the version and the target
|
65
|
-
milestone.
|
66
|
-
|
67
|
-
=end
|
68
|
-
|
69
|
-
def enterable_products
|
70
|
-
ids = get_enterable_products
|
71
|
-
get(ids)
|
72
|
-
end # def enterable_products
|
73
|
-
|
74
|
-
=begin rdoc
|
75
|
-
|
76
|
-
==== Bugzilla::Product#accessible_products
|
77
|
-
|
78
|
-
Returns the products that the user can search or enter bugs
|
79
|
-
against as Hash contains the product name as the Hash key
|
80
|
-
and Array as the value. Array contains the list of _id_,
|
81
|
-
_name_, _description_ and _internals_ according to API
|
82
|
-
documentation though, actually the component, the version
|
83
|
-
and the target milestone.
|
84
|
-
|
85
|
-
=end
|
86
|
-
|
87
|
-
def accessible_products
|
88
|
-
ids = get_accessible_products
|
89
|
-
get(ids)
|
90
|
-
end # def accessible_products
|
91
|
-
|
92
|
-
=begin rdoc
|
93
|
-
|
94
|
-
==== Bugzilla::Product#get_selectable_products
|
95
|
-
|
96
|
-
Raw Bugzilla API to obtain the products that the user can
|
97
|
-
search on.
|
98
|
-
|
99
|
-
See http://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Product.html
|
100
|
-
|
101
|
-
=end
|
102
|
-
|
103
|
-
=begin rdoc
|
104
|
-
|
105
|
-
==== Bugzilla::Product#get_enterable_products
|
106
|
-
|
107
|
-
Raw Bugzilla API to obtain the products that the user can
|
108
|
-
enter bugs against.
|
109
|
-
|
110
|
-
See http://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Product.html
|
111
|
-
|
112
|
-
=end
|
113
|
-
|
114
|
-
=begin rdoc
|
115
|
-
|
116
|
-
==== Bugzilla::Product#get_accessible_products
|
117
|
-
|
118
|
-
Raw Bugzilla API to obtain the products that the user can
|
119
|
-
search or enter bugs against.
|
120
|
-
|
121
|
-
See http://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Product.html
|
122
|
-
|
123
|
-
=end
|
124
|
-
|
125
|
-
protected
|
126
|
-
|
127
|
-
def _get_selectable_products(cmd, *args)
|
128
|
-
@iface.call(cmd)
|
129
|
-
end # def _get_selectable_products
|
130
|
-
|
131
|
-
def _get_enterable_products(cmd, *args)
|
132
|
-
@iface.call(cmd)
|
133
|
-
end # def _get_entrable_products
|
134
|
-
|
135
|
-
def _get_accessible_products(cmd, *args)
|
136
|
-
@iface.call(cmd)
|
137
|
-
end # def _get_accessible_products
|
138
|
-
|
139
|
-
def _get(cmd, ids, *args)
|
140
|
-
params = {}
|
141
|
-
|
142
|
-
if ids.kind_of?(Hash) then
|
143
|
-
raise ArgumentError, sprintf("Invalid parameter: %s", ids.inspect) unless ids.include?('ids')
|
144
|
-
params[:ids] = ids['ids']
|
145
|
-
elsif ids.kind_of?(Array) then
|
146
|
-
params[:ids] = ids
|
147
|
-
else
|
148
|
-
params[:ids] = [ids]
|
149
|
-
end
|
150
|
-
|
151
|
-
@iface.call(cmd, params)
|
152
|
-
end # def _get
|
153
|
-
|
154
|
-
end # class Product
|
155
|
-
|
156
|
-
end # module Bugzilla
|