t1k 3.0.0 → 3.0.1

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: bd67c338f8dc31847df15f7ab46c66ad2e1fa31c
4
- data.tar.gz: 0d2a37c1d291b4e564a461cbf1b85f6403f91e7c
3
+ metadata.gz: 45cd40e21fada7acc6cfd3abec506f886ac990d1
4
+ data.tar.gz: 1d1c2be3e4c91e2258cb07b7b686ae64b01ad3e7
5
5
  SHA512:
6
- metadata.gz: acdf9104007415928cf95da616db85fb5efae9b76d7b0aecf03478a8cd7ed01ba2119a2b8229a6e787f7b23b8b0a2bbfadf02dab36cd99da74f60bf4a2e4c6f5
7
- data.tar.gz: 4249fcafd949bc90d268615d060cc0a6b312ccd704ffb55bf5ad15db71c92d35cda2ae9e83c777465d13c3b78e1310b4043d506e57bdbab7eb6207575d8a7a9f
6
+ metadata.gz: d69e38d46b4550587bcaf2c34bf68111630cc6f6e65e77788e9391d80c63d468d5518af86eeb09a59df80ae8e0ee064cebe9032fda025798a2ee42bffe8cccae
7
+ data.tar.gz: 4dfeba2189c6ce63dfc2d8895e6378df92f844ac2934287ce0801f9cf8f6e3b6fd65ff7794fe3a5a4c1eb2c5be9c780b543d3f463624f2d8082d4bc729126530
@@ -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} #{skip_ci}' "
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
@@ -1,3 +1,3 @@
1
1
  module T1k
2
- VERSION = "3.0.0"
2
+ VERSION = "3.0.1"
3
3
  end
@@ -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.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-23 00:00:00.000000000 Z
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