pt-flow 2.6.1 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/pt-flow/branch.rb +4 -0
- data/lib/pt-flow/ui.rb +9 -4
- data/lib/pt-flow/version.rb +1 -1
- data/spec/lib/pt-flow/ui_spec.rb +6 -6
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9687945c5478e9af32ba27d0916f53833bf029e8
|
4
|
+
data.tar.gz: f9de9d266b17218d6f926d38904a37127cf61df3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 827c3e5305abea2084205d64252f86d54e4e49068d4cecfc88ca8df2e644b47874e7b18ca5a5b0a319461f6201b1f05ed890e4856b86ad54441ade4b448a226a
|
7
|
+
data.tar.gz: 8d74ed807e9a7265f015d93e7cc95ce015d6e18cb88ebf04e16c88d664e6d167a98bee28408e0b4e182d44f64286f0ead4e17e313dc90324cf2a6b9833b3c5d2
|
data/lib/pt-flow/branch.rb
CHANGED
data/lib/pt-flow/ui.rb
CHANGED
@@ -46,10 +46,8 @@ module PT::Flow
|
|
46
46
|
run "git push origin #{branch} -u"
|
47
47
|
if @options[:deliver]
|
48
48
|
deliver!
|
49
|
-
elsif @options[:wip]
|
50
|
-
open_url pull_request_url('[WIP]')
|
51
49
|
else
|
52
|
-
finish_task
|
50
|
+
finish_task(current_task) unless @options[:wip]
|
53
51
|
open_url pull_request_url
|
54
52
|
end
|
55
53
|
end
|
@@ -102,11 +100,18 @@ module PT::Flow
|
|
102
100
|
task_title
|
103
101
|
end
|
104
102
|
|
105
|
-
def pull_request_url
|
103
|
+
def pull_request_url
|
106
104
|
title = URI.escape "#{prefix} #{task_title}".strip
|
107
105
|
repo.url + "/compare/#{branch.target}...#{branch}?expand=1&title=#{title}"
|
108
106
|
end
|
109
107
|
|
108
|
+
def prefix
|
109
|
+
prefixes = []
|
110
|
+
prefixes << "[WIP]" if @options[:wip]
|
111
|
+
prefixes << "[#{branch.target.titleize}]" if branch.release_branch?
|
112
|
+
prefixes.join(" ")
|
113
|
+
end
|
114
|
+
|
110
115
|
def deliver!
|
111
116
|
run "hub pull-request -b #{branch.target} -h #{repo.user}:#{branch} -m \"#{task_title}\""
|
112
117
|
finished_branch = branch
|
data/lib/pt-flow/version.rb
CHANGED
data/spec/lib/pt-flow/ui_spec.rb
CHANGED
@@ -106,17 +106,17 @@ module PT::Flow
|
|
106
106
|
context 'no options' do
|
107
107
|
it "pushes the current branch to origin, flags the story as finished, and opens github pull request URL" do
|
108
108
|
UI.any_instance.should_receive(:run).with('git push origin new_feature.this-is-for-comments.4460038 -u')
|
109
|
-
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=
|
109
|
+
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=[New%20Feature]%20This%20is%20for%20comments%20[Delivers%20%234460038]\"")
|
110
110
|
UI.new('finish')
|
111
111
|
current_branch.should == 'new_feature.this-is-for-comments.4460038'
|
112
112
|
WebMock.should have_requested(:put, "#{endpoint}/projects/102622/stories/4460038").with(body: /<current_state>finished<\/current_state>/)
|
113
113
|
end
|
114
114
|
end
|
115
115
|
|
116
|
-
context '
|
116
|
+
context 'given option --wip' do
|
117
117
|
it "pushes the current branch to origin, and opens github [WIP] pull request URL" do
|
118
118
|
UI.any_instance.should_receive(:run).with('git push origin new_feature.this-is-for-comments.4460038 -u')
|
119
|
-
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]\"")
|
119
|
+
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]%20[New%20Feature]%20This%20is%20for%20comments%20[Delivers%20%234460038]\"")
|
120
120
|
UI.new('finish', ['--wip'])
|
121
121
|
end
|
122
122
|
end
|
@@ -137,7 +137,7 @@ module PT::Flow
|
|
137
137
|
|
138
138
|
context 'https repo' do
|
139
139
|
before do
|
140
|
-
system('git checkout -B
|
140
|
+
system('git checkout -B master')
|
141
141
|
system('git remote rm origin')
|
142
142
|
system('git remote add origin https://github.com/balvig/pt-flow.git')
|
143
143
|
|
@@ -146,8 +146,8 @@ module PT::Flow
|
|
146
146
|
end
|
147
147
|
|
148
148
|
it "pushes the current branch to origin, flags the story as finished, and opens a github pull request" do
|
149
|
-
UI.any_instance.should_receive(:run).with('git push origin
|
150
|
-
UI.any_instance.should_receive(:run).with("open \"https://github.com/balvig/pt-flow/compare/
|
149
|
+
UI.any_instance.should_receive(:run).with('git push origin master.this-is-for-comments.4460038 -u')
|
150
|
+
UI.any_instance.should_receive(:run).with("open \"https://github.com/balvig/pt-flow/compare/master...master.this-is-for-comments.4460038?expand=1&title=This%20is%20for%20comments%20[Delivers%20%234460038]\"")
|
151
151
|
UI.new('finish')
|
152
152
|
end
|
153
153
|
end
|
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
|
+
version: 2.7.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-
|
11
|
+
date: 2015-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pt
|
@@ -217,3 +217,4 @@ test_files:
|
|
217
217
|
- spec/support/fixture_macros.rb
|
218
218
|
- spec/support/git_macros.rb
|
219
219
|
- spec/support/webmock.rb
|
220
|
+
has_rdoc:
|