thegarage-gitx 2.7.2 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5947843d44e97022ee2483913d68e814ce12b4cb
4
- data.tar.gz: ea8962e5e6aba024574764fd06c97d7f3da4721d
3
+ metadata.gz: 10f4e21a3805920b5ca93946c11e56ef001efe97
4
+ data.tar.gz: d9aadf889e5fb72ff04eea5a038415b1c7de1f82
5
5
  SHA512:
6
- metadata.gz: 35b2bb78ba36e778d3826f642b466a218803420e44b531fac54ded8df46d3fe10a6286dafee64d6b57927c851d4ea44da89129ca39890133f10efd25324e10f9
7
- data.tar.gz: 7a80b185ddb4d4abaab5f5f655f67d2b14860afbcad068a9e5f1a0d233877f80fcc4e9203f193ebd21dcd13a6fb9e3f538159487a068c1338dacd7fe5a954d47
6
+ metadata.gz: bfd973230ab08b57c6dca5d53af1be8ba7b82f043ee17f03ef9aa58496f53c52592035143194015a89de3be1fb42d8f97b3e9b1c66687cb4325a3c29fd26588c
7
+ data.tar.gz: c955f5f81ad7adca14b84537f64b0d7fefa6e02d88243e00c4fe1a57f2188d3e0f345635ad0a016c4b53e3653da2b4df3b6fe358b2b3ab34bf1dae92b9cf4c60
data/README.md CHANGED
@@ -45,7 +45,10 @@ release the current feature branch to master. This operation will perform the f
45
45
  * merge in latest code from master branch
46
46
  * prompt user to confirm they actually want to perform the release
47
47
  * merge current branch into master
48
- * cleanup merged branches from remote server
48
+ * (optional) cleanup merged branches from remote server
49
+
50
+ options:
51
+ * `--cleanup` = automatically cleanup merged branches after release complete
49
52
 
50
53
  # Extra Utility Git Extensions
51
54
 
@@ -13,6 +13,7 @@ module Thegarage
13
13
  include Github
14
14
 
15
15
  desc 'release', 'release the current branch to production'
16
+ method_option :cleanup, :type => :boolean, :desc => 'cleanup merged branches after release'
16
17
  def release
17
18
  return unless yes?("Release #{current_branch.name} to production? (y/n)", :green)
18
19
 
@@ -28,7 +29,7 @@ module Thegarage
28
29
  run_cmd "git push origin HEAD"
29
30
 
30
31
  execute_command(IntegrateCommand, :integrate, 'staging')
31
- execute_command(CleanupCommand, :cleanup)
32
+ execute_command(CleanupCommand, :cleanup) if options[:cleanup]
32
33
  end
33
34
  end
34
35
  end
@@ -1,5 +1,5 @@
1
1
  module Thegarage
2
2
  module Gitx
3
- VERSION = '2.7.2'
3
+ VERSION = '2.8.0'
4
4
  end
5
5
  end
@@ -33,7 +33,7 @@ describe Thegarage::Gitx::Cli::ReleaseCommand do
33
33
  before do
34
34
  expect(cli).to receive(:execute_command).with(Thegarage::Gitx::Cli::UpdateCommand, :update)
35
35
  expect(cli).to receive(:execute_command).with(Thegarage::Gitx::Cli::IntegrateCommand, :integrate, 'staging')
36
- expect(cli).to receive(:execute_command).with(Thegarage::Gitx::Cli::CleanupCommand, :cleanup)
36
+ expect(cli).to_not receive(:execute_command).with(Thegarage::Gitx::Cli::CleanupCommand, :cleanup)
37
37
 
38
38
  expect(cli).to receive(:yes?).and_return(true)
39
39
  allow(cli).to receive(:authorization_token).and_return(authorization_token)
@@ -69,7 +69,7 @@ describe Thegarage::Gitx::Cli::ReleaseCommand do
69
69
 
70
70
  expect(cli).to receive(:execute_command).with(Thegarage::Gitx::Cli::UpdateCommand, :update).twice
71
71
  expect(cli).to receive(:execute_command).with(Thegarage::Gitx::Cli::IntegrateCommand, :integrate, 'staging')
72
- expect(cli).to receive(:execute_command).with(Thegarage::Gitx::Cli::CleanupCommand, :cleanup)
72
+ expect(cli).to_not receive(:execute_command).with(Thegarage::Gitx::Cli::CleanupCommand, :cleanup)
73
73
 
74
74
  expect(cli).to receive(:yes?).and_return(true)
75
75
 
@@ -91,5 +91,36 @@ describe Thegarage::Gitx::Cli::ReleaseCommand do
91
91
  should meet_expectations
92
92
  end
93
93
  end
94
+ context 'when --cleanup flag passed' do
95
+ let(:options) do
96
+ {
97
+ cleanup: true
98
+ }
99
+ end
100
+ let(:authorization_token) { '123123' }
101
+ before do
102
+ expect(cli).to receive(:execute_command).with(Thegarage::Gitx::Cli::UpdateCommand, :update)
103
+ expect(cli).to receive(:execute_command).with(Thegarage::Gitx::Cli::IntegrateCommand, :integrate, 'staging')
104
+ expect(cli).to receive(:execute_command).with(Thegarage::Gitx::Cli::CleanupCommand, :cleanup)
105
+
106
+ expect(cli).to receive(:yes?).and_return(true)
107
+ allow(cli).to receive(:authorization_token).and_return(authorization_token)
108
+
109
+ expect(cli).to receive(:run_cmd).with("git checkout master").ordered
110
+ expect(cli).to receive(:run_cmd).with("git pull origin master").ordered
111
+ expect(cli).to receive(:run_cmd).with("git merge --no-ff feature-branch").ordered
112
+ expect(cli).to receive(:run_cmd).with("git push origin HEAD").ordered
113
+
114
+ VCR.use_cassette('pull_request_does_exist') do
115
+ cli.release
116
+ end
117
+ end
118
+ it 'runs expected commands' do
119
+ should meet_expectations
120
+ end
121
+ it 'prunes merged branches (git cleanup)' do
122
+ should meet_expectations
123
+ end
124
+ end
94
125
  end
95
126
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thegarage-gitx
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.2
4
+ version: 2.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Sonnek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-03 00:00:00.000000000 Z
11
+ date: 2014-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rugged