circleci-coverage_reporter 0.6.0 → 0.7.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 +4 -4
- data/CHANGELOG.md +6 -1
- data/lib/circleci/coverage_reporter/reporters/link.rb +34 -11
- data/lib/circleci/coverage_reporter/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c02b2d7af2b63de0bd7ddb667a911ff9aa27bb4
|
4
|
+
data.tar.gz: 7404cc0ff4659841480a436231ca53a1fb944693
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27d50c4f709ee6bfcc164504a3121f3c47bbe25f5a43f45e20f9a14e5df4f5b055f3a6b9ef4ad9bc4739774c951c33eec0b615e06be9405ca38da3dc74fcda37
|
7
|
+
data.tar.gz: 4193dcc451c5c0fef0fbbef4046391241e30695716e2d455fe59d7e07587ad440a19d97c4fac71a1e48d52103ff02d9856cfb1035adcc5f18ec762a6d1248102
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [0.7.0] - 2017-05-31
|
10
|
+
### Changed
|
11
|
+
- Add base and previous links to Link reporter
|
12
|
+
|
9
13
|
## [0.6.0] - 2017-05-30
|
10
14
|
### Changed
|
11
15
|
- Refactor how to implement reporter. Now a reporter consists of a single ruby class
|
@@ -67,7 +71,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
67
71
|
### Added
|
68
72
|
- Initial release
|
69
73
|
|
70
|
-
[Unreleased]: https://github.com/increments/circleci-coverage_reporter/compare/v0.
|
74
|
+
[Unreleased]: https://github.com/increments/circleci-coverage_reporter/compare/v0.7.0...HEAD
|
75
|
+
[0.7.0]: https://github.com/increments/circleci-coverage_reporter/compare/v0.6.0...v0.7.0
|
71
76
|
[0.6.0]: https://github.com/increments/circleci-coverage_reporter/compare/v0.5.0...v0.6.0
|
72
77
|
[0.5.0]: https://github.com/increments/circleci-coverage_reporter/compare/v0.4.0...v0.5.0
|
73
78
|
[0.4.0]: https://github.com/increments/circleci-coverage_reporter/compare/v0.3.1...v0.4.0
|
@@ -4,32 +4,47 @@ module CircleCI
|
|
4
4
|
module CoverageReporter
|
5
5
|
module Reporters
|
6
6
|
class Link
|
7
|
-
|
7
|
+
# @attr name [String]
|
8
|
+
# @attr url [String]
|
9
|
+
# @attr base_url [String, nil]
|
10
|
+
# @attr previous_url [String, nil]
|
11
|
+
LinkReport = Struct.new(:name, :url, :base_url, :previous_url) do
|
12
|
+
# @return [String]
|
8
13
|
def to_s
|
9
|
-
|
14
|
+
links = []
|
15
|
+
links << "[master](#{base_url})" if base_url
|
16
|
+
links << "[previous](#{previous_url})" if previous_url
|
17
|
+
link = links.empty? ? nil : " (#{links.join(', ')})"
|
18
|
+
"[#{name}](#{url})#{link}"
|
10
19
|
end
|
11
20
|
end
|
12
21
|
|
13
|
-
|
14
|
-
|
22
|
+
# @param path [String]
|
23
|
+
# @param name [String]
|
24
|
+
def initialize(path:, name:)
|
25
|
+
@path = path
|
26
|
+
@name = name
|
15
27
|
end
|
16
28
|
|
17
29
|
# @note Implementation for {Base#active?}
|
18
30
|
def active?
|
19
|
-
File.file?(File.join(configuration.artifacts_dir,
|
31
|
+
File.file?(File.join(configuration.artifacts_dir, path))
|
20
32
|
end
|
21
33
|
|
22
34
|
# @note Override {Base#name}
|
23
|
-
|
24
|
-
@options[:name]
|
25
|
-
end
|
35
|
+
attr_reader :name
|
26
36
|
|
27
|
-
|
28
|
-
|
37
|
+
# @param base_build [Build, nil]
|
38
|
+
# @param previous_build [Build, nil]
|
39
|
+
# @return [LinkReport]
|
40
|
+
def report(base_build, previous_build)
|
41
|
+
LinkReport.new(name, url, extract_artifact_url(base_build), extract_artifact_url(previous_build))
|
29
42
|
end
|
30
43
|
|
31
44
|
private
|
32
45
|
|
46
|
+
attr_reader :path
|
47
|
+
|
33
48
|
# @return [String]
|
34
49
|
def url
|
35
50
|
[
|
@@ -38,13 +53,21 @@ module CircleCI
|
|
38
53
|
configuration.current_build_number,
|
39
54
|
'artifacts',
|
40
55
|
"0#{configuration.artifacts_dir}",
|
41
|
-
|
56
|
+
path
|
42
57
|
].join('/')
|
43
58
|
end
|
44
59
|
|
45
60
|
def configuration
|
46
61
|
CoverageReporter.configuration
|
47
62
|
end
|
63
|
+
|
64
|
+
# @param build [Build, nil]
|
65
|
+
# @return [String, nil]
|
66
|
+
def extract_artifact_url(build)
|
67
|
+
return unless build
|
68
|
+
artifact = build.find_artifact(path)
|
69
|
+
artifact ? artifact.url : nil
|
70
|
+
end
|
48
71
|
end
|
49
72
|
end
|
50
73
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: circleci-coverage_reporter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuku Takahashi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|