git_reflow 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/circle.yml +6 -6
- data/lib/git_reflow/commands/review.rb +7 -3
- data/lib/git_reflow/git_helpers.rb +4 -1
- data/lib/git_reflow/version.rb +1 -1
- data/spec/lib/git_reflow/git_helpers_spec.rb +10 -5
- data/spec/support/command_line_helpers.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 157ec9c6f9262f4f5f8f67a9b9311f7b043b01c4
|
4
|
+
data.tar.gz: 9c4a441992272ddfe73fbce1cbc545af55193ad9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a08a0ac6fefbe661734ecc85d39c61b7e97dba979893857781c8fa423212704467032b1de0bbbdc49db8209329710b1d09a8a311d3b6f0241ac3df268177b883
|
7
|
+
data.tar.gz: 6cda20098a7eebb8deb02c4d6ec138553c90d0d71fc0ec83fbe1f0ce116836000012b9f58c4fd99327cc8161ec731a236f88192757228e85a416dc34dfaf4848
|
data/Gemfile.lock
CHANGED
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.
|
5
|
-
- rvm install 2.2.
|
4
|
+
- rvm install 2.1.6
|
5
|
+
- rvm install 2.2.2
|
6
6
|
|
7
7
|
override:
|
8
8
|
- 'rvm-exec 2.0.0-p643 bundle install'
|
9
|
-
- 'rvm-exec 2.1.
|
10
|
-
- 'rvm-exec 2.2.
|
9
|
+
- 'rvm-exec 2.1.6 bundle install'
|
10
|
+
- 'rvm-exec 2.2.2 bundle install'
|
11
11
|
|
12
12
|
test:
|
13
13
|
override:
|
14
14
|
- 'rvm-exec 2.0.0-p643 bundle exec rake'
|
15
|
-
- 'rvm-exec 2.1.
|
16
|
-
- 'rvm-exec 2.2.
|
15
|
+
- 'rvm-exec 2.1.6 bundle exec rake'
|
16
|
+
- 'rvm-exec 2.2.2 bundle exec rake'
|
@@ -6,8 +6,7 @@ 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
|
-
|
10
|
-
pull_request_msg_file = "#{git_root_dir}/.git/GIT_REFLOW_PR_MSG"
|
9
|
+
pull_request_msg_file = "#{GitReflow.git_root_dir}/.git/GIT_REFLOW_PR_MSG"
|
11
10
|
|
12
11
|
if global_options[:title] || global_options[:message]
|
13
12
|
review_options = {
|
@@ -19,13 +18,18 @@ command :review do |c|
|
|
19
18
|
File.open(pull_request_msg_file, 'w') do |file|
|
20
19
|
file.write(GitReflow.current_branch)
|
21
20
|
end
|
21
|
+
|
22
22
|
GitReflow.run("$EDITOR #{pull_request_msg_file}", with_system: true)
|
23
|
+
|
23
24
|
pr_msg = File.open(pull_request_msg_file).each_line.map(&:strip).to_a
|
25
|
+
title = pr_msg.shift
|
26
|
+
|
24
27
|
File.delete(pull_request_msg_file)
|
25
|
-
|
28
|
+
|
26
29
|
unless pr_msg.empty?
|
27
30
|
pr_msg.shift if pr_msg.first.empty?
|
28
31
|
end
|
32
|
+
|
29
33
|
review_options = {'base' => args[0],'title' => title,'body' => pr_msg.join("\n")}
|
30
34
|
end
|
31
35
|
|
@@ -5,6 +5,10 @@ module GitReflow
|
|
5
5
|
module GitHelpers
|
6
6
|
include Sandbox
|
7
7
|
|
8
|
+
def git_root_dir
|
9
|
+
@git_root_dir ||= run('git rev-parse --show-toplevel', loud: false).strip
|
10
|
+
end
|
11
|
+
|
8
12
|
def remote_user
|
9
13
|
return "" unless "#{GitReflow::Config.get('remote.origin.url')}".length > 0
|
10
14
|
extract_remote_user_and_repo_from_remote_url(GitReflow::Config.get('remote.origin.url'))[:user]
|
@@ -58,7 +62,6 @@ module GitReflow
|
|
58
62
|
end
|
59
63
|
|
60
64
|
def append_to_squashed_commit_message(message = '')
|
61
|
-
git_root_dir = run('git rev-parse --show-toplevel').strip
|
62
65
|
run "echo \"#{message}\" | cat - #{git_root_dir}/.git/SQUASH_MSG > #{git_root_dir}/tmp_squash_msg"
|
63
66
|
run "mv #{git_root_dir}/tmp_squash_msg #{git_root_dir}/.git/SQUASH_MSG"
|
64
67
|
end
|
data/lib/git_reflow/version.rb
CHANGED
@@ -14,6 +14,11 @@ describe GitReflow::GitHelpers do
|
|
14
14
|
stub_run_for Gitacular
|
15
15
|
end
|
16
16
|
|
17
|
+
describe ".git_root_dir" do
|
18
|
+
subject { Gitacular.git_root_dir }
|
19
|
+
it { expect{ subject }.to have_run_command_silently "git rev-parse --show-toplevel" }
|
20
|
+
end
|
21
|
+
|
17
22
|
describe ".remote_user" do
|
18
23
|
subject { Gitacular.remote_user }
|
19
24
|
|
@@ -144,13 +149,13 @@ describe GitReflow::GitHelpers do
|
|
144
149
|
end
|
145
150
|
|
146
151
|
describe ".append_to_squashed_commit_message(message)" do
|
147
|
-
let(:message)
|
148
|
-
let(:root_dir) {
|
149
|
-
|
152
|
+
let(:message) { "do do the voodoo that you do" }
|
153
|
+
let(:root_dir) { '/home/gitreflow' }
|
154
|
+
before { allow(Gitacular).to receive(:git_root_dir).and_return(root_dir) }
|
155
|
+
subject { Gitacular.append_to_squashed_commit_message(message) }
|
156
|
+
|
150
157
|
it "appends the message to git's SQUASH_MSG temp file" do
|
151
|
-
stub_command("git rev-parse --show-toplevel", "#{root_dir}\n")
|
152
158
|
expect { subject }.to have_run_commands_in_order [
|
153
|
-
"git rev-parse --show-toplevel",
|
154
159
|
"echo \"#{message}\" | cat - #{root_dir}/.git/SQUASH_MSG > #{root_dir}/tmp_squash_msg",
|
155
160
|
"mv #{root_dir}/tmp_squash_msg #{root_dir}/.git/SQUASH_MSG"
|
156
161
|
]
|
@@ -89,7 +89,7 @@ RSpec::Matchers.define :have_run_commands_in_order do |commands|
|
|
89
89
|
supports_block_expectations
|
90
90
|
|
91
91
|
failure_message do |block|
|
92
|
-
"expected to have run these commands in order:\n\t\t#{commands.inspect}\n\tgot:\n\t\t#{$commands_ran.inspect}"
|
92
|
+
"expected to have run these commands in order:\n\t\t#{commands.inspect}\n\tgot:\n\t\t#{$commands_ran.map(&:command).inspect}"
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
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.6.
|
4
|
+
version: 0.6.1
|
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-
|
13
|
+
date: 2015-06-02 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: appraisal
|