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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c0120e898073e422bc4c2203dadfb71f60de083b
4
- data.tar.gz: bf8b82ecaccfe531f2ef87d9882ac794597352e4
3
+ metadata.gz: 157ec9c6f9262f4f5f8f67a9b9311f7b043b01c4
4
+ data.tar.gz: 9c4a441992272ddfe73fbce1cbc545af55193ad9
5
5
  SHA512:
6
- metadata.gz: 4647f117605853e151a65147b5ffffdcfee3a5abcf66e699fe0c6512d847da0d3ec2df0a96f48927395362227d933b52a926dc17e6abc52c023d9b671a005721
7
- data.tar.gz: 5b6724e334fc187b4c1d6dc7ccd76b7e3db4155955644f46f24df5932872e7e78b6e44061c9e95e40a6be91c6c7a80bccfc8d22069d5ec4d5d54bb5a037aa212
6
+ metadata.gz: a08a0ac6fefbe661734ecc85d39c61b7e97dba979893857781c8fa423212704467032b1de0bbbdc49db8209329710b1d09a8a311d3b6f0241ac3df268177b883
7
+ data.tar.gz: 6cda20098a7eebb8deb02c4d6ec138553c90d0d71fc0ec83fbe1f0ce116836000012b9f58c4fd99327cc8161ec731a236f88192757228e85a416dc34dfaf4848
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- git_reflow (0.6.0)
4
+ git_reflow (0.6.1)
5
5
  colorize (= 0.6.0)
6
6
  github_api (= 0.12.3)
7
7
  gli (= 2.12.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.5
5
- - rvm install 2.2.1
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.5 bundle install'
10
- - 'rvm-exec 2.2.1 bundle install'
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.5 bundle exec rake'
16
- - 'rvm-exec 2.2.1 bundle exec rake'
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
- git_root_dir = run('git rev-parse --show-toplevel').strip
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
- title = pr_msg.shift
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
@@ -1,3 +1,3 @@
1
1
  module GitReflow
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.1"
3
3
  end
@@ -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) { "do do the voodoo that you do" }
148
- let(:root_dir) { `pwd`.strip }
149
- subject { Gitacular.append_to_squashed_commit_message(message) }
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.0
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-05-15 00:00:00.000000000 Z
13
+ date: 2015-06-02 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: appraisal