git_reflow 0.7.1 → 0.7.2

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: d71fb145146965402e35a8781270d335c6b48992
4
- data.tar.gz: 021a46ce6f44072e351fc58dc926a6f86d6bb8e9
3
+ metadata.gz: 96e1b777d8f08abf43c5dfb292beaf97d4c6e607
4
+ data.tar.gz: d1675e623c154925a047bbfeb2f7934a485307dc
5
5
  SHA512:
6
- metadata.gz: 00e25a1a163fbe53bf386608f825d5c4e598ab38769ef2d38776326a6b6abd3a506c5db72d09d5524fd5d01cae7235554353d5b85824bba188217cb2933f37c5
7
- data.tar.gz: 8657729034fa0cbdbc6f573b7571f002b9740ac9d3a322bff3fa0863eab55b0f1e57e56d842d1ae2641a21409408817e2360f4caa018620837d00d0fbf2b50e7
6
+ metadata.gz: b139ee997dc07485c92fdda0846db9399158ca9cb0025e4fb6c528a9e1af7e6c1ca27b521d245cb0ac0e990ccc9d50fd48e10bfb031913124ba44397641b87ba
7
+ data.tar.gz: a1baf7332b3c3bf4de2311f435913de66a4b04b9fdedebdb24c9da67e30696b1d667f901ab67f9375f1d63ec4373161c32c07a35ed3a62604e9dfcbcae6300b3
data/Appraisals CHANGED
@@ -7,6 +7,6 @@ appraise "latest-github-api-release" do
7
7
  end
8
8
 
9
9
  appraise "current-reflow-locked-versions" do
10
- gem "gli", "2.12.2"
11
- gem "github_api", "0.12.3"
10
+ gem "gli", "2.13.2"
11
+ gem "github_api", "0.12.4"
12
12
  end
data/CHANGELOG.md ADDED
@@ -0,0 +1,222 @@
1
+ # Change Log
2
+
3
+ ## [v0.7.1](https://github.com/reenhanced/gitreflow/tree/v0.7.1) (2015-10-27)
4
+ [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.7.0...v0.7.1)
5
+
6
+ **Merged pull requests:**
7
+
8
+ - Fix the ask to open in browser dialog on Mac. [\#143](https://github.com/reenhanced/gitreflow/pull/143) ([squaresurf](https://github.com/squaresurf))
9
+
10
+ ## [v0.7.0](https://github.com/reenhanced/gitreflow/tree/v0.7.0) (2015-10-14)
11
+ [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.6.7...v0.7.0)
12
+
13
+ **Fixed bugs:**
14
+
15
+ - Hide author's name from list of LGTMs we need to get [\#126](https://github.com/reenhanced/gitreflow/issues/126)
16
+
17
+ **Closed issues:**
18
+
19
+ - Command Injection in append\_to\_squashed\_commit\_message. [\#134](https://github.com/reenhanced/gitreflow/issues/134)
20
+
21
+ ## [v0.6.7](https://github.com/reenhanced/gitreflow/tree/v0.6.7) (2015-09-29)
22
+ [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.6.6...v0.6.7)
23
+
24
+ ## [v0.6.6](https://github.com/reenhanced/gitreflow/tree/v0.6.6) (2015-09-28)
25
+ [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.6.5...v0.6.6)
26
+
27
+ **Merged pull requests:**
28
+
29
+ - Fix review message parsing from editor failed [\#133](https://github.com/reenhanced/gitreflow/pull/133) ([francois](https://github.com/francois))
30
+
31
+ ## [v0.6.5](https://github.com/reenhanced/gitreflow/tree/v0.6.5) (2015-08-31)
32
+ [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.6.4...v0.6.5)
33
+
34
+ **Closed issues:**
35
+
36
+ - Request: git reflow review --quick or --update [\#129](https://github.com/reenhanced/gitreflow/issues/129)
37
+ - Feature Request: command to cleanly land a contributor's PR [\#128](https://github.com/reenhanced/gitreflow/issues/128)
38
+
39
+ ## [v0.6.4](https://github.com/reenhanced/gitreflow/tree/v0.6.4) (2015-08-04)
40
+ [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.6.3...v0.6.4)
41
+
42
+ **Fixed bugs:**
43
+
44
+ - reflow needs an lgtm from myself [\#116](https://github.com/reenhanced/gitreflow/issues/116)
45
+
46
+ ## [v0.6.3](https://github.com/reenhanced/gitreflow/tree/v0.6.3) (2015-08-03)
47
+ [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.6.2...v0.6.3)
48
+
49
+ **Closed issues:**
50
+
51
+ - Github pre-receive hook to ensure review is not skipped [\#121](https://github.com/reenhanced/gitreflow/issues/121)
52
+ - Error: \#\<NameError: wrong constant name \> [\#120](https://github.com/reenhanced/gitreflow/issues/120)
53
+
54
+ ## [v0.6.2](https://github.com/reenhanced/gitreflow/tree/v0.6.2) (2015-08-03)
55
+ [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.6.1...v0.6.2)
56
+
57
+ **Fixed bugs:**
58
+
59
+ - GIT\_REFLOW\_PR\_MSG: Permission denied [\#115](https://github.com/reenhanced/gitreflow/issues/115)
60
+ - Git reflow setup undefined method `body` [\#96](https://github.com/reenhanced/gitreflow/issues/96)
61
+
62
+ **Closed issues:**
63
+
64
+ - deliver halted because lgtm not detected, but lgtm exists [\#119](https://github.com/reenhanced/gitreflow/issues/119)
65
+ - Clarify when I would want to install reflow or git\_reflow [\#113](https://github.com/reenhanced/gitreflow/issues/113)
66
+ - Clarify when I would want to install reflow or git\_reflow [\#112](https://github.com/reenhanced/gitreflow/issues/112)
67
+ - Error when running git reflow review [\#107](https://github.com/reenhanced/gitreflow/issues/107)
68
+ - Default PR title from branch name rather than last commit [\#89](https://github.com/reenhanced/gitreflow/issues/89)
69
+
70
+ **Merged pull requests:**
71
+
72
+ - Clarify how to pick which gem [\#114](https://github.com/reenhanced/gitreflow/pull/114) ([sethladd](https://github.com/sethladd))
73
+ - Add number attribute to Base:PullRequest [\#110](https://github.com/reenhanced/gitreflow/pull/110) ([tanin47](https://github.com/tanin47))
74
+
75
+ ## [v0.6.1](https://github.com/reenhanced/gitreflow/tree/v0.6.1) (2015-06-02)
76
+ [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.6.0...v0.6.1)
77
+
78
+ **Closed issues:**
79
+
80
+ - git reflow setup not working [\#106](https://github.com/reenhanced/gitreflow/issues/106)
81
+
82
+ ## [v0.6.0](https://github.com/reenhanced/gitreflow/tree/v0.6.0) (2015-05-15)
83
+ [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.5.3...v0.6.0)
84
+
85
+ **Merged pull requests:**
86
+
87
+ - new functionality for review [\#99](https://github.com/reenhanced/gitreflow/pull/99) ([meesterdude](https://github.com/meesterdude))
88
+
89
+ ## [v0.5.3](https://github.com/reenhanced/gitreflow/tree/v0.5.3) (2015-05-15)
90
+ [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.5.2...v0.5.3)
91
+
92
+ **Closed issues:**
93
+
94
+ - rescue/allow retry on review submit [\#102](https://github.com/reenhanced/gitreflow/issues/102)
95
+ - tmp\_squash\_msg can be improved [\#97](https://github.com/reenhanced/gitreflow/issues/97)
96
+ - Getting following error while setting up GitHub with reflow [\#94](https://github.com/reenhanced/gitreflow/issues/94)
97
+
98
+ **Merged pull requests:**
99
+
100
+ - tmp\_squash\_msh is not removed if we use git reflow in other directories than root. [\#98](https://github.com/reenhanced/gitreflow/pull/98) ([tanin47](https://github.com/tanin47))
101
+
102
+ ## [v0.5.2](https://github.com/reenhanced/gitreflow/tree/v0.5.2) (2015-04-03)
103
+ [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.5.1...v0.5.2)
104
+
105
+ ## [v0.5.1](https://github.com/reenhanced/gitreflow/tree/v0.5.1) (2015-03-26)
106
+ [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.5.0...v0.5.1)
107
+
108
+ ## [v0.5.0](https://github.com/reenhanced/gitreflow/tree/v0.5.0) (2015-03-26)
109
+ [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.4.2...v0.5.0)
110
+
111
+ **Fixed bugs:**
112
+
113
+ - bad URI on git reflow status [\#88](https://github.com/reenhanced/gitreflow/issues/88)
114
+
115
+ **Closed issues:**
116
+
117
+ - Changing remote url in \reponame\.git\config to make reflow deliver work [\#75](https://github.com/reenhanced/gitreflow/issues/75)
118
+
119
+ ## [v0.4.2](https://github.com/reenhanced/gitreflow/tree/v0.4.2) (2015-02-10)
120
+ [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.4.1...v0.4.2)
121
+
122
+ **Fixed bugs:**
123
+
124
+ - Allow for non-ssh origin urls [\#71](https://github.com/reenhanced/gitreflow/issues/71)
125
+
126
+ **Closed issues:**
127
+
128
+ - 404 error on all PR functions [\#77](https://github.com/reenhanced/gitreflow/issues/77)
129
+ - Show an error message when trying to use the `http` url [\#72](https://github.com/reenhanced/gitreflow/issues/72)
130
+ - Setup does not work when 2-factor authentication is enabled [\#57](https://github.com/reenhanced/gitreflow/issues/57)
131
+ - Github Enterprise Compatibility [\#42](https://github.com/reenhanced/gitreflow/issues/42)
132
+
133
+ ## [v0.4.1](https://github.com/reenhanced/gitreflow/tree/v0.4.1) (2014-10-28)
134
+ [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.4.0...v0.4.1)
135
+
136
+ **Closed issues:**
137
+
138
+ - License does not have year and name filled in [\#69](https://github.com/reenhanced/gitreflow/issues/69)
139
+
140
+ ## [v0.4.0](https://github.com/reenhanced/gitreflow/tree/v0.4.0) (2014-10-16)
141
+ [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.3.5...v0.4.0)
142
+
143
+ **Closed issues:**
144
+
145
+ - f has already been specified as a switch in the command deliver \(ArgumentError\) [\#59](https://github.com/reenhanced/gitreflow/issues/59)
146
+
147
+ **Merged pull requests:**
148
+
149
+ - Make sure to create feature branch with current branch as base [\#64](https://github.com/reenhanced/gitreflow/pull/64) ([esposito](https://github.com/esposito))
150
+ - \[fix\] Show delivery halted message properly [\#63](https://github.com/reenhanced/gitreflow/pull/63) ([shirshendu](https://github.com/shirshendu))
151
+
152
+ ## [v0.3.5](https://github.com/reenhanced/gitreflow/tree/v0.3.5) (2014-03-05)
153
+ [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.3.4...v0.3.5)
154
+
155
+ **Closed issues:**
156
+
157
+ - Getting a 'error: POST https://api.github.com/authorizations: 422' when entering correct user/password [\#60](https://github.com/reenhanced/gitreflow/issues/60)
158
+ - Why is squashed merging your preferred workflow? [\#52](https://github.com/reenhanced/gitreflow/issues/52)
159
+ - Commit editor prints last commit line twice on top on deliver [\#49](https://github.com/reenhanced/gitreflow/issues/49)
160
+ - `git reflow status` does not open in browser when answering 'y' [\#48](https://github.com/reenhanced/gitreflow/issues/48)
161
+ - Setup fails [\#47](https://github.com/reenhanced/gitreflow/issues/47)
162
+
163
+ **Merged pull requests:**
164
+
165
+ - Add CI build status integration if present [\#58](https://github.com/reenhanced/gitreflow/pull/58) ([shirshendu](https://github.com/shirshendu))
166
+ - Add note to created oauth token so users can find them on their tokens page [\#55](https://github.com/reenhanced/gitreflow/pull/55) ([marten](https://github.com/marten))
167
+
168
+ ## [v0.3.4](https://github.com/reenhanced/gitreflow/tree/v0.3.4) (2013-11-01)
169
+ [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.3.3...v0.3.4)
170
+
171
+ **Fixed bugs:**
172
+
173
+ - Skip lgtm not functional [\#41](https://github.com/reenhanced/gitreflow/issues/41)
174
+
175
+ **Closed issues:**
176
+
177
+ - Syntax for `review` [\#44](https://github.com/reenhanced/gitreflow/issues/44)
178
+ - Print all git commands [\#43](https://github.com/reenhanced/gitreflow/issues/43)
179
+
180
+ ## [v0.3.3](https://github.com/reenhanced/gitreflow/tree/v0.3.3) (2013-10-16)
181
+ [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.3.2...v0.3.3)
182
+
183
+ **Closed issues:**
184
+
185
+ - License missing from gemspec [\#40](https://github.com/reenhanced/gitreflow/issues/40)
186
+
187
+ **Merged pull requests:**
188
+
189
+ - Fix --skip-lgtm option was never passed to the `\#deliver` method [\#45](https://github.com/reenhanced/gitreflow/pull/45) ([francois](https://github.com/francois))
190
+
191
+ ## [v0.3.2](https://github.com/reenhanced/gitreflow/tree/v0.3.2) (2013-07-25)
192
+ [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.3.1...v0.3.2)
193
+
194
+ ## [v0.3.1](https://github.com/reenhanced/gitreflow/tree/v0.3.1) (2013-07-12)
195
+ [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.3...v0.3.1)
196
+
197
+ ## [v0.3](https://github.com/reenhanced/gitreflow/tree/v0.3) (2013-07-12)
198
+ [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.2.5...v0.3)
199
+
200
+ ## [v0.2.5](https://github.com/reenhanced/gitreflow/tree/v0.2.5) (2013-03-04)
201
+ [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.2.5-with-tests...v0.2.5)
202
+
203
+ ## [v0.2.5-with-tests](https://github.com/reenhanced/gitreflow/tree/v0.2.5-with-tests) (2013-03-04)
204
+ [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.2.4...v0.2.5-with-tests)
205
+
206
+ ## [v0.2.4](https://github.com/reenhanced/gitreflow/tree/v0.2.4) (2012-09-21)
207
+ [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.2.2...v0.2.4)
208
+
209
+ ## [v0.2.2](https://github.com/reenhanced/gitreflow/tree/v0.2.2) (2012-09-17)
210
+ [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.2.1...v0.2.2)
211
+
212
+ ## [v0.2.1](https://github.com/reenhanced/gitreflow/tree/v0.2.1) (2012-08-30)
213
+ [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.2...v0.2.1)
214
+
215
+ ## [v0.2](https://github.com/reenhanced/gitreflow/tree/v0.2) (2012-08-28)
216
+ **Merged pull requests:**
217
+
218
+ - Adds documentation to reflow [\#13](https://github.com/reenhanced/gitreflow/pull/13) ([nhance](https://github.com/nhance))
219
+
220
+
221
+
222
+ \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
data/Gemfile.lock CHANGED
@@ -1,31 +1,27 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- git_reflow (0.7.1)
4
+ git_reflow (0.7.2)
5
5
  colorize (>= 0.7.0)
6
6
  github_api (= 0.12.4)
7
7
  gli (= 2.13.2)
8
8
  highline
9
9
  httpclient
10
- json_pure
11
10
  reenhanced_bitbucket_api (= 0.3.2)
12
11
 
13
12
  GEM
14
13
  remote: https://rubygems.org/
15
14
  specs:
16
- addressable (2.3.7)
15
+ addressable (2.4.0)
17
16
  appraisal (1.0.3)
18
17
  bundler
19
18
  rake
20
19
  thor (>= 0.14.0)
21
- byebug (4.0.1)
22
- columnize (= 0.9.0)
23
- rb-readline (= 0.5.2)
20
+ byebug (8.2.2)
24
21
  chronic (0.10.2)
25
- coderay (1.1.0)
22
+ coderay (1.1.1)
26
23
  colorize (0.7.7)
27
- columnize (0.9.0)
28
- crack (0.4.2)
24
+ crack (0.4.3)
29
25
  safe_yaml (~> 1.0.0)
30
26
  descendants_tracker (0.0.4)
31
27
  thread_safe (~> 0.3, >= 0.3.1)
@@ -43,35 +39,36 @@ GEM
43
39
  nokogiri (~> 1.6.6)
44
40
  oauth2
45
41
  gli (2.13.2)
46
- hashie (3.4.2)
47
- highline (1.7.7)
48
- httpclient (2.6.0.1)
49
- json_pure (1.8.2)
42
+ hashdiff (0.3.0)
43
+ hashie (3.4.3)
44
+ highline (1.7.8)
45
+ httpclient (2.7.1)
46
+ json (1.8.3)
50
47
  jwt (1.5.1)
51
48
  method_source (0.8.2)
52
- mini_portile (0.6.2)
49
+ mini_portile2 (2.0.0)
53
50
  multi_json (1.11.2)
54
51
  multi_xml (0.5.5)
55
52
  multipart-post (2.0.0)
56
- nokogiri (1.6.6.2)
57
- mini_portile (~> 0.6.0)
58
- oauth2 (1.0.0)
53
+ nokogiri (1.6.7.2)
54
+ mini_portile2 (~> 2.0.0.rc2)
55
+ oauth2 (1.1.0)
59
56
  faraday (>= 0.8, < 0.10)
60
- jwt (~> 1.0)
57
+ jwt (~> 1.0, < 1.5.2)
61
58
  multi_json (~> 1.3)
62
59
  multi_xml (~> 0.5)
63
- rack (~> 1.2)
64
- pry (0.10.1)
60
+ rack (>= 1.2, < 3)
61
+ pry (0.10.3)
65
62
  coderay (~> 1.1.0)
66
63
  method_source (~> 0.8.1)
67
64
  slop (~> 3.4)
68
- pry-byebug (3.1.0)
69
- byebug (~> 4.0)
65
+ pry-byebug (3.3.0)
66
+ byebug (~> 8.0)
70
67
  pry (~> 0.10)
71
68
  rack (1.6.4)
72
- rake (10.4.2)
73
- rb-readline (0.5.2)
74
- rdoc (4.2.0)
69
+ rake (10.5.0)
70
+ rdoc (4.2.2)
71
+ json (~> 1.4)
75
72
  reenhanced_bitbucket_api (0.3.2)
76
73
  faraday (~> 0.9.0)
77
74
  faraday_middleware (~> 0.9.0)
@@ -96,9 +93,10 @@ GEM
96
93
  slop (3.6.0)
97
94
  thor (0.19.1)
98
95
  thread_safe (0.3.5)
99
- webmock (1.20.4)
96
+ webmock (1.24.0)
100
97
  addressable (>= 2.3.6)
101
98
  crack (>= 0.3.2)
99
+ hashdiff
102
100
  wwtd (0.7.0)
103
101
 
104
102
  PLATFORMS
@@ -117,4 +115,4 @@ DEPENDENCIES
117
115
  wwtd (= 0.7.0)
118
116
 
119
117
  BUNDLED WITH
120
- 1.10.6
118
+ 1.11.2
data/circle.yml CHANGED
@@ -1,16 +1,16 @@
1
1
  dependencies:
2
2
  pre:
3
3
  - rvm install 2.0.0
4
- - rvm install 2.1.7
5
- - rvm install 2.2.3
4
+ - rvm install 2.1.8
5
+ - rvm install 2.2.4
6
6
 
7
7
  override:
8
- - 'rvm-exec 2.0.0-p647 bundle install'
9
- - 'rvm-exec 2.1.7 bundle install'
10
- - 'rvm-exec 2.2.3 bundle install'
8
+ - 'rvm-exec 2.0.0-p648 bundle install'
9
+ - 'rvm-exec 2.1.8 bundle install'
10
+ - 'rvm-exec 2.2.4 bundle install'
11
11
 
12
12
  test:
13
13
  override:
14
- - 'rvm-exec 2.0.0-p647 bundle exec rake'
15
- - 'rvm-exec 2.1.7 bundle exec rake'
16
- - 'rvm-exec 2.2.3 bundle exec rake'
14
+ - 'rvm-exec 2.0.0-p648 bundle exec rake'
15
+ - 'rvm-exec 2.1.8 bundle exec rake'
16
+ - 'rvm-exec 2.2.4 bundle exec rake'
data/git_reflow.gemspec CHANGED
@@ -33,7 +33,6 @@ spec = Gem::Specification.new do |s|
33
33
  s.add_dependency('gli', '2.13.2')
34
34
  s.add_dependency('highline')
35
35
  s.add_dependency('httpclient')
36
- s.add_dependency('json_pure')
37
36
  s.add_dependency('github_api', '0.12.4')
38
37
  s.add_dependency('reenhanced_bitbucket_api', '0.3.2')
39
38
 
data/lib/git_reflow.rb CHANGED
@@ -3,7 +3,7 @@ require 'open-uri'
3
3
  require "highline/import"
4
4
  require 'httpclient'
5
5
  require 'github_api'
6
- require 'json/pure'
6
+ require 'json'
7
7
  require 'colorize'
8
8
 
9
9
  require 'git_reflow/version.rb' unless defined?(GitReflow::VERSION)
@@ -37,7 +37,9 @@ module GitReflow
37
37
  end
38
38
 
39
39
  def review(options = {})
40
- options['base'] ||= 'master'
40
+ options['base'] ||= 'master'
41
+ create_pull_request = true
42
+
41
43
  fetch_destination options['base']
42
44
 
43
45
  begin
@@ -45,17 +47,56 @@ module GitReflow
45
47
 
46
48
  existing_pull_request = git_server.find_open_pull_request( from: current_branch, to: options['base'] )
47
49
  if existing_pull_request
48
- puts "A pull request already exists for these branches:"
50
+ say "A pull request already exists for these branches:", :notice
49
51
  existing_pull_request.display_pull_request_summary
50
52
  ask_to_open_in_browser(existing_pull_request.html_url)
51
53
  else
52
- pull_request = git_server.create_pull_request(title: options['title'],
53
- body: options['body'],
54
- head: "#{remote_user}:#{current_branch}",
55
- base: options['base'])
54
+ unless options['title'] || options['body']
55
+ pull_request_msg_file = "#{GitReflow.git_root_dir}/.git/GIT_REFLOW_PR_MSG"
56
+ default_editor = "#{ENV['EDITOR']}"
57
+
58
+ if default_editor.empty?
59
+ default_editor = 'vi'
60
+ end
61
+
62
+ File.open(pull_request_msg_file, 'w') do |file|
63
+ file.write(options['title'] || GitReflow.current_branch)
64
+ end
56
65
 
57
- puts "Successfully created pull request ##{pull_request.number}: #{pull_request.title}\nPull Request URL: #{pull_request.html_url}\n"
58
- ask_to_open_in_browser(pull_request.html_url)
66
+ GitReflow.run("#{default_editor} #{pull_request_msg_file}", with_system: true)
67
+
68
+ pr_msg = File.read(pull_request_msg_file).split(/[\r\n]|\r\n/).map(&:strip)
69
+ title = pr_msg.shift
70
+
71
+ File.delete(pull_request_msg_file)
72
+
73
+ unless pr_msg.empty?
74
+ pr_msg.shift if pr_msg.first.empty?
75
+ end
76
+
77
+ options['title'] = title
78
+ options['body'] = "#{pr_msg.join("\n")}\n"
79
+
80
+ puts "\nReview your PR:\n"
81
+ puts "--------\n"
82
+ puts "Title:\n#{options['title']}\n\n"
83
+ puts "Body:\n#{options['body']}\n"
84
+ puts "--------\n"
85
+
86
+ create_pull_request = ask("Submit pull request? (Y)") =~ /y/i
87
+ end
88
+
89
+ if create_pull_request
90
+ pull_request = git_server.create_pull_request(title: options['title'] || options['body'],
91
+ body: options['body'],
92
+ head: "#{remote_user}:#{current_branch}",
93
+ base: options['base'])
94
+
95
+ puts "Successfully created pull request ##{pull_request.number}: #{pull_request.title}\nPull Request URL: #{pull_request.html_url}\n"
96
+ ask_to_open_in_browser(pull_request.html_url)
97
+ else
98
+ say "Review aborted. No pull request has been created.", :review_halted
99
+ end
59
100
  end
60
101
  rescue Github::Error::UnprocessableEntity => e
61
102
  puts "Github Error: #{e.to_s}"
@@ -6,43 +6,16 @@ command :review do |c|
6
6
  c.flag [:t, :title], default_value: 'last commit message'
7
7
  c.flag [:m, :message], default_value: 'title'
8
8
  c.action do |global_options,options,args|
9
- pull_request_msg_file = "#{GitReflow.git_root_dir}/.git/GIT_REFLOW_PR_MSG"
10
-
11
9
  if global_options[:title] || global_options[:message]
12
10
  review_options = {
13
11
  'base' => args[0],
14
- 'title' => (global_options[:title] || GitReflow.current_branch),
12
+ 'title' => global_options[:title],
15
13
  'body' => global_options[:message]
16
14
  }
17
15
  else
18
- default_editor = "#{ENV['EDITOR']}"
19
- if default_editor.empty?
20
- default_editor = 'vi'
21
- end
22
-
23
- File.open(pull_request_msg_file, 'w') do |file|
24
- file.write(GitReflow.current_branch)
25
- end
26
-
27
- GitReflow.run("#{default_editor} #{pull_request_msg_file}", with_system: true)
28
-
29
- pr_msg = File.read(pull_request_msg_file).split(/[\r\n]|\r\n/).map(&:strip)
30
- title = pr_msg.shift
31
-
32
- File.delete(pull_request_msg_file)
33
-
34
- unless pr_msg.empty?
35
- pr_msg.shift if pr_msg.first.empty?
36
- end
37
-
38
- review_options = {'base' => args[0],'title' => title,'body' => pr_msg.join("\n")}
16
+ review_options = { 'base' => args[0] }
39
17
  end
40
18
 
41
- puts "\nReview your PR:\n"
42
- puts "--------\n"
43
- puts "Title:\n#{review_options['title']}\n\n"
44
- puts "Body:\n#{review_options['body']}\n"
45
- puts "--------\n"
46
- GitReflow.review(review_options) unless ask("Submit pull request? (Y)") =~ /n/i
19
+ GitReflow.review(review_options)
47
20
  end
48
21
  end
@@ -27,7 +27,8 @@ module GitReflow
27
27
  end
28
28
 
29
29
  def current_provider
30
- if (provider = GitReflow::Config.get('reflow.git-server')) and provider.length > 0
30
+ provider = "#{GitReflow::Config.get('reflow.git-server', local: true) || GitReflow::Config.get('reflow.git-server')}"
31
+ if provider.length > 0
31
32
  begin
32
33
  provider_class_for(provider)
33
34
  rescue ConnectionError => e
@@ -6,6 +6,7 @@ module GitReflow
6
6
  notice: :yellow,
7
7
  error: :red,
8
8
  deliver_halted: :red,
9
+ review_halted: :red,
9
10
  success: :green
10
11
  }
11
12
 
@@ -1,3 +1,3 @@
1
1
  module GitReflow
2
- VERSION = "0.7.1"
2
+ VERSION = "0.7.2"
3
3
  end
@@ -108,13 +108,41 @@ describe GitReflow do
108
108
  end
109
109
 
110
110
  context "pull request doesn't exist" do
111
- before { github.stub(:find_open_pull_request).and_return(nil) }
111
+ before do
112
+ github.stub(:find_open_pull_request).and_return(nil)
113
+ end
112
114
 
113
115
  it "successfully creates a pull request if I do not provide one" do
114
- existing_pull_request.stub(:title).and_return(inputs['title'])
116
+ allow(existing_pull_request).to receive(:title).and_return(inputs['title'])
115
117
  github.should_receive(:create_pull_request).with(inputs.except('state').symbolize_keys).and_return(existing_pull_request)
116
118
  expect { subject }.to have_output "Successfully created pull request #1: #{inputs['title']}\nPull Request URL: https://github.com/#{user}/#{repo}/pulls/1\n"
117
119
  end
120
+
121
+ context "when providing only a title" do
122
+ before do
123
+ inputs['body'] = nil
124
+ allow(existing_pull_request).to receive(:title).and_return(inputs['title'])
125
+ end
126
+
127
+ it "successfully creates a pull request with only the provided title" do
128
+ github.should_receive(:create_pull_request).with(inputs.except('state').symbolize_keys).and_return(existing_pull_request)
129
+ expect { subject }.to have_output "Successfully created pull request #1: #{inputs['title']}\nPull Request URL: https://github.com/#{user}/#{repo}/pulls/1\n"
130
+ end
131
+ end
132
+
133
+ context "when providing only a message" do
134
+ before do
135
+ inputs['title'] = nil
136
+ allow(existing_pull_request).to receive(:title).and_return(inputs['body'])
137
+ end
138
+
139
+ it "successfully creates a pull request with only the provided title" do
140
+ expected_options = inputs.except('state')
141
+ expected_options['title'] = inputs['body']
142
+ github.should_receive(:create_pull_request).with(expected_options.symbolize_keys).and_return(existing_pull_request)
143
+ expect { subject }.to have_output "Successfully created pull request #1: #{expected_options['title']}\nPull Request URL: https://github.com/#{user}/#{repo}/pulls/1\n"
144
+ end
145
+ end
118
146
  end
119
147
 
120
148
  context "pull request exists" do
@@ -53,6 +53,8 @@ describe GitReflow::GitServer do
53
53
  describe '.current_provider' do
54
54
  subject { GitReflow::GitServer.current_provider }
55
55
 
56
+ before { GitReflow::Config.stub(:get).with('reflow.git-server', local: true).and_return(nil) }
57
+
56
58
  context 'Reflow setup to use GitHub' do
57
59
  before { GitReflow::Config.stub(:get).with('reflow.git-server').and_return('GitHub') }
58
60
  it { should == GitReflow::GitServer::GitHub }
@@ -75,6 +77,11 @@ describe GitReflow::GitServer do
75
77
  describe '.connection' do
76
78
  subject { GitReflow::GitServer.connection }
77
79
 
80
+ before do
81
+ GitReflow::Config.stub(:get).with('reflow.git-server', local: true).and_return(nil)
82
+ GitReflow::Config.stub(:get).with('reflow.git-server').and_return(nil)
83
+ end
84
+
78
85
  it { should be_nil }
79
86
 
80
87
  context "with a valid provider" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_reflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Valentino Stoll
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-10-27 00:00:00.000000000 Z
13
+ date: 2016-02-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: appraisal
@@ -194,20 +194,6 @@ dependencies:
194
194
  - - ">="
195
195
  - !ruby/object:Gem::Version
196
196
  version: '0'
197
- - !ruby/object:Gem::Dependency
198
- name: json_pure
199
- requirement: !ruby/object:Gem::Requirement
200
- requirements:
201
- - - ">="
202
- - !ruby/object:Gem::Version
203
- version: '0'
204
- type: :runtime
205
- prerelease: false
206
- version_requirements: !ruby/object:Gem::Requirement
207
- requirements:
208
- - - ">="
209
- - !ruby/object:Gem::Version
210
- version: '0'
211
197
  - !ruby/object:Gem::Dependency
212
198
  name: github_api
213
199
  requirement: !ruby/object:Gem::Requirement
@@ -248,6 +234,7 @@ extra_rdoc_files:
248
234
  files:
249
235
  - ".gitignore"
250
236
  - Appraisals
237
+ - CHANGELOG.md
251
238
  - Gemfile
252
239
  - Gemfile.lock
253
240
  - LICENSE
@@ -337,7 +324,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
337
324
  version: '0'
338
325
  requirements: []
339
326
  rubyforge_project:
340
- rubygems_version: 2.4.5.1
327
+ rubygems_version: 2.5.1
341
328
  signing_key:
342
329
  specification_version: 4
343
330
  summary: A better git process