pt-flow 2.4.0 → 2.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 77fb3dc8e8d07bdfbaf223f39de7e54a65e4e438
4
- data.tar.gz: 9d69c63af251e2b325f57194b3dbfb17bb4ea3d3
3
+ metadata.gz: 5dad96a8e3224c8cbe72165d4a2cf1b8739668ce
4
+ data.tar.gz: 81195faf964969a93f3a1c6e2c298938682b276c
5
5
  SHA512:
6
- metadata.gz: 868f82165f1cf1079feb7edbce03e775150eefa48f994ca35f67f81a05717a6bdd254275134db825e49045e6388df03eedf243e9c2a88c79759ac039a05e2640
7
- data.tar.gz: b51f189779b071d1f2af038c382070a68420dc8f7789fed2654f3720d5ee266a633e8621b1db020d6dc4d648d78e041a01f3623552b537e14faea7b341f7b07d
6
+ metadata.gz: 7aaac10e0375f9b6cfd33c9ae7faa3d78ff1178ab848497dd21206f0aa6616317c10b79c9cb76b7bf97e6958be4fa5b57993f9bbb5b965d2623ef39463648bf0
7
+ data.tar.gz: b834fc75da1bb618cdde7255a371679c9fa005fca3630b353210eb747a75c63bed44392e613887f60c1123797d954f723e693c4fc9e891240dad61ff4879ca17
data/README.md CHANGED
@@ -24,8 +24,10 @@ $ git start --include-icebox
24
24
 
25
25
  $ git finish
26
26
  # pushes branch, finishes task on pt, and opens new pull request
27
- # reviewer comments :+1: to approve on github
28
- # committer presses merge button on github which delivers task on pivotal tracker
27
+ # pressing merge button on github delivers task on pivotal tracker
28
+
29
+ $ git finish --wip
30
+ # pushes branch and submits [WIP] pull request
29
31
 
30
32
  $ git cleanup
31
33
  # cleans up local/remote story branches already merged with current release branch
@@ -36,11 +36,13 @@ module PT::Flow
36
36
 
37
37
  def finish
38
38
  run "git push origin #{branch} -u"
39
- finish_task current_task
40
39
  if @params.include?('--deliver')
41
40
  deliver!
41
+ elsif @params.include?('--wip')
42
+ open_url pull_request_url('[WIP]')
42
43
  else
43
- open_url draft_pr_url
44
+ finish_task current_task
45
+ open_url pull_request_url
44
46
  end
45
47
  end
46
48
 
@@ -92,8 +94,9 @@ module PT::Flow
92
94
  task_title
93
95
  end
94
96
 
95
- def draft_pr_url
96
- repo.url + "/compare/#{branch.target}...#{branch}?expand=1&title=#{URI.escape(task_title)}"
97
+ def pull_request_url(prefix = nil)
98
+ title = URI.escape "#{prefix} #{task_title}".strip
99
+ repo.url + "/compare/#{branch.target}...#{branch}?expand=1&title=#{title}"
97
100
  end
98
101
 
99
102
  def deliver!
@@ -1,5 +1,5 @@
1
1
  module PT
2
2
  module Flow
3
- VERSION = '2.4.0'
3
+ VERSION = '2.5.0'
4
4
  end
5
5
  end
@@ -88,6 +88,7 @@ module PT::Flow
88
88
  describe '#finish' do
89
89
  context 'ssh repo' do
90
90
  before do
91
+ ENV['BROWSER'] = ''
91
92
  system('git checkout -B new_feature')
92
93
  system('git remote rm origin')
93
94
  system('git remote add origin git@github.com:cookpad/pt-flow.git')
@@ -98,7 +99,6 @@ module PT::Flow
98
99
 
99
100
  context 'no options' do
100
101
  it "pushes the current branch to origin, flags the story as finished, and opens github pull request URL" do
101
- ENV['BROWSER'] = ''
102
102
  UI.any_instance.should_receive(:run).with('git push origin new_feature.this-is-for-comments.4460038 -u')
103
103
  UI.any_instance.should_receive(:run).with("open \"https://github.com/cookpad/pt-flow/compare/new_feature...new_feature.this-is-for-comments.4460038?expand=1&title=This%20is%20for%20comments%20[Delivers%20%234460038]\"")
104
104
  UI.new('finish')
@@ -107,6 +107,14 @@ module PT::Flow
107
107
  end
108
108
  end
109
109
 
110
+ context 'give option --wip' do
111
+ it "pushes the current branch to origin, and opens github [WIP] pull request URL" do
112
+ UI.any_instance.should_receive(:run).with('git push origin new_feature.this-is-for-comments.4460038 -u')
113
+ UI.any_instance.should_receive(:run).with("open \"https://github.com/cookpad/pt-flow/compare/new_feature...new_feature.this-is-for-comments.4460038?expand=1&title=[WIP]%20This%20is%20for%20comments%20[Delivers%20%234460038]\"")
114
+ UI.new('finish', ['--wip'])
115
+ end
116
+ end
117
+
110
118
  context 'given option --deliver' do
111
119
  it "pushes the current branch to origin, flags the story as finished, opens github pull request, merges it in and returns to master and pulls" do
112
120
  UI.any_instance.should_receive(:run).with('git push origin new_feature.this-is-for-comments.4460038 -u')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pt-flow
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Balvig
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-21 00:00:00.000000000 Z
11
+ date: 2015-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pt