thegarage-gitx 2.2.3.pre1 → 2.2.3.pre2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/thegarage/gitx/cli/review_command.rb +1 -22
- data/lib/thegarage/gitx/string_extensions.rb +0 -4
- data/lib/thegarage/gitx/thor_extensions.rb +27 -0
- data/lib/thegarage/gitx/version.rb +1 -1
- data/lib/thegarage/gitx.rb +1 -0
- data/spec/thegarage/gitx/cli/review_command_spec.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 828adabb95945ff82ba93923950a6af74dcff5e4
|
4
|
+
data.tar.gz: a153b52c49a3dea67cff353aaf43f63ac50e7a87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a543bcecabda7e3945377d1fbda43b7d4b1d2222c44d09cfcb13f1e26a9f2f3adb2ce827183dbc980f6720440f73e86210dda80a851717dc81554c4a9e403877
|
7
|
+
data.tar.gz: 1e56171b3055a4c14620277d7d77c77ad2170ea7d1c626d7256a5a3bf4b270071b3f0d19339f3ff85b82bab1705122c5a97b0465be3de470e739a33c7612ad9a
|
@@ -153,30 +153,9 @@ module Thegarage
|
|
153
153
|
description_template << changelog
|
154
154
|
description_template << PULL_REQUEST_FOOTER
|
155
155
|
|
156
|
-
body =
|
156
|
+
body = ask_editor(description_template.join("\n"))
|
157
157
|
body.gsub(PULL_REQUEST_FOOTER, '').chomp.strip
|
158
158
|
end
|
159
|
-
|
160
|
-
# launch configured editor to retreive message/string
|
161
|
-
def input_from_editor(initial_text = '')
|
162
|
-
Tempfile.open('reviewrequest.md') do |f|
|
163
|
-
f << initial_text
|
164
|
-
f.flush
|
165
|
-
|
166
|
-
editor = repo.config['core.editor'] || ENV['EDITOR'] || 'vi'
|
167
|
-
flags = case editor
|
168
|
-
when 'mate', 'emacs', 'subl'
|
169
|
-
'-w'
|
170
|
-
when 'mvim'
|
171
|
-
'-f'
|
172
|
-
else
|
173
|
-
''
|
174
|
-
end
|
175
|
-
pid = fork { exec([editor, flags, f.path].join(' ')) }
|
176
|
-
Process.waitpid(pid)
|
177
|
-
File.read(f.path)
|
178
|
-
end
|
179
|
-
end
|
180
159
|
end
|
181
160
|
end
|
182
161
|
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
class Thor
|
2
|
+
module Actions
|
3
|
+
# launch configured editor to retreive message/string
|
4
|
+
# see http://osdir.com/ml/ruby-talk/2010-06/msg01424.html
|
5
|
+
# see https://gist.github.com/rkumar/456809
|
6
|
+
# see http://rdoc.info/github/visionmedia/commander/master/Commander/UI.ask_editor
|
7
|
+
def ask_editor(initial_text = '')
|
8
|
+
Tempfile.open('reviewrequest.md') do |f|
|
9
|
+
f << initial_text
|
10
|
+
f.flush
|
11
|
+
|
12
|
+
editor = repo.config['core.editor'] || ENV['EDITOR'] || 'vi'
|
13
|
+
flags = case editor
|
14
|
+
when 'mate', 'emacs', 'subl'
|
15
|
+
'-w'
|
16
|
+
when 'mvim'
|
17
|
+
'-f'
|
18
|
+
else
|
19
|
+
''
|
20
|
+
end
|
21
|
+
pid = fork { exec([editor, flags, f.path].join(' ')) }
|
22
|
+
Process.waitpid(pid)
|
23
|
+
File.read(f.path)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/thegarage/gitx.rb
CHANGED
@@ -21,7 +21,7 @@ describe Thegarage::Gitx::Cli::ReviewCommand do
|
|
21
21
|
before do
|
22
22
|
allow(cli).to receive(:repo).and_return(repo)
|
23
23
|
allow(cli).to receive(:current_branch).and_return(branch)
|
24
|
-
allow(cli).to receive(:
|
24
|
+
allow(cli).to receive(:ask_editor).and_return('description')
|
25
25
|
end
|
26
26
|
|
27
27
|
describe '#review' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thegarage-gitx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.3.
|
4
|
+
version: 2.2.3.pre2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Sonnek
|
@@ -244,6 +244,7 @@ files:
|
|
244
244
|
- lib/thegarage/gitx/cli/track_command.rb
|
245
245
|
- lib/thegarage/gitx/cli/update_command.rb
|
246
246
|
- lib/thegarage/gitx/string_extensions.rb
|
247
|
+
- lib/thegarage/gitx/thor_extensions.rb
|
247
248
|
- lib/thegarage/gitx/version.rb
|
248
249
|
- spec/fixtures/vcr_cassettes/pull_request_does_exist.yml
|
249
250
|
- spec/fixtures/vcr_cassettes/pull_request_does_not_exist.yml
|