ruby-bugzilla 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- 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/skeleton.rb~
DELETED
@@ -1,50 +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 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::Skeleton
|
28
|
-
|
29
|
-
=end
|
30
|
-
|
31
|
-
class Skeleton
|
32
|
-
|
33
|
-
def initialize(iface)
|
34
|
-
@iface = iface
|
35
|
-
end # def initialize
|
36
|
-
|
37
|
-
def method_missing(symbol, *args)
|
38
|
-
m = "_#{symbol}"
|
39
|
-
klass = self.class.to_s.sub(/\ABugzilla::/, '')
|
40
|
-
fm = "#{klass}.#{symbol}"
|
41
|
-
if self.respond_to?(m) then
|
42
|
-
__send__(m, fm, *args)
|
43
|
-
else
|
44
|
-
raise NoMethodError, sprintf("No such Bugzilla APIs: %s.%s", klass, symbol)
|
45
|
-
end
|
46
|
-
end # def method_missing
|
47
|
-
|
48
|
-
end # class Skeleton
|
49
|
-
|
50
|
-
end # module Bugzilla
|
data/lib/bugzilla/skelton.rb~
DELETED
@@ -1,50 +0,0 @@
|
|
1
|
-
# skelton.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::Skeleton
|
28
|
-
|
29
|
-
=end
|
30
|
-
|
31
|
-
class Skeleton
|
32
|
-
|
33
|
-
def initialize(iface)
|
34
|
-
@iface = iface
|
35
|
-
end # def initialize
|
36
|
-
|
37
|
-
def method_missing(symbol, *args)
|
38
|
-
m = "_#{symbol}"
|
39
|
-
klass = self.class.to_s.sub(/\ABugzilla::/, '')
|
40
|
-
fm = "#{klass}.#{symbol}"
|
41
|
-
if self.respond_to?(m) then
|
42
|
-
__send__(m, fm, *args)
|
43
|
-
else
|
44
|
-
raise NoMethodError, sprintf("No such Bugzilla APIs: %s.%s", klass, symbol)
|
45
|
-
end
|
46
|
-
end # def method_missing
|
47
|
-
|
48
|
-
end # class Skeleton
|
49
|
-
|
50
|
-
end # module Bugzilla
|
data/lib/bugzilla/user.rb~
DELETED
@@ -1,114 +0,0 @@
|
|
1
|
-
# user.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::User
|
29
|
-
|
30
|
-
Bugzilla::User class is to access the
|
31
|
-
Bugzilla::WebService::User API that allows you to create
|
32
|
-
User Accounts and log in/out using an existing account.
|
33
|
-
|
34
|
-
=end
|
35
|
-
|
36
|
-
class User < APITemplate
|
37
|
-
|
38
|
-
=begin rdoc
|
39
|
-
|
40
|
-
==== Bugzilla::User#session(user, password)
|
41
|
-
|
42
|
-
Keeps the bugzilla session during doing something in the block.
|
43
|
-
|
44
|
-
=end
|
45
|
-
|
46
|
-
def session(user, password)
|
47
|
-
fname = File.join(ENV['HOME'], '.ruby-bugzilla-cookie.yml')
|
48
|
-
if File.exist?(fname) && File.lstat(fname).mode & 0600 == 0600 then
|
49
|
-
conf = YAML.load(File.open(fname).read)
|
50
|
-
host = @iface.instance_variable_get(:@xmlrpc).instance_variable_get(:@host)
|
51
|
-
cookie = conf[host]
|
52
|
-
unless cookie.nil? then
|
53
|
-
@iface.cookie = cookie
|
54
|
-
print "Using cookie\n"
|
55
|
-
yield
|
56
|
-
conf[host] = @iface.cookie
|
57
|
-
File.open(fname, 'w') {|f| f.chmod(0600); f.write(conf.to_yaml)}
|
58
|
-
return
|
59
|
-
end
|
60
|
-
end
|
61
|
-
if user.nil? || password.nil? then
|
62
|
-
yield
|
63
|
-
else
|
64
|
-
login({'login'=>user, 'password'=>password, 'remember'=>true})
|
65
|
-
yield
|
66
|
-
logout
|
67
|
-
end
|
68
|
-
|
69
|
-
end # def session
|
70
|
-
|
71
|
-
=begin rdoc
|
72
|
-
|
73
|
-
==== Bugzilla::User#login(params)
|
74
|
-
|
75
|
-
Raw Bugzilla API to log into Bugzilla.
|
76
|
-
|
77
|
-
=end
|
78
|
-
|
79
|
-
=begin rdoc
|
80
|
-
|
81
|
-
==== Bugzilla::User#logout
|
82
|
-
|
83
|
-
Raw Bugzilla API to log out the user.
|
84
|
-
|
85
|
-
=end
|
86
|
-
|
87
|
-
protected
|
88
|
-
|
89
|
-
def _login(cmd, *args)
|
90
|
-
raise ArgumentError, "Invalid parameters" unless args[0].kind_of?(Hash)
|
91
|
-
|
92
|
-
@iface.call(cmd,args[0])
|
93
|
-
end # def _login
|
94
|
-
|
95
|
-
def _logout(cmd, *args)
|
96
|
-
@iface.call(cmd)
|
97
|
-
end # def _logout
|
98
|
-
|
99
|
-
def __offer_account_by_email(cmd, *args)
|
100
|
-
# FIXME
|
101
|
-
end # def _offer_account_by_email
|
102
|
-
|
103
|
-
def __create(cmd, *args)
|
104
|
-
# FIXME
|
105
|
-
end # def _create
|
106
|
-
|
107
|
-
def __get(cmd, *args)
|
108
|
-
requires_version(cmd, 3.4)
|
109
|
-
# FIXME
|
110
|
-
end # def _get
|
111
|
-
|
112
|
-
end # class User
|
113
|
-
|
114
|
-
end # module Bugzilla
|
data/lib/bugzilla/version.rb~
DELETED
@@ -1,33 +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 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
|
-
=begin rdoc
|
24
|
-
|
25
|
-
== Bugzilla
|
26
|
-
|
27
|
-
=end
|
28
|
-
|
29
|
-
module Bugzilla
|
30
|
-
|
31
|
-
VERSION = "0.4.1"
|
32
|
-
|
33
|
-
end # module Bugzilla
|
data/lib/bugzilla/xmlrpc.rb~
DELETED
@@ -1,81 +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 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 'xmlrpc/client'
|
23
|
-
|
24
|
-
module Bugzilla
|
25
|
-
|
26
|
-
=begin rdoc
|
27
|
-
|
28
|
-
=== Bugzilla::XMLRPC
|
29
|
-
|
30
|
-
=end
|
31
|
-
|
32
|
-
class XMLRPC
|
33
|
-
|
34
|
-
=begin rdoc
|
35
|
-
|
36
|
-
==== Bugzilla::XMLRPC#new(host, port = 443, path = '/xmlrpc.cgi', proxy_host = nil, proxy_port = nil)
|
37
|
-
|
38
|
-
=end
|
39
|
-
|
40
|
-
def initialize(host, port = 443, path = '/xmlrpc.cgi', proxy_host = nil, proxy_port = nil, timeout = 60)
|
41
|
-
path ||= '/xmlrpc.cgi'
|
42
|
-
use_ssl = port == 443 ? true : false
|
43
|
-
@xmlrpc = ::XMLRPC::Client.new(host, path, port, proxy_host, proxy_port, nil, nil, use_ssl, timeout)
|
44
|
-
end # def initialize
|
45
|
-
|
46
|
-
=begin rdoc
|
47
|
-
|
48
|
-
==== Bugzilla::XMLRPC#call(cmd, params, user = nil, password = nil)
|
49
|
-
|
50
|
-
=end
|
51
|
-
|
52
|
-
def call(cmd, params = {}, user = nil, password = nil)
|
53
|
-
params = {} if params.nil?
|
54
|
-
params['Bugzilla_login'] = user unless user.nil? || password.nil?
|
55
|
-
params['Bugzilla_password'] = password unless user.nil? || password.nil?
|
56
|
-
@xmlrpc.call(cmd, params)
|
57
|
-
end # def call
|
58
|
-
|
59
|
-
=begin rdoc
|
60
|
-
|
61
|
-
==== Bugzilla::XMLRPC#cookie
|
62
|
-
|
63
|
-
=end
|
64
|
-
|
65
|
-
def cookie
|
66
|
-
@xmlrpc.cookie
|
67
|
-
end # def cookie
|
68
|
-
|
69
|
-
=begin rdoc
|
70
|
-
|
71
|
-
==== Bugzilla::XMLRPC#cookie=(val)
|
72
|
-
|
73
|
-
=end
|
74
|
-
|
75
|
-
def cookie=(val)
|
76
|
-
@xmlrpc.cookie = val
|
77
|
-
end # def cookie
|
78
|
-
|
79
|
-
end # class XMLRPC
|
80
|
-
|
81
|
-
end # module Bugzilla
|
@@ -1,223 +0,0 @@
|
|
1
|
-
# rhbugzilla.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 2 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 GNU
|
15
|
-
# Lesser General Public License for more details.
|
16
|
-
#
|
17
|
-
# You should have received a copy of the GNU Lesser General Public
|
18
|
-
# License along with this library; if not, write to the
|
19
|
-
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
20
|
-
# Boston, MA 02111-1307, USA.
|
21
|
-
|
22
|
-
require 'rubygems'
|
23
|
-
|
24
|
-
#begin
|
25
|
-
# gem 'ruby-bugzilla'
|
26
|
-
#rescue Gem::LoadError
|
27
|
-
# require File.join(File.dirname(__FILE__), "..", "bugzilla.rb")
|
28
|
-
#end
|
29
|
-
|
30
|
-
module Bugzilla
|
31
|
-
|
32
|
-
module Plugin
|
33
|
-
|
34
|
-
class RedHat < ::Bugzilla::Plugin::Template
|
35
|
-
|
36
|
-
def initialize
|
37
|
-
super
|
38
|
-
|
39
|
-
@hostname = "bugzilla.redhat.com"
|
40
|
-
end # def initialize
|
41
|
-
|
42
|
-
def parserhook(*args)
|
43
|
-
parser, argv, opts, *etc = args
|
44
|
-
parser.separator ""
|
45
|
-
parser.separator "RH Bugzilla specific options:"
|
46
|
-
parser.on('--cc=EMAILS', 'filter out the result by Cc in bugs') {|v| opts[:query][:cc] ||= []; opts[:query][:cc].push(*v.split(','))}
|
47
|
-
parser.on('--filterversion=VERSION', 'filter out the result by the version in bugs') {|v| opts[:query][:version] ||= []; opts[:query][:version].push(*v.split(','))}
|
48
|
-
end # def parserhook
|
49
|
-
|
50
|
-
def prehook(*args)
|
51
|
-
cmd, opts, *etc = args
|
52
|
-
case cmd
|
53
|
-
when :search
|
54
|
-
extra_field = 0
|
55
|
-
|
56
|
-
if opts.include?(:status) then
|
57
|
-
opts[:bug_status] = opts[:status]
|
58
|
-
opts.delete(:status)
|
59
|
-
end
|
60
|
-
if opts.include?(:id) then
|
61
|
-
opts[:bug_id] = opts[:id]
|
62
|
-
opts.delete(:id)
|
63
|
-
end
|
64
|
-
if opts.include?(:severity)
|
65
|
-
opts[:bug_severity] = opts[:severity]
|
66
|
-
end
|
67
|
-
if opts.include?(:summary) then
|
68
|
-
opts[:short_desc] = opts[:summary]
|
69
|
-
opts.delete(:summary)
|
70
|
-
end
|
71
|
-
if opts.include?(:cc) then
|
72
|
-
i = 1
|
73
|
-
opts[:cc].each do |e|
|
74
|
-
opts[eval(":emailcc#{i}")] = 1
|
75
|
-
opts[eval(":emailtype#{i}")] = :substring
|
76
|
-
opts[eval(":email#{i}")] = e
|
77
|
-
end
|
78
|
-
opts.delete(:cc)
|
79
|
-
end
|
80
|
-
if opts.include?(:creation_time) then
|
81
|
-
opts[sprintf("field0-%d-0", extra_field)] = :creation_ts
|
82
|
-
opts[sprintf("type0-%d-0", extra_field)] = :greaterthan
|
83
|
-
opts[sprintf("value0-%d-0", extra_field)] = opts[:creation_time]
|
84
|
-
opts.delete(:creation_time)
|
85
|
-
end
|
86
|
-
when :metrics
|
87
|
-
metricsopts = etc[0]
|
88
|
-
extra_field = 0
|
89
|
-
|
90
|
-
if opts.include?(:status) then
|
91
|
-
opts[:bug_status] = opts[:status]
|
92
|
-
opts.delete(:status)
|
93
|
-
end
|
94
|
-
if opts.include?(:id) then
|
95
|
-
opts[:bug_id] = opts[:id]
|
96
|
-
opts.delete(:id)
|
97
|
-
end
|
98
|
-
if opts.include?(:severity)
|
99
|
-
opts[:bug_severity] = opts[:severity]
|
100
|
-
end
|
101
|
-
if opts.include?(:summary) then
|
102
|
-
opts[:short_desc] = opts[:summary]
|
103
|
-
opts.delete(:summary)
|
104
|
-
end
|
105
|
-
if opts.include?(:cc) then
|
106
|
-
i = 1
|
107
|
-
opts[:cc].each do |e|
|
108
|
-
opts[eval(":emailcc#{i}")] = 1
|
109
|
-
opts[eval(":emailtype#{i}")] = :substring
|
110
|
-
opts[eval(":email#{i}")] = e
|
111
|
-
end
|
112
|
-
opts.delete(:cc)
|
113
|
-
end
|
114
|
-
|
115
|
-
if opts.include?(:creation_time) then
|
116
|
-
if opts[:creation_time].kind_of?(Array) then
|
117
|
-
opts[sprintf("field0-%d-0", extra_field)] = :creation_ts
|
118
|
-
opts[sprintf("type0-%d-0", extra_field)] = :greaterthan
|
119
|
-
opts[sprintf("value0-%d-0", extra_field)] = opts[:creation_time][0]
|
120
|
-
extra_field += 1
|
121
|
-
opts[sprintf("field0-%d-0", extra_field)] = :creation_ts
|
122
|
-
opts[sprintf("type0-%d-0", extra_field)] = :lessthan
|
123
|
-
opts[sprintf("value0-%d-0", extra_field)] = opts[:creation_time][1]
|
124
|
-
extra_field += 1
|
125
|
-
else
|
126
|
-
opts[sprintf("field0-%d-0", extra_field)] = :creation_ts
|
127
|
-
opts[sprintf("type0-%d-0", extra_field)] = :greaterthan
|
128
|
-
opts[sprintf("value0-%d-0", extra_field)] = opts[:creation_time]
|
129
|
-
extra_field += 1
|
130
|
-
end
|
131
|
-
opts.delete(:creation_time)
|
132
|
-
end
|
133
|
-
if opts.include?(:last_change_time) then
|
134
|
-
if opts[:last_change_time].kind_of?(Array) then
|
135
|
-
opts[:chfieldfrom] = opts[:last_change_time][0]
|
136
|
-
opts[:chfieldto] = opts[:last_change_time][1]
|
137
|
-
if opts[:bug_status] == 'CLOSED' then
|
138
|
-
opts[sprintf("field0-%d-0", extra_field)] = :bug_status
|
139
|
-
opts[sprintf("type0-%d-0", extra_field)] = :changedto
|
140
|
-
opts[sprintf("value0-%d-0", extra_field)] = opts[:bug_status]
|
141
|
-
extra_field += 1
|
142
|
-
end
|
143
|
-
end
|
144
|
-
opts.delete(:last_change_time)
|
145
|
-
end
|
146
|
-
if opts.include?(:metrics_closed_after) then
|
147
|
-
opts[sprintf("field0-%d-0", extra_field)] = :bug_status
|
148
|
-
opts[sprintf("type0-%d-0", extra_field)] = :changedafter
|
149
|
-
opts[sprintf("value0-%d-0", extra_field)] = opts[:metrics_closed_after]
|
150
|
-
extra_field += 1
|
151
|
-
opts.delete(:metrics_closed_after)
|
152
|
-
end
|
153
|
-
if opts.include?(:metrics_not_closed) then
|
154
|
-
opts[sprintf("field0-%d-0", extra_field)] = :bug_status
|
155
|
-
opts[sprintf("type0-%d-0", extra_field)] = :notequals
|
156
|
-
opts[sprintf("value0-%d-0", extra_field)] = 'CLOSED'
|
157
|
-
extra_field += 1
|
158
|
-
opts[sprintf("field0-%d-0", extra_field)] = :creation_ts
|
159
|
-
opts[sprintf("type0-%d-0", extra_field)] = :lessthan
|
160
|
-
opts[sprintf("value0-%d-0", extra_field)] = opts[:metrics_not_closed]
|
161
|
-
extra_field += 1
|
162
|
-
opts.delete(:metrics_not_closed)
|
163
|
-
end
|
164
|
-
else
|
165
|
-
end
|
166
|
-
end # def prehook
|
167
|
-
|
168
|
-
def posthook(*args)
|
169
|
-
cmd, opts, *etc = args
|
170
|
-
case cmd
|
171
|
-
when :search
|
172
|
-
if opts.include?('bugs') then
|
173
|
-
opts['bugs'].each do |bug|
|
174
|
-
if bug.include?('bug_status') then
|
175
|
-
bug['status'] = bug['bug_status']
|
176
|
-
bug.delete('bug_status')
|
177
|
-
end
|
178
|
-
if bug.include?('bug_id') then
|
179
|
-
bug['id'] = bug['bug_id']
|
180
|
-
bug.delete('bug_id')
|
181
|
-
end
|
182
|
-
if bug.include?('bug_severity') then
|
183
|
-
bug['severity'] = bug['bug_severity']
|
184
|
-
bug.delete('bug_severity')
|
185
|
-
end
|
186
|
-
if bug.include?('short_desc') then
|
187
|
-
bug['summary'] = bug['short_desc']
|
188
|
-
bug.delete('short_desc')
|
189
|
-
end
|
190
|
-
end
|
191
|
-
end
|
192
|
-
when :metrics
|
193
|
-
metricsopts = etc[0]
|
194
|
-
|
195
|
-
if opts.include?('bugs') then
|
196
|
-
opts['bugs'].each do |bug|
|
197
|
-
if bug.include?('bug_status') then
|
198
|
-
bug['status'] = bug['bug_status']
|
199
|
-
bug.delete('bug_status')
|
200
|
-
end
|
201
|
-
if bug.include?('bug_id') then
|
202
|
-
bug['id'] = bug['bug_id']
|
203
|
-
bug.delete('bug_id')
|
204
|
-
end
|
205
|
-
if bug.include?('bug_severity') then
|
206
|
-
bug['severity'] = bug['bug_severity']
|
207
|
-
bug.delete('bug_severity')
|
208
|
-
end
|
209
|
-
if bug.include?('short_desc') then
|
210
|
-
bug['summary'] = bug['short_desc']
|
211
|
-
bug.delete('short_desc')
|
212
|
-
end
|
213
|
-
end
|
214
|
-
end
|
215
|
-
else
|
216
|
-
end
|
217
|
-
end # def posthook
|
218
|
-
|
219
|
-
end # class RedHat
|
220
|
-
|
221
|
-
end # module Plugin
|
222
|
-
|
223
|
-
end # module Bugzilla
|