geera 1.2.3 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,6 +12,7 @@ lib/geera/commands/estimate.rb
12
12
  lib/geera/commands/filters.rb
13
13
  lib/geera/commands/fix.rb
14
14
  lib/geera/commands/list.rb
15
+ lib/geera/commands/resolve.rb
15
16
  lib/geera/commands/show.rb
16
17
  lib/geera/commands/start.rb
17
18
  lib/geera/commands/take.rb
data/Rakefile CHANGED
@@ -3,6 +3,8 @@
3
3
  require 'rubygems'
4
4
  require 'hoe'
5
5
 
6
+ Hoe.plugin :isolate
7
+
6
8
  Hoe.spec 'geera' do
7
9
  developer('Aaron Patterson', 'apatterson@atti.com')
8
10
  self.readme_file = 'README.rdoc'
data/bin/geera CHANGED
@@ -67,6 +67,8 @@ command = ARGV.shift
67
67
  number = ARGV.shift
68
68
  ticket = geera.ticket number
69
69
 
70
+ project = number # for readability
71
+
70
72
  case command
71
73
  when 'start'
72
74
  command = Geera::Commands::Start.new login, number, geera, ARGV
@@ -77,6 +79,9 @@ when 'estimate'
77
79
  when 'fix'
78
80
  command = Geera::Commands::Fix.new login, number, geera, ARGV
79
81
  command.execute!
82
+ when 'resolve'
83
+ command = Geera::Commands::Resolve.new login, number, geera, ARGV
84
+ command.execute!
80
85
  when 'assign'
81
86
  command = Geera::Commands::Assign.new login, number, geera, ARGV
82
87
  command.execute!
@@ -94,6 +99,19 @@ when 'list'
94
99
 
95
100
  command = Geera::Commands::List.new login, number, geera, ARGV
96
101
  command.execute!
102
+ when /components?/
103
+ p Hash[*geera.components(project).map { |c| [c.name, c.id] }.flatten]
104
+ when /quicky?/
105
+ # TODO: this is horrid UI, but it works for me for now...
106
+ component = ARGV.shift
107
+ user = ARGV.shift
108
+ summary = ARGV.join(" ")
109
+ ticket = geera.create_ticket(:project => project,
110
+ :summary => summary,
111
+ :assignee => user,
112
+ :components => geera.component(project,
113
+ component))
114
+ puts "Created ticket: #{ticket.number}"
97
115
  when 'create'
98
116
  fname = File.join(Dir.tmpdir, 'bug.txt')
99
117
  File.open(fname, 'wb') do |f|
@@ -104,7 +122,7 @@ when 'create'
104
122
  contents = File.read(fname)
105
123
  sum, desc = contents.split('##### Description is below here #####')
106
124
 
107
- ticket = geera.create_ticket :project => number,
125
+ ticket = geera.create_ticket :project => project,
108
126
  :summary => sum.sub(/^Summary:/, '').strip,
109
127
  :description => desc && desc.strip
110
128
 
@@ -5,6 +5,7 @@ require 'geera/executable'
5
5
  require 'geera/commands/command'
6
6
  require 'geera/commands/assign'
7
7
  require 'geera/commands/start'
8
+ require 'geera/commands/resolve'
8
9
  require 'geera/commands/fix'
9
10
  require 'geera/commands/take'
10
11
  require 'geera/commands/show'
@@ -13,7 +14,7 @@ require 'geera/commands/list'
13
14
  require 'geera/commands/estimate'
14
15
 
15
16
  module Geera
16
- VERSION = '1.2.3'
17
+ VERSION = '1.3.0'
17
18
  end
18
19
 
19
20
  # Total hacks for shutting up Jira4R
@@ -26,6 +26,14 @@ module Geera
26
26
  Geera::Ticket.new self, number
27
27
  end
28
28
 
29
+ def components project
30
+ self.ctx.getComponents(project)
31
+ end
32
+
33
+ def component project, name
34
+ self.components(project).find { |c| c.name.downcase == name.downcase }
35
+ end
36
+
29
37
  ###
30
38
  # Create a ticket using +params+. +params+ should be a hash, and *must*
31
39
  # have a +project+, +summary+, and +description+ field.
@@ -46,6 +54,7 @@ module Geera
46
54
  issue.summary = params[:summary]
47
55
  issue.description = params[:description]
48
56
  issue.assignee = params[:assignee] || @username
57
+ issue.components = params[:components]
49
58
  issue.type = '1' #FIXME: wtf is this for?
50
59
  issue.priority = '5'
51
60
  issue = @ctx.createIssue issue
@@ -0,0 +1,13 @@
1
+ module Geera
2
+ module Commands
3
+ class Resolve < Geera::Commands::Command
4
+ def self.handle? command
5
+ 'resolve' == command
6
+ end
7
+
8
+ def execute!
9
+ ticket.resolve!
10
+ end
11
+ end
12
+ end
13
+ end
@@ -50,7 +50,17 @@ module Geera
50
50
  action = available_actions.find { |x| x.name == 'Fix' }
51
51
  @ctx.progressWorkflowAction(@number, action.id, passthrough_attributes + [
52
52
  Jira4R::V2::RemoteFieldValue.new('customfield_10176', @client.username),
53
- ])
53
+ ]) # FIX: wtf is that hardcoded string? That can't be right
54
+ # TODO: redesign to be subclassed and override passthrough_attributes
55
+ end
56
+
57
+ ###
58
+ # Resolve this ticket.
59
+ def resolve!
60
+ action = available_actions.find { |x| x.name == 'Resolve' }
61
+ @ctx.progressWorkflowAction(@number, action.id, passthrough_attributes + [
62
+ Jira4R::V2::RemoteFieldValue.new('customfield_10176', @client.username),
63
+ ]) # FIX: wtf is that hardcoded string? That can't be right
54
64
  end
55
65
 
56
66
  ###
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geera
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
- - 2
9
8
  - 3
10
- version: 1.2.3
9
+ - 0
10
+ version: 1.3.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Aaron Patterson
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-06-18 00:00:00 -07:00
18
+ date: 2010-09-22 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -106,6 +106,7 @@ files:
106
106
  - lib/geera/commands/filters.rb
107
107
  - lib/geera/commands/fix.rb
108
108
  - lib/geera/commands/list.rb
109
+ - lib/geera/commands/resolve.rb
109
110
  - lib/geera/commands/show.rb
110
111
  - lib/geera/commands/start.rb
111
112
  - lib/geera/commands/take.rb