pt-flow 2.1.0 → 2.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 89d06e1a1769aa52604bf5827858ee31b671fd69
4
- data.tar.gz: a472ec4bab325646365a658270d31082376934e2
3
+ metadata.gz: a667cbbf9dbf5c7d6d2e79b14ad4460e4f35d3f6
4
+ data.tar.gz: 052f3c3ce6cf5bc4e2251ca9a7a0132b3e7be013
5
5
  SHA512:
6
- metadata.gz: b0fc0c510f4a8a096e93d275694abe07bc3b68a1e6aad01b6354fab4562f6b6c8df43dd6780765cd22eee6730bd42cdfc3cbdfaa58e291395e6fdf3c4b4a3239
7
- data.tar.gz: a06bd642578bb1e5d9444c167ce8fd543914b1e5606735bb8f200e1ba8686190abd272562efa080d6a395a5283592e2a65ddc844deb6f8a325c972b58be12e6a
6
+ metadata.gz: 080d734b5fbe6562fc8310723d62e11694958a4b75b0d617753e1247f20f65a7ff5ba6c3e0e6bcd61cbfbd2c42e70e2753057e8f0f41123c7ef6733d39aa41f9
7
+ data.tar.gz: a62d96e5a1d068c3c176e276d00a37e6cea90931998a7a316a15288c0a75f2368ba0ee68e0ccd223df51821bf85bfa965820f72ea19b7480522b7328a8b00ec1
data/.travis.yml CHANGED
@@ -3,3 +3,6 @@ script: 'git config --global user.name "Your Name" && git config --global user.e
3
3
  rvm:
4
4
  - 1.9.3
5
5
  - 2.0.0
6
+ - 2.1.1
7
+ notifications:
8
+ email: false
data/README.md CHANGED
@@ -27,6 +27,9 @@ $ git finish
27
27
  # reviewer comments :+1: to approve on github
28
28
  # committer presses merge button on github which delivers task on pivotal tracker
29
29
 
30
+ $ git finish --draft
31
+ # Opens github pull request screen rather than auto-submitting
32
+
30
33
  $ git cleanup
31
34
  # cleans up local/remote story branches already merged with current release branch
32
35
  ```
@@ -1,7 +1,8 @@
1
+ require 'i18n'
2
+ require 'active_support/core_ext/string/inflections'
3
+
1
4
  module PT::Flow
2
5
  class Branch
3
- require 'i18n'
4
- require 'active_support/core_ext/string/inflections'
5
6
 
6
7
  attr_accessor :name
7
8
 
data/lib/pt-flow/ui.rb CHANGED
@@ -36,7 +36,7 @@ module PT::Flow
36
36
 
37
37
  def finish
38
38
  run("git push origin #{branch} -u")
39
- run("hub pull-request -b #{branch.target} -h #{repo.user}:#{branch} -m \"#{task_title}\"")
39
+ pull_request
40
40
  finish_task(current_task)
41
41
  deliver! if @params.include?('--deliver')
42
42
  end
@@ -89,6 +89,15 @@ module PT::Flow
89
89
  task_title
90
90
  end
91
91
 
92
+ def pull_request
93
+ if @params.include?('--draft')
94
+ pr_url = `hub compare -u #{branch.target}...#{branch}`.chomp + "?expand=1&title=#{URI.escape(task_title)}"
95
+ run "open #{pr_url}"
96
+ else
97
+ run("hub pull-request -b #{branch.target} -h #{repo.user}:#{branch} -m \"#{task_title}\"")
98
+ end
99
+ end
100
+
92
101
  def deliver!
93
102
  finished_branch = branch
94
103
  title = task_title
@@ -1,5 +1,5 @@
1
1
  module PT
2
2
  module Flow
3
- VERSION = '2.1.0'
3
+ VERSION = '2.2.0'
4
4
  end
5
5
  end
@@ -117,6 +117,14 @@ module PT::Flow
117
117
  UI.new('finish', ['--deliver'])
118
118
  end
119
119
  end
120
+
121
+ context 'given option --draft' do
122
+ it "pushes the current branch to origin, flags the story as finished, and opens github pull request URL" do
123
+ UI.any_instance.should_receive(:run).with('git push origin new_feature.this-is-for-comments.4460038 -u')
124
+ 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]')
125
+ UI.new('finish', ['--draft'])
126
+ end
127
+ end
120
128
  end
121
129
  end
122
130
 
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.1.0
4
+ version: 2.2.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: 2014-12-04 00:00:00.000000000 Z
11
+ date: 2015-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pt