cc_cover_report 0.0.2 → 0.0.3
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 +4 -4
- data/lib/cc_cover_report/version.rb +1 -1
- data/lib/cc_cover_report.rb +14 -12
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b4f40f8f4219ed13d65bcd9f9e6747455fae366
|
4
|
+
data.tar.gz: 2e6bfd8bd054de4149bbe59c3f45c96732d747f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9cf161597f5ecc4864b78e6d7477a476fd7ff45ac8f4753498a6ff1e06900945364e0db94903dd8d15c5718b329c2e8e61e2579184a25b132f81c3254009bf3c
|
7
|
+
data.tar.gz: c69b7fffd58e778f72c901b8c08a5f0ea9b99df1348d3cf10475ffe06f18868e56d829ebe0678d11a43d295228ff1aa596aa6003d0bdda4a36093f4c11a6095f
|
data/lib/cc_cover_report.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
require "cc_cover_report/version"
|
2
|
+
require 'rest_client'
|
2
3
|
|
3
4
|
class CcCoverReport
|
4
5
|
def self.report(repo_key = nil)
|
5
6
|
begin
|
6
7
|
repo_key ||= ENV['CC_REPO_KEY']
|
7
8
|
if repo_key.present?
|
8
|
-
require 'rest_client'
|
9
9
|
index_file = SimpleCov.coverage_path + "/index.html"
|
10
10
|
if SimpleCov.running
|
11
11
|
silence_stream(STDOUT) do
|
@@ -13,18 +13,20 @@ class CcCoverReport
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
if File.exist?(index_file)
|
16
|
-
RestClient.
|
17
|
-
:
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
16
|
+
RestClient::Request.execute(:url => 'https://codecop.encore.io/api/coverage.json', :method => :post, :verify_ssl => false,
|
17
|
+
:payload => {
|
18
|
+
:commit => `git log --pretty=%P -n 1`.chomp,
|
19
|
+
:repo_key => repo_key,
|
20
|
+
:coverage_file => File.new(index_file)}
|
21
|
+
)
|
22
|
+
puts "Pushed coverage report to CC"
|
23
|
+
end
|
24
|
+
else
|
25
|
+
# No index file found - cannot upload coverage report
|
22
26
|
end
|
23
|
-
|
24
|
-
#
|
27
|
+
rescue Exception
|
28
|
+
# Don't break any builds - just fail
|
25
29
|
end
|
26
|
-
rescue Exception
|
27
|
-
# Don't break any builds - just fail
|
28
30
|
end
|
29
31
|
end
|
30
|
-
|
32
|
+
|