simplecov-formatter-badge 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/test.yml +27 -0
- data/Gemfile +13 -2
- data/Gemfile.lock +16 -8
- data/LICENSE +22 -0
- data/README.md +12 -0
- data/Rakefile +6 -6
- data/bin/console +4 -3
- data/examples/green.svg +19 -0
- data/examples/red.svg +19 -0
- data/examples/yellow.svg +19 -0
- data/lib/simplecov-formatter-badge.rb +3 -1
- data/simplecov-formatter-badge.gemspec +4 -6
- metadata +12 -51
- data/.travis.yml +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3dd84b222c96192d7a2457b2f919b4527bbd4b84e75bea963bd23e366775cf8f
|
4
|
+
data.tar.gz: 4b06b3c29f26a1a83e7bf0e7c3ee3a0190c5d3a5874e03603cf7f96b3ec386a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f2548f1654e196e91eaa0d7a8d26bd636d11b64430ee5a3b8fd0720be62b4e838497b448e2722e5640b904fc63cefd6cef543d5c22d68b9b41f88f2dfc229be
|
7
|
+
data.tar.gz: a0b2b30e5b16b34f2a22b1ef8bc8ee7eb07701c85061968f3efebe5dcd9f9bde4bc860a6c5d287e7ab62ff01a54e4ad26a58de33ec01062e78ac23a98d0346ff
|
@@ -0,0 +1,27 @@
|
|
1
|
+
name: Test
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: ["master"]
|
6
|
+
pull_request:
|
7
|
+
branches: ["master"]
|
8
|
+
|
9
|
+
permissions:
|
10
|
+
contents: read
|
11
|
+
|
12
|
+
jobs:
|
13
|
+
test:
|
14
|
+
runs-on: ubuntu-latest
|
15
|
+
strategy:
|
16
|
+
matrix:
|
17
|
+
ruby-version: ["2.7", "3.0", "3.1", "3.2"]
|
18
|
+
if: ${{ !contains(github.event.commits.*.message, '[skip ci]') }}
|
19
|
+
|
20
|
+
steps:
|
21
|
+
- uses: actions/checkout@v3
|
22
|
+
- uses: ruby/setup-ruby@v1
|
23
|
+
with:
|
24
|
+
ruby-version: ${{ matrix.ruby-version }}
|
25
|
+
bundler-cache: true
|
26
|
+
- name: Test
|
27
|
+
run: bundle exec rake test
|
data/Gemfile
CHANGED
@@ -1,6 +1,17 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
source 'https://rubygems.org'
|
4
|
+
|
5
|
+
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
4
6
|
|
5
7
|
# Specify your gem's dependencies in simplecov-formatter-badge.gemspec
|
8
|
+
|
9
|
+
group :development, :test do
|
10
|
+
gem 'rake'
|
11
|
+
end
|
12
|
+
|
13
|
+
group :test do
|
14
|
+
gem 'minitest', require: false
|
15
|
+
gem 'simplecov', require: false
|
16
|
+
end
|
6
17
|
gemspec
|
data/Gemfile.lock
CHANGED
@@ -1,22 +1,30 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
simplecov-formatter-badge (0.1.
|
4
|
+
simplecov-formatter-badge (0.1.1)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
|
10
|
-
|
9
|
+
docile (1.4.0)
|
10
|
+
minitest (5.17.0)
|
11
|
+
rake (13.0.6)
|
12
|
+
simplecov (0.22.0)
|
13
|
+
docile (~> 1.1)
|
14
|
+
simplecov-html (~> 0.11)
|
15
|
+
simplecov_json_formatter (~> 0.1)
|
16
|
+
simplecov-html (0.12.3)
|
17
|
+
simplecov_json_formatter (0.1.4)
|
11
18
|
|
12
19
|
PLATFORMS
|
13
|
-
|
20
|
+
arm64-darwin-21
|
21
|
+
x86_64-linux
|
14
22
|
|
15
23
|
DEPENDENCIES
|
16
|
-
|
17
|
-
|
18
|
-
|
24
|
+
minitest
|
25
|
+
rake
|
26
|
+
simplecov
|
19
27
|
simplecov-formatter-badge!
|
20
28
|
|
21
29
|
BUNDLED WITH
|
22
|
-
|
30
|
+
2.3.26
|
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
|
2
|
+
The MIT License (MIT)
|
3
|
+
|
4
|
+
Copyright (c) 2018 marocchino and contributors
|
5
|
+
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
8
|
+
in the Software without restriction, including without limitation the rights
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
11
|
+
furnished to do so, subject to the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be included in
|
14
|
+
all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
|
+
THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Simplecov Badge Formatter
|
2
2
|
|
3
|
+
## Examples
|
4
|
+
|
5
|
+
![red](examples/red.svg)
|
6
|
+
![yellow](examples/yellow.svg)
|
7
|
+
![green](examples/green.svg)
|
8
|
+
|
3
9
|
## Installation
|
4
10
|
|
5
11
|
Add this line to your application's Gemfile:
|
@@ -27,3 +33,9 @@ then use it from your README
|
|
27
33
|
```md
|
28
34
|
[![coverage](https://path.to.report/coverage.svg)](https://path.to.report/)
|
29
35
|
```
|
36
|
+
|
37
|
+
## Why not ...
|
38
|
+
|
39
|
+
- simplecov-badge: not pretty
|
40
|
+
- simplecov-formatter-shield: bug & not fix it
|
41
|
+
- simplecov-shields-badge: do not want commit coverage
|
data/Rakefile
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
require 'rake/testtask'
|
3
3
|
|
4
4
|
Rake::TestTask.new(:test) do |t|
|
5
|
-
t.libs <<
|
6
|
-
t.libs <<
|
7
|
-
t.test_files = FileList[
|
5
|
+
t.libs << 'test'
|
6
|
+
t.libs << 'lib'
|
7
|
+
t.test_files = FileList['test/**/*_test.rb']
|
8
8
|
end
|
9
9
|
|
10
|
-
task :
|
10
|
+
task default: :test
|
data/bin/console
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
|
-
require
|
4
|
-
require
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'simplecov-formatter-badge'
|
5
6
|
|
6
7
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
8
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,5 +11,5 @@ require "simplecov/formatter/badge"
|
|
10
11
|
# require "pry"
|
11
12
|
# Pry.start
|
12
13
|
|
13
|
-
require
|
14
|
+
require 'irb'
|
14
15
|
IRB.start(__FILE__)
|
data/examples/green.svg
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="94" height="20">
|
2
|
+
<linearGradient id="b" x2="0" y2="100%">
|
3
|
+
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
|
4
|
+
<stop offset="1" stop-opacity=".1"/>
|
5
|
+
</linearGradient>
|
6
|
+
<clipPath id="a">
|
7
|
+
<rect width="94" height="20" rx="3" fill="#fff"/>
|
8
|
+
</clipPath>
|
9
|
+
<g clip-path="url(#a)">
|
10
|
+
<path fill="#555" d="M0 0h59v20H0z"/>
|
11
|
+
<path fill="#4c1" d="M59 0h35v20H59z"/>
|
12
|
+
<path fill="url(#b)" d="M0 0h94v20H0z"/>
|
13
|
+
</g>
|
14
|
+
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110">
|
15
|
+
<text x="305" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="490">coverage</text>
|
16
|
+
<text x="305" y="140" transform="scale(.1)" textLength="490">coverage</text>
|
17
|
+
<text x="755" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="250">93%</text>
|
18
|
+
<text x="755" y="140" transform="scale(.1)" textLength="250">93%</text></g>
|
19
|
+
</svg>
|
data/examples/red.svg
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="94" height="20">
|
2
|
+
<linearGradient id="b" x2="0" y2="100%">
|
3
|
+
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
|
4
|
+
<stop offset="1" stop-opacity=".1"/>
|
5
|
+
</linearGradient>
|
6
|
+
<clipPath id="a">
|
7
|
+
<rect width="94" height="20" rx="3" fill="#fff"/>
|
8
|
+
</clipPath>
|
9
|
+
<g clip-path="url(#a)">
|
10
|
+
<path fill="#555" d="M0 0h59v20H0z"/>
|
11
|
+
<path fill="#e05d44" d="M59 0h35v20H59z"/>
|
12
|
+
<path fill="url(#b)" d="M0 0h94v20H0z"/>
|
13
|
+
</g>
|
14
|
+
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110">
|
15
|
+
<text x="305" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="490">coverage</text>
|
16
|
+
<text x="305" y="140" transform="scale(.1)" textLength="490">coverage</text>
|
17
|
+
<text x="755" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="250">52%</text>
|
18
|
+
<text x="755" y="140" transform="scale(.1)" textLength="250">52%</text></g>
|
19
|
+
</svg>
|
data/examples/yellow.svg
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="94" height="20">
|
2
|
+
<linearGradient id="b" x2="0" y2="100%">
|
3
|
+
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
|
4
|
+
<stop offset="1" stop-opacity=".1"/>
|
5
|
+
</linearGradient>
|
6
|
+
<clipPath id="a">
|
7
|
+
<rect width="94" height="20" rx="3" fill="#fff"/>
|
8
|
+
</clipPath>
|
9
|
+
<g clip-path="url(#a)">
|
10
|
+
<path fill="#555" d="M0 0h59v20H0z"/>
|
11
|
+
<path fill="#dfb317" d="M59 0h35v20H59z"/>
|
12
|
+
<path fill="url(#b)" d="M0 0h94v20H0z"/>
|
13
|
+
</g>
|
14
|
+
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110">
|
15
|
+
<text x="305" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="490">coverage</text>
|
16
|
+
<text x="305" y="140" transform="scale(.1)" textLength="490">coverage</text>
|
17
|
+
<text x="755" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="250">83%</text>
|
18
|
+
<text x="755" y="140" transform="scale(.1)" textLength="250">83%</text></g>
|
19
|
+
</svg>
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module SimpleCov
|
2
4
|
module Formatter
|
3
5
|
class BadgeFormatter
|
@@ -6,7 +8,7 @@ module SimpleCov
|
|
6
8
|
def format(result)
|
7
9
|
persent = result.covered_percent.to_i
|
8
10
|
color = color_by(persent)
|
9
|
-
File.open(result_file_path,
|
11
|
+
File.open(result_file_path, 'w') do |file|
|
10
12
|
file.write <<~XML
|
11
13
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="94" height="20">
|
12
14
|
<linearGradient id="b" x2="0" y2="100%">
|
@@ -1,9 +1,11 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
2
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
5
|
|
4
6
|
Gem::Specification.new do |spec|
|
5
7
|
spec.name = 'simplecov-formatter-badge'
|
6
|
-
spec.version = '0.1.
|
8
|
+
spec.version = '0.1.1'
|
7
9
|
spec.authors = ['Shim Won']
|
8
10
|
spec.email = ['marocchino@gmail.com']
|
9
11
|
|
@@ -24,8 +26,4 @@ Gem::Specification.new do |spec|
|
|
24
26
|
spec.bindir = 'exe'
|
25
27
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
26
28
|
spec.require_paths = ['lib']
|
27
|
-
|
28
|
-
spec.add_development_dependency 'bundler', '~> 1.16'
|
29
|
-
spec.add_development_dependency 'rake', '~> 10.0'
|
30
|
-
spec.add_development_dependency 'minitest', '~> 5.0'
|
31
29
|
end
|
metadata
CHANGED
@@ -1,57 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simplecov-formatter-badge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shim Won
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.16'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.16'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '10.0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '10.0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: minitest
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '5.0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '5.0'
|
11
|
+
date: 2023-03-01 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
55
13
|
description: ''
|
56
14
|
email:
|
57
15
|
- marocchino@gmail.com
|
@@ -59,21 +17,25 @@ executables: []
|
|
59
17
|
extensions: []
|
60
18
|
extra_rdoc_files: []
|
61
19
|
files:
|
20
|
+
- ".github/workflows/test.yml"
|
62
21
|
- ".gitignore"
|
63
|
-
- ".travis.yml"
|
64
22
|
- Gemfile
|
65
23
|
- Gemfile.lock
|
24
|
+
- LICENSE
|
66
25
|
- README.md
|
67
26
|
- Rakefile
|
68
27
|
- bin/console
|
69
28
|
- bin/setup
|
29
|
+
- examples/green.svg
|
30
|
+
- examples/red.svg
|
31
|
+
- examples/yellow.svg
|
70
32
|
- lib/simplecov-formatter-badge.rb
|
71
33
|
- simplecov-formatter-badge.gemspec
|
72
34
|
homepage: https://github.com/marocchino/simplecov-formatter-badge
|
73
35
|
licenses: []
|
74
36
|
metadata:
|
75
37
|
allowed_push_host: https://rubygems.org
|
76
|
-
post_install_message:
|
38
|
+
post_install_message:
|
77
39
|
rdoc_options: []
|
78
40
|
require_paths:
|
79
41
|
- lib
|
@@ -88,9 +50,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
50
|
- !ruby/object:Gem::Version
|
89
51
|
version: '0'
|
90
52
|
requirements: []
|
91
|
-
|
92
|
-
|
93
|
-
signing_key:
|
53
|
+
rubygems_version: 3.3.26
|
54
|
+
signing_key:
|
94
55
|
specification_version: 4
|
95
56
|
summary: badge formatter for simplecov
|
96
57
|
test_files: []
|