mongo-jira 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODRhOTNkZDY1NjBiNDUwMTg4MmZmN2U2YWNlYTUxNTNiN2EyYjg4Zg==
4
+ Njk4MTc4MjY3YWU4ZGUzN2UwODQ5MzM1OWNjZTZlNWY0N2Q2YWRjMg==
5
5
  data.tar.gz: !binary |-
6
- YmQ3OGYyMWIxMzcwODFhZjkzNzIzNGQzMDZkMjU1NTljZWU4Yzg3Mg==
6
+ ZjdiNzkwNTMyYmNmNjk5MjE3MzY0YmY1MGUwZWYyNmEyNjYzZmI5OQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MDBiOTc1MmMxMGQ0N2VlMmQ4MDMzMDgzMzY3MWUzMWJjYzBiMDBhY2VlNzY0
10
- ZTRhZWE2NjI2ODE4YzczZjZhMWZkNTZkMzM4ZTViMjVlMjg3MTllYzBjNzU2
11
- ZTY4ZDY1ZTNhZjIwZmIzNmJhODRmZjI2NDVhMDQyNjJjZmZkMjc=
9
+ NDY3ZTQxYTMyYzk2YWU4MTUyOWZhZWE2MzM2MDIwNmFkNjM2MmIwNzVjNWE1
10
+ YWIwZjc4NzEyZTU0MDJlNzk2Mzc1M2MyNzdjMWVjNjIxMTUzMzQyYWEwYjhm
11
+ MjM1NmYzNWFmYjIyMTZiMDFjODAzODkzY2JlYTJhNzVmNzIyNjU=
12
12
  data.tar.gz: !binary |-
13
- YzFlZDA0YjhhMTkzZWM0NzU1ODBiYzQxNGFlZGRjYjE4ODFkOTAwOGYxYjM2
14
- OTBlNGFjOWUwNDdiMWVhMGYwYTU2NzRhZTUxZjI5M2U2NmU2MjAwMjAwNjli
15
- NGI5YmI3NjgyNGNmNzg5ZWZhMzQ4MDk2MWIzN2RkYjY0YzRiNTc=
13
+ ZTFmZmQ4YWU2YjczM2E2MGRlMTg0Yzc5ZTUwMGE0MDk1Y2M3MmVmMDVlMTI4
14
+ NzgwOTRiNTlhZmU2OWM3OTExMDNkYjEyZTIyYWRmY2E3NzA5NWEzM2U5MGUz
15
+ NTkwZjUwZjRlYjNiOGEwMDIxZDZkNTI1ZmZhOWNlOGQ5NWVmYjg=
Binary file
data.tar.gz.sig CHANGED
Binary file
data/bin/jira CHANGED
@@ -21,7 +21,7 @@ tengen = HighLine::ColorScheme.new do |cs|
21
21
  cs[:p2] = [:red]
22
22
  cs[:p3] = [:cyan]
23
23
  cs[:p4] = [:green]
24
- cs[:p4] = [:green]
24
+ cs[:p5] = [:green]
25
25
  end
26
26
  HighLine.color_scheme = tengen
27
27
 
@@ -55,7 +55,7 @@ END
55
55
  global_option('-c', '--creds FILE', 'Load config data for your commands to use') { |file| $config = file }
56
56
  global_option('-V', 'increment verbosity level, i.e. -VV for higher debug level') { $level += 1}
57
57
 
58
- default_command :projects
58
+ default_command :show
59
59
 
60
60
  command :init do |c|
61
61
  c.syntax = 'jira init [options]'
@@ -339,8 +339,14 @@ def prompt(name, default=nil)
339
339
  ask("#{name} (<%= color(\"#{default}\", RED) %>) ? ", lambda { |v| v.blank? ? default : v })
340
340
  end
341
341
 
342
+ class Object
343
+ def try(name,*args)
344
+ self.send(name,args) rescue nil
345
+ end
346
+ end unless self.respond_to?(:try)
347
+
342
348
  def header(ticket)
343
- [ticket.key.ljust(15) ,ticket.summary , fix_versions(ticket), priority(ticket)].compact
349
+ [ticket.key.ljust(15) ,ticket.summary , fix_versions(ticket), priority(ticket),company(ticket)].compact
344
350
  end
345
351
 
346
352
  def comment(comment)
@@ -360,6 +366,11 @@ def comment(comment)
360
366
  [hdr , DateTime.parse(comment['updated']).strftime('%D %T'), dev_only].compact
361
367
  end
362
368
 
369
+ FIELD = 'customfield_10030'
370
+ def company(ticket)
371
+ ticket.attrs['fields'][FIELD]["name"] if ticket.attrs['fields'] && ticket.attrs['fields'][FIELD]
372
+ end
373
+
363
374
  def fix_versions(ticket)
364
375
  if ticket.try(:fixVersions)
365
376
  trace "fixVersions #{JSON.pretty_generate(ticket.fixVersions)}"
@@ -383,19 +394,20 @@ def fix_versions(ticket)
383
394
  end
384
395
 
385
396
  def priority(ticket)
386
- if ticket.respond_to?(:priority)
387
- trace "priority #{JSON.pretty_generate(ticket.priority.attrs)}"
388
- c = case ticket.priority.attrs['name']
389
- when /p1$/i ; ':p1'
390
- when /p2$/i ; ':p2'
391
- when /p3$/i ; ':p3'
392
- when /p4$/i ; ':p4'
393
- when /p5$/i ; ':p5'
394
- else
395
- ':error'
397
+ c = ':error'
398
+ if ticket.respond_to?(:priority)
399
+ trace "priority #{JSON.pretty_generate(ticket.priority.attrs)}"
400
+ c = case ticket.priority.attrs['name']
401
+ when /p1$/i ; ':p1'
402
+ when /p2$/i ; ':p2'
403
+ when /p3$/i ; ':p3'
404
+ when /p4$/i ; ':p4'
405
+ when /p5$/i ; ':p5'
406
+ else
407
+ ':error'
408
+ end
396
409
  end
397
410
  "<%= color(\"#{ticket.priority.attrs['name']}\", #{c}) %>"
398
- end
399
411
  end
400
412
 
401
413
  class DummyProgressBar
@@ -1,5 +1,5 @@
1
1
  module Mongo
2
2
  module Jira
3
- VERSION = "0.0.1"
3
+ VERSION = '0.0.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongo-jira
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim O'Leary
metadata.gz.sig CHANGED
Binary file