djanowski-helm 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -64,3 +64,8 @@ Examples:
64
64
 
65
65
  $ helm assign 13
66
66
  $ helm assign 13 [Lighthouse user ID]
67
+
68
+
69
+ Contributing
70
+ -------------
71
+ Please report bugs, submit feedback and patches to [http://helm.lighthouseapp.com/projects/22826-helm](http://helm.lighthouseapp.com/projects/22826-helm)
data/bin/helm CHANGED
@@ -13,15 +13,20 @@ if ARGV.empty?
13
13
  # Display information about a particular milestone.
14
14
  $ helm show [milestone id]
15
15
 
16
+ # Open the ticket in a web browser (`open` must be available).
17
+ $ helm open [ticket id]
18
+
16
19
  # Assign a ticket to self.
17
20
  $ helm assign [ticket id]
18
21
 
19
22
  # Assign a ticket to another user.
20
23
  $ helm assign [ticket id] [user id]
21
24
 
25
+ # Change the status of a ticket.
26
+ $ helm status [ticket id] [new|open|resolved|...]
22
27
 
23
28
  # Assign a ticket to a milestone.
24
- $ helm assign [ticket id] [milestone name]
29
+ $ helm schedule [ticket id] [milestone name]
25
30
 
26
31
  # Create a new ticket.
27
32
  $ echo "Ticket description" | helm create
@@ -33,8 +38,7 @@ end
33
38
 
34
39
  require 'rubygems'
35
40
 
36
- gem 'soveran-drawer', '>= 0.0.5'
37
- require 'drawer'
41
+ require File.join('vendor', 'drawer')
38
42
 
39
43
  require File.join(File.dirname(__FILE__), '..', 'lib', 'helm')
40
44
 
@@ -8,7 +8,9 @@ require File.dirname(__FILE__) + '/helm/commands/assign'
8
8
  require File.dirname(__FILE__) + '/helm/commands/create'
9
9
  require File.dirname(__FILE__) + '/helm/commands/info'
10
10
  require File.dirname(__FILE__) + '/helm/commands/list'
11
+ require File.dirname(__FILE__) + '/helm/commands/open'
11
12
  require File.dirname(__FILE__) + '/helm/commands/resolve'
12
13
  require File.dirname(__FILE__) + '/helm/commands/schedule'
13
14
  require File.dirname(__FILE__) + '/helm/commands/show'
15
+ require File.dirname(__FILE__) + '/helm/commands/status'
14
16
  require File.dirname(__FILE__) + '/helm/commands/upload'
@@ -0,0 +1,11 @@
1
+ module Helm
2
+ module Commands
3
+ class Open < Command
4
+ def run
5
+ parameters :ticket
6
+
7
+ system "open #{session.url}/projects/#{session.project_id}/tickets/#{session[:ticket]}"
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,21 @@
1
+ module Helm
2
+ module Commands
3
+ class Status < Command
4
+ def run
5
+ parameters :ticket, :status
6
+
7
+ ticket = session.ticket
8
+
9
+ old_status, new_status = ticket.state, session[:status]
10
+
11
+ unless old_status == new_status
12
+ ticket.state = new_status
13
+
14
+ if ticket.save
15
+ puts format.ticket_change(ticket, :status, old_status, new_status)
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -56,7 +56,14 @@ module Helm
56
56
  end
57
57
 
58
58
  def project
59
- @project ||= Lighthouse::Project.find(:all).detect {|p| p.name == options.project }
59
+ @project ||= Lighthouse::Project.find(project_id)
60
+ end
61
+
62
+ def project_id
63
+ cache.get("#{url}---#{options.project}") do
64
+ @project = Lighthouse::Project.find(:all).detect {|p| p.name == options.project }
65
+ @project.id
66
+ end
60
67
  end
61
68
 
62
69
  def new_ticket
@@ -73,7 +80,6 @@ module Helm
73
80
 
74
81
  def milestone(*args)
75
82
  # TODO: ugly
76
- debugger
77
83
 
78
84
  if args.empty?
79
85
  milestone_by_title(self[:milestone])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: djanowski-helm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damian Janowski
@@ -28,7 +28,7 @@ dependencies:
28
28
  requirements:
29
29
  - - ">="
30
30
  - !ruby/object:Gem::Version
31
- version: 0.0.5
31
+ version: 0.0.6
32
32
  version:
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: activeresource
@@ -53,18 +53,18 @@ files:
53
53
  - lib/helm/commands/create.rb
54
54
  - lib/helm/commands/info.rb
55
55
  - lib/helm/commands/list.rb
56
+ - lib/helm/commands/open.rb
56
57
  - lib/helm/commands/resolve.rb
57
58
  - lib/helm/commands/schedule.rb
58
59
  - lib/helm/commands/show.rb
60
+ - lib/helm/commands/status.rb
59
61
  - lib/helm/commands/upload.rb
60
62
  - lib/helm/formatter.rb
61
63
  - lib/helm/lighthouse.rb
62
64
  - lib/helm/project.rb
63
65
  - lib/helm/session.rb
64
66
  - lib/helm.rb
65
- - README.html
66
67
  - README.markdown
67
- - README.textile
68
68
  - LICENSE
69
69
  - Rakefile
70
70
  has_rdoc: false