pt-flow 0.1.6 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/pt-flow/ui.rb +21 -16
  2. data/lib/pt-flow/version.rb +1 -1
  3. metadata +13 -33
data/lib/pt-flow/ui.rb CHANGED
@@ -7,35 +7,32 @@ class PT::Flow::UI < PT::UI
7
7
  def start
8
8
  tasks = @client.get_work(@project)
9
9
  table = PT::TasksTable.new(tasks)
10
- if @params[0]
11
- task = table[@params[0].to_i]
12
- else
13
- title("Available tasks in #{project_to_s}")
14
- task = select("Please select a task to start working on", table)
15
- end
10
+ title("Available tasks in #{project_to_s}")
11
+ task = select("Please select a task to start working on", table)
16
12
 
17
13
  estimate_task(task, ask("How many points do you estimate for it? (#{@project.point_scale})")) if task.estimate && task.estimate < 0
18
14
  assign_task(task, @local_config[:user_name])
19
15
  start_task(task)
20
- `git checkout -B #{task.id}`
16
+ `git checkout -B #{current_target}-#{task.id}`
21
17
  end
22
18
 
23
19
  def finish
24
20
  `git push origin #{current_branch}`
25
- task = PivotalTracker::Story.find(current_branch, @project.id)
21
+ task = PivotalTracker::Story.find(current_task_id, @project.id)
26
22
  finish_task(task)
27
- pull_request_url = "#{github_page_url}/pull/new/#{current_branch}?title=#{task.name} [##{task.id}]&body=#{task.url}"
23
+ pull_request_url = "#{github_page_url}/pull/new/#{current_target}...#{current_branch}?title=#{task.name} [##{task.id}]&body=#{task.url}"
28
24
  `open '#{pull_request_url}'`
29
25
  end
30
26
 
31
27
  def deliver
32
- branch = @params[0] || current_branch
33
- `git checkout master`
34
- `git merge #{branch}`
35
- `git push origin master`
36
- `git push origin :#{branch}`
37
- `git branch -d #{branch}`
38
- task = PivotalTracker::Story.find(branch, @project.id)
28
+ `git fetch`
29
+ `git checkout #{current_target}`
30
+ `git pull --rebase origin #{current_target}`
31
+ `git merge #{current_branch}`
32
+ `git push origin #{current_target}`
33
+ `git push origin :#{current_branch}`
34
+ `git branch -d #{current_branch}`
35
+ task = PivotalTracker::Story.find(current_task_id, @project.id)
39
36
  deliver_task(task)
40
37
  end
41
38
 
@@ -87,4 +84,12 @@ class PT::Flow::UI < PT::UI
87
84
  def current_branch
88
85
  @current_branch ||= `git rev-parse --abbrev-ref HEAD`.strip
89
86
  end
87
+
88
+ def current_target
89
+ current_branch.split('-').first
90
+ end
91
+
92
+ def current_task_id
93
+ current_branch.split('-').last
94
+ end
90
95
  end
@@ -1,5 +1,5 @@
1
1
  module PT
2
2
  module Flow
3
- VERSION = "0.1.6"
3
+ VERSION = "0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pt-flow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: '0.2'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-10 00:00:00.000000000 Z
12
+ date: 2012-10-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pt
16
- requirement: !ruby/object:Gem::Requirement
16
+ requirement: &70237517292560 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,15 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: '0'
24
+ version_requirements: *70237517292560
30
25
  - !ruby/object:Gem::Dependency
31
26
  name: rspec
32
- requirement: !ruby/object:Gem::Requirement
27
+ requirement: &70237509107220 !ruby/object:Gem::Requirement
33
28
  none: false
34
29
  requirements:
35
30
  - - ~>
@@ -37,15 +32,10 @@ dependencies:
37
32
  version: '2.9'
38
33
  type: :development
39
34
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ~>
44
- - !ruby/object:Gem::Version
45
- version: '2.9'
35
+ version_requirements: *70237509107220
46
36
  - !ruby/object:Gem::Dependency
47
37
  name: guard
48
- requirement: !ruby/object:Gem::Requirement
38
+ requirement: &70237509108900 !ruby/object:Gem::Requirement
49
39
  none: false
50
40
  requirements:
51
41
  - - ! '>='
@@ -53,15 +43,10 @@ dependencies:
53
43
  version: '0'
54
44
  type: :development
55
45
  prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
46
+ version_requirements: *70237509108900
62
47
  - !ruby/object:Gem::Dependency
63
48
  name: guard-rspec
64
- requirement: !ruby/object:Gem::Requirement
49
+ requirement: &70237513253180 !ruby/object:Gem::Requirement
65
50
  none: false
66
51
  requirements:
67
52
  - - ! '>='
@@ -69,12 +54,7 @@ dependencies:
69
54
  version: '0'
70
55
  type: :development
71
56
  prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ! '>='
76
- - !ruby/object:Gem::Version
77
- version: '0'
57
+ version_requirements: *70237513253180
78
58
  description: Some extra methods for the pt gem to use in our dev flow.
79
59
  email:
80
60
  - jens@balvig.com
@@ -112,7 +92,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
112
92
  version: '0'
113
93
  segments:
114
94
  - 0
115
- hash: 3650737686470413081
95
+ hash: 3947336664115380543
116
96
  required_rubygems_version: !ruby/object:Gem::Requirement
117
97
  none: false
118
98
  requirements:
@@ -121,10 +101,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
101
  version: '0'
122
102
  segments:
123
103
  - 0
124
- hash: 3650737686470413081
104
+ hash: 3947336664115380543
125
105
  requirements: []
126
106
  rubyforge_project:
127
- rubygems_version: 1.8.23
107
+ rubygems_version: 1.8.11
128
108
  signing_key:
129
109
  specification_version: 3
130
110
  summary: Some extra methods for the pt gem to use in our dev flow.