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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a347ec9597dc6a1500fe2b1553c1fbccf26bfdb3
4
- data.tar.gz: ff80647cdef77c93294142807d85ca2b1cf919ba
3
+ metadata.gz: 2437a3ef9ef77a60350a4ee9c85a27c7b30f08ba
4
+ data.tar.gz: b7f81b792a331bc0466eb12b7a733bbd754fe562
5
5
  SHA512:
6
- metadata.gz: 5f7092e8b7ff099a93bd7fe4d555bb44d4bc81941931de0218933d5fa7d97565177caf751fda46bcdd6a32f45e75fb00ef80116b27d2f0754c0e2f19043b3bab
7
- data.tar.gz: 31a1f2ccd61511599d86c6e78b5da81a3f4299473e4e4a7c9c3085ca452ab6cc06c5ab9bc01ae8006423bfa6549360d10ff6a528524287a606911e11296463c9
6
+ metadata.gz: 94cf313fc46c9c1e5f38f6fff7e3d732b93acbf2c852c321525882af32236e19fc16b868e413901cbd229a7e183e99e26eae7165ed543437dd48780265c5e8f7
7
+ data.tar.gz: f1e9d43de78984a88340ea76b58c35167f28d987de03b0904b0557aed7b6855ba0ea71d45e66fe1a679cc56323ad7a7813c5db29165c5861c19ce30c6fcab806
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- git_reflow (0.5.2)
4
+ git_reflow (0.5.3)
5
5
  colorize (= 0.6.0)
6
6
  github_api (= 0.12.3)
7
7
  gli (= 2.12.2)
@@ -58,8 +58,9 @@ module GitReflow
58
58
  end
59
59
 
60
60
  def append_to_squashed_commit_message(message = '')
61
- run "echo \"#{message}\" | cat - .git/SQUASH_MSG > ./tmp_squash_msg"
62
- run 'mv ./tmp_squash_msg .git/SQUASH_MSG'
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
@@ -15,7 +15,9 @@ module GitReflow
15
15
  if options[:with_system] == true
16
16
  system(command)
17
17
  elsif options[:loud] == true
18
- puts `#{command}`
18
+ output = `#{command}`
19
+ puts output
20
+ output
19
21
  else
20
22
  `#{command}`
21
23
  end
@@ -1,3 +1,3 @@
1
1
  module GitReflow
2
- VERSION = "0.5.2"
2
+ VERSION = "0.5.3"
3
3
  end
@@ -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
- expect{ subject }.to have_run_commands_in_order [
151
- "echo \"#{message}\" | cat - .git/SQUASH_MSG > ./tmp_squash_msg",
152
- 'mv ./tmp_squash_msg .git/SQUASH_MSG'
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
- $output = []
5
- $says = []
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.2
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-04-03 00:00:00.000000000 Z
13
+ date: 2015-05-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: appraisal