git_reflow 0.5.2 → 0.5.3
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/lib/git_reflow/git_helpers.rb +3 -2
- data/lib/git_reflow/sandbox.rb +3 -1
- data/lib/git_reflow/version.rb +1 -1
- data/spec/lib/git_reflow/git_helpers_spec.rb +6 -3
- data/spec/support/command_line_helpers.rb +8 -3
- 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: 2437a3ef9ef77a60350a4ee9c85a27c7b30f08ba
|
4
|
+
data.tar.gz: b7f81b792a331bc0466eb12b7a733bbd754fe562
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94cf313fc46c9c1e5f38f6fff7e3d732b93acbf2c852c321525882af32236e19fc16b868e413901cbd229a7e183e99e26eae7165ed543437dd48780265c5e8f7
|
7
|
+
data.tar.gz: f1e9d43de78984a88340ea76b58c35167f28d987de03b0904b0557aed7b6855ba0ea71d45e66fe1a679cc56323ad7a7813c5db29165c5861c19ce30c6fcab806
|
data/Gemfile.lock
CHANGED
@@ -58,8 +58,9 @@ module GitReflow
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def append_to_squashed_commit_message(message = '')
|
61
|
-
|
62
|
-
run
|
61
|
+
git_root_dir = run('git rev-parse --show-toplevel').strip
|
62
|
+
run "echo \"#{message}\" | cat - #{git_root_dir}/.git/SQUASH_MSG > #{git_root_dir}/tmp_squash_msg"
|
63
|
+
run "mv #{git_root_dir}/tmp_squash_msg #{git_root_dir}/.git/SQUASH_MSG"
|
63
64
|
end
|
64
65
|
|
65
66
|
private
|
data/lib/git_reflow/sandbox.rb
CHANGED
data/lib/git_reflow/version.rb
CHANGED
@@ -145,11 +145,14 @@ describe GitReflow::GitHelpers do
|
|
145
145
|
|
146
146
|
describe ".append_to_squashed_commit_message(message)" do
|
147
147
|
let(:message) { "do do the voodoo that you do" }
|
148
|
+
let(:root_dir) { `pwd`.strip }
|
148
149
|
subject { Gitacular.append_to_squashed_commit_message(message) }
|
149
150
|
it "appends the message to git's SQUASH_MSG temp file" do
|
150
|
-
|
151
|
-
|
152
|
-
|
151
|
+
stub_command("git rev-parse --show-toplevel", "#{root_dir}\n")
|
152
|
+
expect { subject }.to have_run_commands_in_order [
|
153
|
+
"git rev-parse --show-toplevel",
|
154
|
+
"echo \"#{message}\" | cat - #{root_dir}/.git/SQUASH_MSG > #{root_dir}/tmp_squash_msg",
|
155
|
+
"mv #{root_dir}/tmp_squash_msg #{root_dir}/.git/SQUASH_MSG"
|
153
156
|
]
|
154
157
|
end
|
155
158
|
end
|
@@ -1,8 +1,9 @@
|
|
1
1
|
module CommandLineHelpers
|
2
2
|
def stub_command_line
|
3
|
-
$commands_ran
|
4
|
-
$
|
5
|
-
$
|
3
|
+
$commands_ran = []
|
4
|
+
$stubbed_commands = {}
|
5
|
+
$output = []
|
6
|
+
$says = []
|
6
7
|
|
7
8
|
stub_run_for GitReflow
|
8
9
|
stub_run_for GitReflow::Sandbox
|
@@ -17,7 +18,9 @@ module CommandLineHelpers
|
|
17
18
|
module_to_stub.stub(:run) do |command, options|
|
18
19
|
options ||= {}
|
19
20
|
$commands_ran << Hashie::Mash.new(command: command, options: options)
|
21
|
+
ret_value = $stubbed_commands[command] || ""
|
20
22
|
command = "" # we need this due to a bug in rspec that will keep this assignment on subsequent runs of the stub
|
23
|
+
ret_value
|
21
24
|
end
|
22
25
|
module_to_stub.stub(:say) do |output, type|
|
23
26
|
$says << {message: output, type: type}
|
@@ -26,9 +29,11 @@ module CommandLineHelpers
|
|
26
29
|
|
27
30
|
def reset_stubbed_command_line
|
28
31
|
$commands_ran = []
|
32
|
+
$stubbed_commands = {}
|
29
33
|
end
|
30
34
|
|
31
35
|
def stub_command(command, return_value)
|
36
|
+
$stubbed_commands[command] = return_value
|
32
37
|
GitReflow::Sandbox.stub(:run).with(command).and_return(return_value)
|
33
38
|
end
|
34
39
|
end
|
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.5.
|
4
|
+
version: 0.5.3
|
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-05-15 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: appraisal
|