ruby-bugzilla 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,76 @@
|
|
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/version.rb
CHANGED
@@ -49,6 +49,9 @@ module Bugzilla
|
|
49
49
|
cmd, opts, *etc = args
|
50
50
|
case cmd
|
51
51
|
when :search
|
52
|
+
# This parameter is Red Hat Extension
|
53
|
+
# See https://bugzilla.redhat.com/docs/en/html/api/Bugzilla/WebService/Bug.html#search
|
54
|
+
opts[:query_format] = 'advanced'
|
52
55
|
extra_field = 0
|
53
56
|
|
54
57
|
if opts.include?(:status) then
|
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.5.
|
4
|
+
version: 0.5.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-10-
|
12
|
+
date: 2012-10-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -110,6 +110,7 @@ files:
|
|
110
110
|
- lib/bugzilla/skelton.rb~
|
111
111
|
- lib/bugzilla/api_tmpl.rb~
|
112
112
|
- lib/bugzilla/xmlrpc.rb~
|
113
|
+
- lib/bugzilla/classification.rb~
|
113
114
|
- lib/bugzilla/skeleton.rb~
|
114
115
|
- lib/bugzilla/bug.rb~
|
115
116
|
- lib/bugzilla/group.rb
|