geera 1.2.3
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/.autotest +23 -0
- data/ChangeLog +43 -0
- data/Manifest.txt +30 -0
- data/README.rdoc +189 -0
- data/Rakefile +15 -0
- data/bin/geera +118 -0
- data/lib/geera.rb +23 -0
- data/lib/geera/client.rb +63 -0
- data/lib/geera/commands/assign.rb +13 -0
- data/lib/geera/commands/command.rb +19 -0
- data/lib/geera/commands/estimate.rb +13 -0
- data/lib/geera/commands/filters.rb +16 -0
- data/lib/geera/commands/fix.rb +15 -0
- data/lib/geera/commands/list.rb +29 -0
- data/lib/geera/commands/show.rb +13 -0
- data/lib/geera/commands/start.rb +17 -0
- data/lib/geera/commands/take.rb +13 -0
- data/lib/geera/executable.rb +10 -0
- data/lib/geera/ticket.rb +116 -0
- data/lib/template.txt +12 -0
- data/test/commands/test_assign.rb +27 -0
- data/test/commands/test_estimate.rb +27 -0
- data/test/commands/test_filters.rb +34 -0
- data/test/commands/test_fix.rb +74 -0
- data/test/commands/test_list.rb +90 -0
- data/test/commands/test_show.rb +34 -0
- data/test/commands/test_start.rb +28 -0
- data/test/commands/test_take.rb +31 -0
- data/test/test_client.rb +214 -0
- data/test/test_ticket.rb +19 -0
- metadata +170 -0
data/.autotest
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
require 'autotest/restart'
|
4
|
+
|
5
|
+
# Autotest.add_hook :initialize do |at|
|
6
|
+
# at.extra_files << "../some/external/dependency.rb"
|
7
|
+
#
|
8
|
+
# at.libs << ":../some/external"
|
9
|
+
#
|
10
|
+
# at.add_exception 'vendor'
|
11
|
+
#
|
12
|
+
# at.add_mapping(/dependency.rb/) do |f, _|
|
13
|
+
# at.files_matching(/test_.*rb$/)
|
14
|
+
# end
|
15
|
+
#
|
16
|
+
# %w(TestA TestB).each do |klass|
|
17
|
+
# at.extra_class_map[klass] = "test/test_misc.rb"
|
18
|
+
# end
|
19
|
+
# end
|
20
|
+
|
21
|
+
# Autotest.add_hook :run_command do |at|
|
22
|
+
# system "rake build"
|
23
|
+
# end
|
data/ChangeLog
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
Fri Jun 18 14:26:00 2010 Aaron Patterson <aaron@tenderlovemaking.com>
|
2
|
+
|
3
|
+
* Added a custom field for the "closer" of a ticket.
|
4
|
+
|
5
|
+
Fri Mar 5 08:59:37 2010 Aaron Patterson <aaron@tenderlovemaking.com>
|
6
|
+
|
7
|
+
* Priority is copied around when starting or fixing.
|
8
|
+
|
9
|
+
Thu Mar 4 09:24:46 2010 Aaron Patterson <aaron@tenderlovemaking.com>
|
10
|
+
|
11
|
+
* Description is no longer required to create a ticket
|
12
|
+
|
13
|
+
Thu Mar 4 09:21:03 2010 Aaron Patterson <aaron@tenderlovemaking.com>
|
14
|
+
|
15
|
+
* bin/geera raises an exception on an unknown command.
|
16
|
+
|
17
|
+
Thu Mar 4 09:18:08 2010 Aaron Patterson <aaron@tenderlovemaking.com>
|
18
|
+
|
19
|
+
* 'geera filters' will list your available filters
|
20
|
+
|
21
|
+
Thu Mar 4 09:01:12 2010 Aaron Patterson <aaron@tenderlovemaking.com>
|
22
|
+
|
23
|
+
* 'geera show TICKET' will let you view info about TICKET
|
24
|
+
|
25
|
+
Wed Mar 3 17:50:26 2010 Aaron Patterson <aaron@tenderlovemaking.com>
|
26
|
+
|
27
|
+
* added hacks for silencing Jira4R
|
28
|
+
|
29
|
+
Wed Mar 3 14:40:56 2010 Aaron Patterson <aaron@tenderlovemaking.com>
|
30
|
+
|
31
|
+
* starting and fixing a ticket will maintain description
|
32
|
+
|
33
|
+
Tue Mar 2 10:31:42 2010 Aaron Patterson <aaron@tenderlovemaking.com>
|
34
|
+
|
35
|
+
* Changed "mv" command to "assign".
|
36
|
+
* Added the "create" command.
|
37
|
+
|
38
|
+
=== 1.0.0 / 2010-02-26
|
39
|
+
|
40
|
+
* 1 major enhancement
|
41
|
+
|
42
|
+
* Birthday!
|
43
|
+
|
data/Manifest.txt
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
.autotest
|
2
|
+
ChangeLog
|
3
|
+
Manifest.txt
|
4
|
+
README.rdoc
|
5
|
+
Rakefile
|
6
|
+
bin/geera
|
7
|
+
lib/geera.rb
|
8
|
+
lib/geera/client.rb
|
9
|
+
lib/geera/commands/assign.rb
|
10
|
+
lib/geera/commands/command.rb
|
11
|
+
lib/geera/commands/estimate.rb
|
12
|
+
lib/geera/commands/filters.rb
|
13
|
+
lib/geera/commands/fix.rb
|
14
|
+
lib/geera/commands/list.rb
|
15
|
+
lib/geera/commands/show.rb
|
16
|
+
lib/geera/commands/start.rb
|
17
|
+
lib/geera/commands/take.rb
|
18
|
+
lib/geera/executable.rb
|
19
|
+
lib/geera/ticket.rb
|
20
|
+
lib/template.txt
|
21
|
+
test/commands/test_assign.rb
|
22
|
+
test/commands/test_estimate.rb
|
23
|
+
test/commands/test_filters.rb
|
24
|
+
test/commands/test_fix.rb
|
25
|
+
test/commands/test_list.rb
|
26
|
+
test/commands/test_show.rb
|
27
|
+
test/commands/test_start.rb
|
28
|
+
test/commands/test_take.rb
|
29
|
+
test/test_client.rb
|
30
|
+
test/test_ticket.rb
|
data/README.rdoc
ADDED
@@ -0,0 +1,189 @@
|
|
1
|
+
= geera
|
2
|
+
|
3
|
+
* http://atti.com/
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
Geera is a command line tool for dealing with Jira tickets.
|
8
|
+
|
9
|
+
== FEATURES/PROBLEMS:
|
10
|
+
|
11
|
+
* Uses soap4r
|
12
|
+
|
13
|
+
== SYNOPSIS:
|
14
|
+
|
15
|
+
Geera provides a command line tool for interacting with the Jira ticketing
|
16
|
+
system.
|
17
|
+
|
18
|
+
After you've installed Geera, you must configure your ~/.geera file like this:
|
19
|
+
|
20
|
+
$ geera setup
|
21
|
+
|
22
|
+
That command will create a $HOME/.geera file for you to fill out. The config
|
23
|
+
file will look something like this:
|
24
|
+
|
25
|
+
---
|
26
|
+
url: FIXME
|
27
|
+
username: FIXME
|
28
|
+
qa: FIXME
|
29
|
+
password: FIXME
|
30
|
+
|
31
|
+
The "url" value should point to the Jira API url. "username" and "password"
|
32
|
+
are your username and password for the Jira system. When running "geera fix",
|
33
|
+
the ticket will be automatically reassigned to the username listed in "qa".
|
34
|
+
If the "qa" value is removed, the ticket will not be reassigned when the
|
35
|
+
ticket is fixed.
|
36
|
+
|
37
|
+
=== Basic Usage
|
38
|
+
|
39
|
+
Geera commands have the basic form of "geera ACTION TICKET", where
|
40
|
+
ACTION is the action you want to perform, and TICKET is the ticket on which
|
41
|
+
you wish to perform that action.
|
42
|
+
|
43
|
+
The current available commands are:
|
44
|
+
|
45
|
+
* start
|
46
|
+
* fix
|
47
|
+
* assign
|
48
|
+
* take
|
49
|
+
* create
|
50
|
+
* comment
|
51
|
+
* list
|
52
|
+
|
53
|
+
=== "start" command
|
54
|
+
|
55
|
+
The "start" command lets you start a ticket. This command only works when the
|
56
|
+
ticket is in a startable state. For example:
|
57
|
+
|
58
|
+
$ geera start BZ-1000
|
59
|
+
|
60
|
+
This command will set the state of BZ-1000 to "start". If the ticket is not
|
61
|
+
in a startable state, an error will be displayed.
|
62
|
+
|
63
|
+
=== "fix" command
|
64
|
+
|
65
|
+
The "fix" command puts the ticket in to a fixed state. If the ticket is
|
66
|
+
startable, it will first start the ticket, then put the ticket in fixed state.
|
67
|
+
|
68
|
+
$ geera fix BZ-1000
|
69
|
+
|
70
|
+
The ticket BZ-1000 should be in the "fixed" state. If a user is specified in
|
71
|
+
the "qa" section of the configuration file, the ticket will be automatically
|
72
|
+
reassigned to that user.
|
73
|
+
|
74
|
+
=== "assign" command
|
75
|
+
|
76
|
+
The "assign" command reassigns a ticket to another user. The following command
|
77
|
+
will reassign the ticket BZ-1000 to the user "foo":
|
78
|
+
|
79
|
+
$ geera assign BZ-1000 foo
|
80
|
+
|
81
|
+
=== "take" command
|
82
|
+
|
83
|
+
The "take" command is similar to the "mv" command, but assigns the ticket to
|
84
|
+
the user listed in the "username" section of the configuration file. This
|
85
|
+
command is useful when you wish to "take" a ticket from someone:
|
86
|
+
|
87
|
+
$ geera take BZ-1000
|
88
|
+
|
89
|
+
=== "create" command
|
90
|
+
|
91
|
+
The "create" command will create a new ticket in the JIRA system. It requires
|
92
|
+
a project name on which to create the ticket. For example, if you want to
|
93
|
+
create a ticket in the "BZ" project, the command will look like this:
|
94
|
+
|
95
|
+
$ geera create BZ
|
96
|
+
|
97
|
+
This command will open $EDITOR with a form to fill out. Enter the details of
|
98
|
+
the ticket, and the ticket will be created.
|
99
|
+
|
100
|
+
=== "comment" command
|
101
|
+
|
102
|
+
The "comment" command lets you comment on a ticket. Comments are passed in
|
103
|
+
through the -m flag. For example:
|
104
|
+
|
105
|
+
$ geera comment BZ-1000 -m'This is a comment'
|
106
|
+
|
107
|
+
=== "list" command
|
108
|
+
|
109
|
+
The "list" command lets you list tickets in a filter. You can then take the
|
110
|
+
ticket numbers returned and assign them or whatever.
|
111
|
+
|
112
|
+
$ geera list 1138
|
113
|
+
|
114
|
+
This command prints out the first 10 tickets in the 1138 filter. Of course,
|
115
|
+
named filters would be much nicer. If you add a "filters" hash in your
|
116
|
+
~/.geera file, you can assign names to filter ids.
|
117
|
+
|
118
|
+
filters:
|
119
|
+
all: 12482
|
120
|
+
features: 12481
|
121
|
+
bugs: 12480
|
122
|
+
|
123
|
+
Then you can run:
|
124
|
+
|
125
|
+
$ geera list bugs
|
126
|
+
|
127
|
+
And get the tickets from filter id 12480.
|
128
|
+
|
129
|
+
== Comments
|
130
|
+
|
131
|
+
An optional "-m" flag is available on every command. The "-m" flag will
|
132
|
+
automatically attach a comment to the ticket in addition to the original
|
133
|
+
command performed. For example, we can fix a ticket and add a comment at the
|
134
|
+
same time by doing:
|
135
|
+
|
136
|
+
$ geera fix BZ-1000 -m'I totally fixed this ticket'
|
137
|
+
|
138
|
+
== Example Workflows
|
139
|
+
|
140
|
+
First, start the ticket, then do work, then fix the ticket:
|
141
|
+
|
142
|
+
$ geera start BZ-1000 -m'starting to work on awesome feature'
|
143
|
+
$ ...
|
144
|
+
$ ...
|
145
|
+
$ geera fix BZ-1000 -m'finished awesome feature'
|
146
|
+
|
147
|
+
Maybe you need to add comments while fixing stuff:
|
148
|
+
|
149
|
+
$ geera start BZ-1000 -m'starting to work on awesome feature'
|
150
|
+
$ ...
|
151
|
+
$ geera comment BZ-1000 -m'I had to totally do this thing'
|
152
|
+
$ ...
|
153
|
+
$ geera fix BZ-1000 -m'finished awesome feature'
|
154
|
+
|
155
|
+
You do some work, then need to give the ticket to someone else:
|
156
|
+
|
157
|
+
$ geera start BZ-1000 -m'starting to work on awesome feature'
|
158
|
+
$ ...
|
159
|
+
$ geera mv BZ-1000 coworker -m'This was too hard for me!'
|
160
|
+
|
161
|
+
|
162
|
+
== INSTALL:
|
163
|
+
|
164
|
+
* sudo gem install geera
|
165
|
+
|
166
|
+
== LICENSE:
|
167
|
+
|
168
|
+
(The MIT License)
|
169
|
+
|
170
|
+
Copyright (c) 2010 ATT Interactive
|
171
|
+
|
172
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
173
|
+
a copy of this software and associated documentation files (the
|
174
|
+
'Software'), to deal in the Software without restriction, including
|
175
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
176
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
177
|
+
permit persons to whom the Software is furnished to do so, subject to
|
178
|
+
the following conditions:
|
179
|
+
|
180
|
+
The above copyright notice and this permission notice shall be
|
181
|
+
included in all copies or substantial portions of the Software.
|
182
|
+
|
183
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
184
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
185
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
186
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
187
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
188
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
189
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'hoe'
|
5
|
+
|
6
|
+
Hoe.spec 'geera' do
|
7
|
+
developer('Aaron Patterson', 'apatterson@atti.com')
|
8
|
+
self.readme_file = 'README.rdoc'
|
9
|
+
self.history_file = 'ChangeLog'
|
10
|
+
self.extra_rdoc_files = FileList['*.rdoc']
|
11
|
+
self.extra_deps << ['jira4r', '>= 0.3.0']
|
12
|
+
self.extra_dev_deps << ['flexmock', '>= 0']
|
13
|
+
end
|
14
|
+
|
15
|
+
# vim: syntax=ruby
|
data/bin/geera
ADDED
@@ -0,0 +1,118 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'tmpdir'
|
5
|
+
require 'geera'
|
6
|
+
require 'yaml'
|
7
|
+
require 'optparse'
|
8
|
+
|
9
|
+
config = File.join(ENV['HOME'], '.geera')
|
10
|
+
login = YAML.load(File.read config) rescue nil
|
11
|
+
BUG_TEMPLATE = File.expand_path(File.join(
|
12
|
+
File.dirname(__FILE__), '..', 'lib', 'template.txt'))
|
13
|
+
|
14
|
+
unless login
|
15
|
+
File.open config, 'wb' do |f|
|
16
|
+
|
17
|
+
options = {
|
18
|
+
'username' => 'FIXME',
|
19
|
+
'password' => 'FIXME',
|
20
|
+
'url' => 'FIXME',
|
21
|
+
'qa' => 'FIXME'
|
22
|
+
}
|
23
|
+
|
24
|
+
YAML.dump options, f
|
25
|
+
f.chmod(0600)
|
26
|
+
end
|
27
|
+
abort "Created ~/.geera for you. Fill it out"
|
28
|
+
end
|
29
|
+
|
30
|
+
|
31
|
+
options = {}
|
32
|
+
OptionParser.new do |opts|
|
33
|
+
opts.banner = <<-EOF
|
34
|
+
Usage: geera <command> <ticket|project> [options]
|
35
|
+
|
36
|
+
Commands:
|
37
|
+
show - Shows ticket details
|
38
|
+
`geera show TK-421`
|
39
|
+
create - Creates a new ticket in a project
|
40
|
+
`geera create TK`
|
41
|
+
fix - Marks a ticket as fixed and assigns to QA.
|
42
|
+
`geera fix TK-421`
|
43
|
+
assign - Assigns a ticket to someone else
|
44
|
+
`geera reassign TK-421 glucas`
|
45
|
+
take - Assigns a ticket to yourself
|
46
|
+
`geera take TK-421`
|
47
|
+
list - Lists tickets in a filter
|
48
|
+
`geera list 1138`
|
49
|
+
`geera list my-filter-name`
|
50
|
+
filters - Lists your filters
|
51
|
+
`geera filters`
|
52
|
+
comment - Simply comment on the ticket
|
53
|
+
`geera comment TK-421 --message 'This is a difficult bug.'`
|
54
|
+
|
55
|
+
Options:
|
56
|
+
EOF
|
57
|
+
|
58
|
+
opts.on("-m", "--message MESSAGE", "Add a comment") do |v|
|
59
|
+
options[:message] = v
|
60
|
+
end
|
61
|
+
end.parse!
|
62
|
+
|
63
|
+
exec = Geera::Executable.new login, ARGV, options
|
64
|
+
geera = exec.geera
|
65
|
+
|
66
|
+
command = ARGV.shift
|
67
|
+
number = ARGV.shift
|
68
|
+
ticket = geera.ticket number
|
69
|
+
|
70
|
+
case command
|
71
|
+
when 'start'
|
72
|
+
command = Geera::Commands::Start.new login, number, geera, ARGV
|
73
|
+
command.execute!
|
74
|
+
when 'estimate'
|
75
|
+
command = Geera::Commands::Estimate.new login, number, geera, ARGV
|
76
|
+
command.execute!
|
77
|
+
when 'fix'
|
78
|
+
command = Geera::Commands::Fix.new login, number, geera, ARGV
|
79
|
+
command.execute!
|
80
|
+
when 'assign'
|
81
|
+
command = Geera::Commands::Assign.new login, number, geera, ARGV
|
82
|
+
command.execute!
|
83
|
+
when 'take'
|
84
|
+
command = Geera::Commands::Take.new login, number, geera, ARGV
|
85
|
+
command.execute!
|
86
|
+
when 'show'
|
87
|
+
command = Geera::Commands::Show.new login, number, geera, ARGV
|
88
|
+
command.execute!
|
89
|
+
when 'filters'
|
90
|
+
command = Geera::Commands::Filters.new login, number, geera, ARGV
|
91
|
+
command.execute!
|
92
|
+
when 'list'
|
93
|
+
number = (login['filters'] && login['filters'][number]) || number
|
94
|
+
|
95
|
+
command = Geera::Commands::List.new login, number, geera, ARGV
|
96
|
+
command.execute!
|
97
|
+
when 'create'
|
98
|
+
fname = File.join(Dir.tmpdir, 'bug.txt')
|
99
|
+
File.open(fname, 'wb') do |f|
|
100
|
+
f.write File.read(BUG_TEMPLATE)
|
101
|
+
end
|
102
|
+
|
103
|
+
system("#{ENV['EDITOR'] || 'vi'} #{fname}")
|
104
|
+
contents = File.read(fname)
|
105
|
+
sum, desc = contents.split('##### Description is below here #####')
|
106
|
+
|
107
|
+
ticket = geera.create_ticket :project => number,
|
108
|
+
:summary => sum.sub(/^Summary:/, '').strip,
|
109
|
+
:description => desc && desc.strip
|
110
|
+
|
111
|
+
puts "Created ticket: #{ticket.number}"
|
112
|
+
when 'comment'
|
113
|
+
# Do nothing, let the -m flag pick it up
|
114
|
+
else
|
115
|
+
raise "unknown command: #{command}"
|
116
|
+
end
|
117
|
+
|
118
|
+
ticket.comment options[:message] if options[:message]
|
data/lib/geera.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'jira4r'
|
2
|
+
require 'geera/client'
|
3
|
+
require 'geera/ticket'
|
4
|
+
require 'geera/executable'
|
5
|
+
require 'geera/commands/command'
|
6
|
+
require 'geera/commands/assign'
|
7
|
+
require 'geera/commands/start'
|
8
|
+
require 'geera/commands/fix'
|
9
|
+
require 'geera/commands/take'
|
10
|
+
require 'geera/commands/show'
|
11
|
+
require 'geera/commands/filters'
|
12
|
+
require 'geera/commands/list'
|
13
|
+
require 'geera/commands/estimate'
|
14
|
+
|
15
|
+
module Geera
|
16
|
+
VERSION = '1.2.3'
|
17
|
+
end
|
18
|
+
|
19
|
+
# Total hacks for shutting up Jira4R
|
20
|
+
class Jira4R::JiraTool
|
21
|
+
def puts *args
|
22
|
+
end
|
23
|
+
end
|