t1k 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/t1k/commands/commit.rb +2 -5
- data/lib/t1k/version.rb +1 -1
- data/spec/t1k/commands/commit_spec.rb +32 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45cd40e21fada7acc6cfd3abec506f886ac990d1
|
4
|
+
data.tar.gz: 1d1c2be3e4c91e2258cb07b7b686ae64b01ad3e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d69e38d46b4550587bcaf2c34bf68111630cc6f6e65e77788e9391d80c63d468d5518af86eeb09a59df80ae8e0ee064cebe9032fda025798a2ee42bffe8cccae
|
7
|
+
data.tar.gz: 4dfeba2189c6ce63dfc2d8895e6378df92f844ac2934287ce0801f9cf8f6e3b6fd65ff7794fe3a5a4c1eb2c5be9c780b543d3f463624f2d8082d4bc729126530
|
data/lib/t1k/commands/commit.rb
CHANGED
@@ -4,23 +4,20 @@ module T1k
|
|
4
4
|
|
5
5
|
def self.run(message, close, add, no_message)
|
6
6
|
message ||= ""
|
7
|
-
skip_ci = ''
|
8
7
|
text_close = ''
|
9
8
|
|
10
9
|
raise "Message can't be blank. Use --no-message to ignore this rule." if message.empty? && !no_message
|
11
10
|
branch = `git branch | grep '*' | awk '{print $2}'`
|
12
11
|
|
13
|
-
text_close = close ? 'close ' : ''
|
12
|
+
text_close = close ? 'close ' : 'ref'
|
14
13
|
|
15
14
|
if close
|
16
15
|
text_close = 'close '
|
17
|
-
else
|
18
|
-
skip_ci = '[ci skip]'
|
19
16
|
end
|
20
17
|
|
21
18
|
text_add = add ? 'a' : ''
|
22
19
|
|
23
|
-
system "git commit -#{text_add}m '[#{text_close}##{branch.strip}] #{message}
|
20
|
+
system "git commit -#{text_add}m '[#{text_close}##{branch.strip}] #{message}'"
|
24
21
|
end
|
25
22
|
end
|
26
23
|
end
|
data/lib/t1k/version.rb
CHANGED
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe T1k::Commands::Commit do
|
4
|
+
describe '#self.run' do
|
5
|
+
let (:msg) { "teste" }
|
6
|
+
let (:close) { false }
|
7
|
+
let (:add) { false }
|
8
|
+
let (:no_message) { true }
|
9
|
+
|
10
|
+
it "should raise an exception" do
|
11
|
+
message = ""
|
12
|
+
no_message = false
|
13
|
+
|
14
|
+
expect { T1k::Commands::Commit.run( message, close, add, no_message) }.to raise_error("Message can't be blank. Use --no-message to ignore this rule.")
|
15
|
+
end
|
16
|
+
|
17
|
+
it "it have to skip circle ci when is not a close commit" do
|
18
|
+
close = false
|
19
|
+
expect_any_instance_of(Kernel).to receive(:system).with("git commit -m '[ref#branch_name] teste'")
|
20
|
+
|
21
|
+
T1k::Commands::Commit.run( msg, close, add, no_message)
|
22
|
+
end
|
23
|
+
|
24
|
+
it "have to close the issue when close=true is passed" do
|
25
|
+
close = true
|
26
|
+
expect_any_instance_of(Kernel).to receive(:system).with("git commit -m '[close #branch_name] teste'")
|
27
|
+
|
28
|
+
T1k::Commands::Commit.run( msg, close, add, no_message)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: t1k
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodrigo Maia
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-08-
|
13
|
+
date: 2016-08-31 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -149,6 +149,7 @@ files:
|
|
149
149
|
- ./resources/T1000
|
150
150
|
- ./spec/spec_helper.rb
|
151
151
|
- ./spec/support/kernel.rb
|
152
|
+
- ./spec/t1k/commands/commit_spec.rb
|
152
153
|
- ./spec/t1k_spec.rb
|
153
154
|
- ./t1k.gemspec
|
154
155
|
- README.md
|