simplecov_json_formatter 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +5 -4
- data/lib/simplecov_json_formatter/result_hash_formatter.rb +20 -4
- data/lib/simplecov_json_formatter/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed76f412883d4b3acf146f750e65972606174a67a41ee8b295ea1892a37c2760
|
4
|
+
data.tar.gz: 176d3713a8d6781b04911bf88911cff530076ecd0e8a50eb3596a56611096fd1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 733c1930a1b246f3bec4c32bd82653470c385171454557ce2ceceab96315f4b670c76787261a33673be1cb3a33b4e95e5f977a6e7e28d25fc8895c56cd5e5e5b
|
7
|
+
data.tar.gz: ff9e3302d5ca638b9cb9da78ebd150e58e420dccf8d198d9c47b46ec9e22cc5a4667c2f14bd5ac17735085c593cb4691e93e5d2568ab3d62390c96ba085a82a4
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
***Note: To learn more about SimpleCov, check out the main repo at [https://github.com/simplecov-ruby/simplecov](https://github.com/colszowka/simplecov***)***
|
4
4
|
|
5
|
-
Generates a formatted JSON report of your [SimpleCov](https://github.com/simplecov-ruby/simplecov) ruby code coverage results on ruby 2.4+. Originally intended to add `simplecov`'s results reading capacity to CI tools.
|
5
|
+
Generates a formatted JSON report of your [SimpleCov](https://github.com/simplecov-ruby/simplecov) ruby code coverage results on ruby 2.4+. Originally intended to add `simplecov`'s results reading capacity to CI tools.
|
6
6
|
|
7
7
|
## Overview
|
8
8
|
|
9
|
-
You can expect for this gem to produce a `coverage.json` file, located at the `coverage` folder.
|
9
|
+
You can expect for this gem to produce a `coverage.json` file, located at the `coverage` folder.
|
10
10
|
|
11
11
|
Depending on your `SimpleCoV`'s settings you will experiment different outcomes. Particularly depending on which type of coverage are you running `SimpleCov` with:
|
12
12
|
|
@@ -15,13 +15,14 @@ Depending on your `SimpleCoV`'s settings you will experiment different outcomes.
|
|
15
15
|
|
16
16
|
## Development
|
17
17
|
|
18
|
-
We encourage you to use docker for common operations like running tests, or debugging your code. Running `make sh` will start a new container instance based on the `Dockerfile` provided at root, finally a shell prompt will be displayed on your terminal. Also, syncronization with your local files will be already set.
|
18
|
+
We encourage you to use docker for common operations like running tests, or debugging your code. Running `make sh` will start a new container instance based on the `Dockerfile` provided at root, finally a shell prompt will be displayed on your terminal. Also, syncronization with your local files will be already set.
|
19
|
+
|
19
20
|
### Tests
|
20
21
|
`make test` will trigger the excution of both running tests and running rubocop as linter, by simply running `rake`, this actions will be run inside a new container but using your local files.
|
21
22
|
|
22
23
|
### Format
|
23
24
|
|
24
|
-
`make format` will run `rubocop -a` which stands for _autocorrect_ and format your code according to the `.rubocop.yml` config file.
|
25
|
+
`make format` will run `rubocop -a` which stands for _autocorrect_ and format your code according to the `.rubocop.yml` config file.
|
25
26
|
|
26
27
|
## Copyright
|
27
28
|
|
@@ -9,22 +9,38 @@ module SimpleCovJSONFormatter
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def format
|
12
|
+
format_files
|
13
|
+
format_groups
|
14
|
+
|
15
|
+
formatted_result
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def format_files
|
12
21
|
@result.files.each do |source_file|
|
13
22
|
formatted_result[:coverage][source_file.filename] =
|
14
23
|
format_source_file(source_file)
|
15
24
|
end
|
16
|
-
|
17
|
-
formatted_result
|
18
25
|
end
|
19
26
|
|
20
|
-
|
27
|
+
def format_groups
|
28
|
+
@result.groups.each do |name, file_list|
|
29
|
+
formatted_result[:groups][name] = {
|
30
|
+
lines: {
|
31
|
+
covered_percent: file_list.covered_percent
|
32
|
+
}
|
33
|
+
}
|
34
|
+
end
|
35
|
+
end
|
21
36
|
|
22
37
|
def formatted_result
|
23
38
|
@formatted_result ||= {
|
24
39
|
meta: {
|
25
40
|
simplecov_version: SimpleCov::VERSION
|
26
41
|
},
|
27
|
-
coverage: {}
|
42
|
+
coverage: {},
|
43
|
+
groups: {}
|
28
44
|
}
|
29
45
|
end
|
30
46
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simplecov_json_formatter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Federico Moya
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: JSON formatter for SimpleCov
|
14
14
|
email:
|
@@ -28,7 +28,7 @@ homepage: https://github.com/fede-moya/simplecov_json_formatter
|
|
28
28
|
licenses:
|
29
29
|
- MIT
|
30
30
|
metadata: {}
|
31
|
-
post_install_message:
|
31
|
+
post_install_message:
|
32
32
|
rdoc_options: []
|
33
33
|
require_paths:
|
34
34
|
- lib
|
@@ -43,8 +43,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
43
43
|
- !ruby/object:Gem::Version
|
44
44
|
version: '0'
|
45
45
|
requirements: []
|
46
|
-
rubygems_version: 3.0.
|
47
|
-
signing_key:
|
46
|
+
rubygems_version: 3.0.8
|
47
|
+
signing_key:
|
48
48
|
specification_version: 4
|
49
49
|
summary: JSON formatter for SimpleCov
|
50
50
|
test_files: []
|