codeclimate-test-reporter 1.0.6 → 1.0.7

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: bb324d6eebb28615ce0776cad60a7266e7be6fd3
4
- data.tar.gz: 38c163b2ee107a923b418db0251440520cffcf36
3
+ metadata.gz: 4987647d33a2c2650e39bc80481b84024f6e8836
4
+ data.tar.gz: aa9b3065712ab19ec97b41f0474fcd6ad07fa204
5
5
  SHA512:
6
- metadata.gz: e8d6b4c9188f126740375b42fad4b99079c350e365f26ff9f102a0816976e8d19ec0b33c0fd6eac7cedc3cb917f79de867537ddc971e592e9a6ece5c72475153
7
- data.tar.gz: fba316444f90ac50e835cb078b4fbd4228879aae1ba3a6023f703c7a9caa0022aba04f66f15fda3fdc917c171286a7843db6b5f1b7f415e227dd61798d7a3bd7
6
+ metadata.gz: 2640091efeaeaa0d2509a0792b7f048b9d0abe25156fe7e35e17b67162415f8240b61b01ffb5ef66aa3a2663de26ab146adc53ba18d32a4e20bd8bb69bfcb45c
7
+ data.tar.gz: 6e27dc575ed74c542452f08cdb72666e7f37167a5ac617505078d055648ed49fdc1c23a775527fe1446c08f50a9c486d15a94fa1a31531112326d02d6af29f74
@@ -4,12 +4,16 @@ module CodeClimate
4
4
  class << self
5
5
  def info
6
6
  {
7
- head: head,
7
+ head: head_from_git_or_ci,
8
8
  committed_at: committed_at_from_git_or_ci,
9
9
  branch: branch_from_git_or_ci,
10
10
  }
11
11
  end
12
12
 
13
+ def head_from_git_or_ci
14
+ head_from_git || head_from_ci
15
+ end
16
+
13
17
  def branch_from_git_or_ci
14
18
  clean_service_branch || clean_git_branch || "master"
15
19
  end
@@ -34,8 +38,13 @@ module CodeClimate
34
38
 
35
39
  private
36
40
 
37
- def head
38
- git("log -1 --pretty=format:'%H'")
41
+ def head_from_git
42
+ commit_hash = git("log -1 --pretty=format:'%H'")
43
+ !commit_hash.empty? ? commit_hash : nil
44
+ end
45
+
46
+ def head_from_ci
47
+ Ci.service_data[:commit_sha]
39
48
  end
40
49
 
41
50
  def committed_at_from_ci
@@ -1,5 +1,5 @@
1
1
  module CodeClimate
2
2
  module TestReporter
3
- VERSION = "1.0.6".freeze
3
+ VERSION = "1.0.7".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codeclimate-test-reporter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Helmkamp
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-02-22 00:00:00.000000000 Z
12
+ date: 2017-03-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: simplecov
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  version: '0'
146
146
  requirements: []
147
147
  rubyforge_project:
148
- rubygems_version: 2.6.10
148
+ rubygems_version: 2.6.8
149
149
  signing_key:
150
150
  specification_version: 4
151
151
  summary: Uploads Ruby test coverage data to Code Climate.