jiraa 1.0.3 → 1.0.4
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/jiraa +62 -12
- data/jiraa.gemspec +2 -1
- data/lib/jiraa/version.rb +1 -1
- metadata +22 -6
data/bin/jiraa
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
require 'gli'
|
3
3
|
require 'jira_client'
|
4
4
|
require 'yaml'
|
5
|
+
require 'colorize'
|
5
6
|
begin # XXX: Remove this begin/rescue before distributing your app
|
6
7
|
require 'jiraa'
|
7
8
|
rescue LoadError
|
@@ -116,7 +117,7 @@ command "start-progress" do |c|
|
|
116
117
|
c.action do |global_options,options,args|
|
117
118
|
help_now! "Missing issue key" if args.length == 0
|
118
119
|
JiraClient.start_progress_on_issue args[0]
|
119
|
-
"Progress started on #{args[0]}"
|
120
|
+
puts "Progress started on #{args[0]}"
|
120
121
|
end
|
121
122
|
end
|
122
123
|
|
@@ -138,8 +139,7 @@ command "log-work" do |c|
|
|
138
139
|
params[:comment] = options[:comment] unless options[:comment].nil?
|
139
140
|
params[:remaining_estimate] = options["remaining-estimate"] unless options["remaining-estimate"].nil?
|
140
141
|
JiraClient.create_worklog(args[0], args[1], params)
|
141
|
-
|
142
|
-
puts " and set remaining estimate to #{params[:remaining_estimate]}" if params.has_key? :remaining_estimate
|
142
|
+
puts "Logged #{args[1]} on #{args[0]}"
|
143
143
|
end
|
144
144
|
end
|
145
145
|
|
@@ -156,15 +156,52 @@ end
|
|
156
156
|
desc 'Display detailed information about an issue'
|
157
157
|
arg_name 'ISSUE'
|
158
158
|
command :show do |c|
|
159
|
+
|
160
|
+
c.desc 'Display subtasks'
|
161
|
+
c.switch [:s, :subtasks]
|
162
|
+
|
163
|
+
c.desc 'Display description'
|
164
|
+
c.default_value true
|
165
|
+
c.switch [:d, :description]
|
166
|
+
|
167
|
+
c.desc 'Display comments'
|
168
|
+
c.switch [:c, :comments]
|
169
|
+
|
159
170
|
c.action do |global_options,options,args|
|
160
171
|
help_now! "Missing issue key" if args.length == 0
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
172
|
+
fields = [:summary, :status, :issuetype]
|
173
|
+
fields << :description if options[:description]
|
174
|
+
fields << :subtasks if options[:subtasks]
|
175
|
+
fields << :comment if options[:comments]
|
176
|
+
issue = JiraClient.find_issue_by_key(args[0], :fields => fields)
|
177
|
+
color = issue_color(issue)
|
178
|
+
header = "#{issue.key}\t#{issue.summary}".colorize(color)
|
179
|
+
puts "#{header} [#{issue.status.name.upcase}]"
|
180
|
+
if options[:subtasks]
|
181
|
+
puts
|
182
|
+
puts "SUBTASKS"
|
183
|
+
puts
|
184
|
+
issue.subtasks.each do |subtask|
|
185
|
+
puts " #{subtask.key}\t#{subtask.summary} [#{subtask.status.name.upcase}]"
|
186
|
+
end
|
187
|
+
puts
|
188
|
+
end
|
189
|
+
if options[:description]
|
190
|
+
puts
|
191
|
+
puts "DESCRIPTION"
|
192
|
+
puts
|
193
|
+
puts " #{issue.description}".gsub("\n", "\n ") if options[:description]
|
194
|
+
end
|
195
|
+
if options[:comments]
|
196
|
+
puts
|
197
|
+
puts "COMMENTS"
|
198
|
+
puts
|
199
|
+
issue.comments.each do |comment|
|
200
|
+
puts " #{comment.author}: #{comment.created.strftime("%e-%b-%Y (%H:%M)")}"
|
201
|
+
puts " #{comment.body}"
|
202
|
+
puts
|
203
|
+
end
|
204
|
+
end
|
168
205
|
end
|
169
206
|
end
|
170
207
|
|
@@ -173,9 +210,10 @@ arg_name 'JQL'
|
|
173
210
|
command :search do |c|
|
174
211
|
c.action do |global_options,options,args|
|
175
212
|
help_now! "Missing JQL statement" if args.length == 0
|
176
|
-
issues = JiraClient.find_issues(:jql => args[0], :fields => [:summary, :status])
|
213
|
+
issues = JiraClient.find_issues(:jql => args[0], :fields => [:summary, :status, :issuetype])
|
177
214
|
issues.each do |issue|
|
178
|
-
|
215
|
+
color = issue_color(issue)
|
216
|
+
puts "#{issue.key}\t#{issue.summary}".colorize(color)
|
179
217
|
end
|
180
218
|
puts "No issues found" if issues.empty?
|
181
219
|
end
|
@@ -256,4 +294,16 @@ def configure_client(config)
|
|
256
294
|
end
|
257
295
|
end
|
258
296
|
|
297
|
+
def issue_color(issue)
|
298
|
+
color = case issue.issuetype.name
|
299
|
+
when "Bug"
|
300
|
+
:red
|
301
|
+
when "Task"
|
302
|
+
:blue
|
303
|
+
when "Story"
|
304
|
+
:green
|
305
|
+
end
|
306
|
+
color
|
307
|
+
end
|
308
|
+
|
259
309
|
exit run(ARGV)
|
data/jiraa.gemspec
CHANGED
@@ -23,6 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_development_dependency "aruba"
|
24
24
|
spec.add_development_dependency "cucumber"
|
25
25
|
|
26
|
-
spec.add_runtime_dependency "jira_client", "1.0.
|
26
|
+
spec.add_runtime_dependency "jira_client", ">= 1.0.1"
|
27
27
|
spec.add_runtime_dependency "gli", "2.5.6"
|
28
|
+
spec.add_runtime_dependency "colorize", "0.5.8"
|
28
29
|
end
|
data/lib/jiraa/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jiraa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
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: 2013-05-
|
12
|
+
date: 2013-05-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -80,17 +80,17 @@ dependencies:
|
|
80
80
|
requirement: !ruby/object:Gem::Requirement
|
81
81
|
none: false
|
82
82
|
requirements:
|
83
|
-
- - '
|
83
|
+
- - ! '>='
|
84
84
|
- !ruby/object:Gem::Version
|
85
|
-
version: 1.0.
|
85
|
+
version: 1.0.1
|
86
86
|
type: :runtime
|
87
87
|
prerelease: false
|
88
88
|
version_requirements: !ruby/object:Gem::Requirement
|
89
89
|
none: false
|
90
90
|
requirements:
|
91
|
-
- - '
|
91
|
+
- - ! '>='
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version: 1.0.
|
93
|
+
version: 1.0.1
|
94
94
|
- !ruby/object:Gem::Dependency
|
95
95
|
name: gli
|
96
96
|
requirement: !ruby/object:Gem::Requirement
|
@@ -107,6 +107,22 @@ dependencies:
|
|
107
107
|
- - '='
|
108
108
|
- !ruby/object:Gem::Version
|
109
109
|
version: 2.5.6
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: colorize
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - '='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 0.5.8
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - '='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 0.5.8
|
110
126
|
description: A CLI for the Jira 5 REST API
|
111
127
|
email:
|
112
128
|
- m.williams@me.com
|