coverage-kit 0.1.0 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 2c2fc78865b3c2b6ff3f0a8e89d8d09f567228a2
4
- data.tar.gz: 3f3645c8bbeb601acbf45cdc0ada8489b2b5c580
2
+ SHA256:
3
+ metadata.gz: a3766aefe8131b22cbf33155c807154ca1c7cf1553a93a2683e34b4a1b793fc3
4
+ data.tar.gz: 9cf28490a94fe2cc00d2f257413a23f71fb80d77d195695efe81cae8a9dfc8fb
5
5
  SHA512:
6
- metadata.gz: 92817b8bb56598e7ef9911a8eeda5f059b9ad1f67093bbfd9becaa5e0ddee4e4259825d8427750f7720d41068a708d2cfb8e3f12d0bcb31cb0bdd80d0dc6d87e
7
- data.tar.gz: 9cdc9791e84e951c781480bbde6b1469b7a7399678382a0591c688fb6031a1055c352176a28f4dea5d2b0a852ba3940269211eeb799040787834d890e1326d44
6
+ metadata.gz: 69ebb3c591a8c6934563266f98e807b915923833e28055605ce438b4a768f9087f3851ab25394cd89e3fe239255a7102d54d68678dd59dc9f51596741d853bac
7
+ data.tar.gz: 2aafb81120d0723a72dc15cd70b19ecb69037e050ea17f7e494842b7af58c442c6f544e564fb8a2696617bbdcd7a557cd24ed5b63b7a8d2e5c9354288f4740a9
data/CHANGELOG.md ADDED
@@ -0,0 +1,14 @@
1
+ # Change Log
2
+ All notable changes to this project will be documented in this file.
3
+ This project adheres to [Semantic Versioning](http://semver.org/).
4
+ This changelog adheres to [Keep a CHANGELOG](http://keepachangelog.com/).
5
+
6
+ ## 0.3.0
7
+
8
+ - [PLAT-172] Remove coveralls from the gem as its not longer required use simplecov-lcov instead.
9
+ - [PLAT-176] Use the standardrb linter
10
+
11
+ ## 0.2.0
12
+
13
+ - [TT-8639] Update to build with github actions / ruby 3.0
14
+ - [TT-1392] Changelog file
data/README.md CHANGED
@@ -1,15 +1,29 @@
1
- # Coverage::Kit
1
+ [![Ruby Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/testdouble/standard)
2
+ [![Gem Version](https://badge.fury.io/rb/coverage-kit.svg)](http://badge.fury.io/rb/coverage-kit)
3
+ [![Build Status](https://github.com/sealink/coverage-kit/workflows/Build%20and%20Test/badge.svg?branch=master)](https://github.com/sealink/coverage-kit/actions)
2
4
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/coverage/kit`. To experiment with that code, run `bin/console` for an interactive prompt.
5
+ ## Purpose
4
6
 
5
- TODO: Delete this and the text above, and describe your gem
7
+ The purpose of this gem is to provide a common setup for simplecov when used
8
+ for publicly released gems.
9
+
10
+ By default it will generate lcov format in CI mode (useful for Coveralls) and
11
+ a html based report in standard development mode.
12
+
13
+ It also configures SimpleCov to enforce a minimum defined coverage percentage.
14
+ It also adds an additional check to ensure the coverage has not crept up too much (0.5%)
15
+
16
+ ## Coveralls
17
+
18
+ An coveralls compatible lcov file is generated in CI mode, this can be published
19
+ with an github action (https://github.com/marketplace/actions/coveralls-github-action)
6
20
 
7
21
  ## Installation
8
22
 
9
23
  Add this line to your application's Gemfile:
10
24
 
11
25
  ```ruby
12
- gem 'coverage-kit'
26
+ gem 'coverage-kit', require: false
13
27
  ```
14
28
 
15
29
  And then execute:
@@ -22,7 +36,12 @@ Or install it yourself as:
22
36
 
23
37
  ## Usage
24
38
 
25
- TODO: Write usage instructions here
39
+ Add to your `spec_helper.rb` file or equivalent
40
+ ```
41
+ require 'coverage/kit'
42
+
43
+ Coverage::Kit.setup(minimum_coverage: 69.95)
44
+ ```
26
45
 
27
46
  ## Development
28
47
 
@@ -38,4 +57,3 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERN
38
57
  ## License
39
58
 
40
59
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
-
data/coverage-kit.gemspec CHANGED
@@ -1,31 +1,28 @@
1
- lib = File.expand_path('../lib', __FILE__)
1
+ lib = File.expand_path("../lib", __FILE__)
2
2
  # coding: utf-8
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'coverage/kit/version'
4
+ require "coverage/kit/version"
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.name = "coverage-kit"
8
- spec.version = Coverage::Kit::VERSION
9
- spec.authors = ["Michael Noack"]
10
- spec.email = ["support@travellink.com.au"]
7
+ spec.name = "coverage-kit"
8
+ spec.version = Coverage::Kit::VERSION
9
+ spec.authors = ["Michael Noack"]
10
+ spec.email = ["support@travellink.com.au"]
11
11
 
12
- spec.summary = %q{Helper to setup good coverage for tests}
13
- spec.description = %q{Helper to setup good coverage for tests}
14
- spec.homepage = "https://github.com/sealink/coverage-kit"
15
- spec.license = "MIT"
12
+ spec.summary = "Helper to setup good coverage for tests"
13
+ spec.description = "Helper to setup good coverage for tests"
14
+ spec.homepage = "https://github.com/sealink/coverage-kit"
15
+ spec.license = "MIT"
16
16
 
17
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
- f.match(%r{^(test|spec|features)/})
19
- end
20
- spec.bindir = "exe"
21
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
17
+ spec.files = Dir["CHANGELOG.md", "README.md", "coverage-kit.gemspec", "lib/**/*"]
22
18
  spec.require_paths = ["lib"]
23
19
 
24
20
  spec.add_dependency "simplecov"
21
+ spec.add_dependency "simplecov-lcov"
25
22
 
26
- spec.add_development_dependency "bundler", "~> 1.13"
27
- spec.add_development_dependency "rake", "~> 10.0"
28
- spec.add_development_dependency "rspec", "~> 3.0"
29
- spec.add_development_dependency "simplecov-rcov"
30
- spec.add_development_dependency "coveralls"
23
+ spec.add_development_dependency "bundler"
24
+ spec.add_development_dependency "rake"
25
+ spec.add_development_dependency "rspec"
26
+ spec.add_development_dependency "simplecov-lcov"
27
+ spec.add_development_dependency "standard"
31
28
  end
@@ -1,5 +1,5 @@
1
1
  module Coverage
2
2
  module Kit
3
- VERSION = "0.1.0"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
data/lib/coverage/kit.rb CHANGED
@@ -1,31 +1,41 @@
1
1
  require "coverage/kit/version"
2
+ require "simplecov"
3
+ require "simplecov-lcov"
2
4
 
3
5
  module Coverage
4
6
  module Kit
5
- def self.setup(minimum_coverage: )
6
- return if ENV['COVERAGE'] == 'off'
7
+ def self.setup(minimum_coverage:)
8
+ return if ENV["COVERAGE"] == "off"
7
9
 
8
10
  @minimum_coverage = minimum_coverage
9
11
  @maximum_coverage = @minimum_coverage + 0.5
10
12
 
11
- require 'simplecov'
12
- Coveralls.wear! if defined?(Coveralls)
13
+ SimpleCov.start do
14
+ if ENV["CI"]
15
+ SimpleCov::Formatter::LcovFormatter.config do |c|
16
+ c.report_with_single_file = true
17
+ c.single_report_path = "coverage/lcov.info"
18
+ end
19
+ formatter SimpleCov::Formatter::LcovFormatter
20
+ else
21
+ formatter SimpleCov::Formatter::MultiFormatter.new([
22
+ SimpleCov::Formatter::SimpleFormatter,
23
+ SimpleCov::Formatter::HTMLFormatter
24
+ ])
25
+ end
13
26
 
14
- formatters = []
15
- formatters << SimpleCov::Formatter::RcovFormatter if defined?(SimpleCov::Formatter::RcovFormatter)
16
- formatters << Coveralls::SimpleCov::Formatter if defined?(Coveralls)
17
- SimpleCov.formatters = formatters
27
+ enable_coverage :branch
18
28
 
19
- SimpleCov.start do
20
- add_filter '/vendor/'
21
- add_filter '/config/'
22
- add_filter '/spec/'
23
- add_group 'lib', 'lib'
29
+ add_filter "/vendor/"
30
+ add_filter "/config/"
31
+ add_filter "/spec/"
32
+ add_group "lib", "lib"
24
33
  end
34
+
25
35
  SimpleCov.at_exit do
26
36
  SimpleCov.result.format!
27
37
  percent = SimpleCov.result.covered_percent
28
- puts "Coverage is #{'%.2f' % percent} (min: #{@minimum_coverage})"
38
+ puts "Coverage is #{"%.2f" % percent} (min: #{@minimum_coverage})"
29
39
  if percent < @minimum_coverage
30
40
  puts "Coverage must be above #{@minimum_coverage}"
31
41
  Kernel.exit(1)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coverage-kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Noack
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-03 00:00:00.000000000 Z
11
+ date: 2022-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simplecov
@@ -24,50 +24,64 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: simplecov-lcov
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: bundler
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
- - - "~>"
45
+ - - ">="
32
46
  - !ruby/object:Gem::Version
33
- version: '1.13'
47
+ version: '0'
34
48
  type: :development
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
- - - "~>"
52
+ - - ">="
39
53
  - !ruby/object:Gem::Version
40
- version: '1.13'
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rake
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
- - - "~>"
59
+ - - ">="
46
60
  - !ruby/object:Gem::Version
47
- version: '10.0'
61
+ version: '0'
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
- - - "~>"
66
+ - - ">="
53
67
  - !ruby/object:Gem::Version
54
- version: '10.0'
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: rspec
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
- - - "~>"
73
+ - - ">="
60
74
  - !ruby/object:Gem::Version
61
- version: '3.0'
75
+ version: '0'
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
- - - "~>"
80
+ - - ">="
67
81
  - !ruby/object:Gem::Version
68
- version: '3.0'
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
- name: simplecov-rcov
84
+ name: simplecov-lcov
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
87
  - - ">="
@@ -81,7 +95,7 @@ dependencies:
81
95
  - !ruby/object:Gem::Version
82
96
  version: '0'
83
97
  - !ruby/object:Gem::Dependency
84
- name: coveralls
98
+ name: standard
85
99
  requirement: !ruby/object:Gem::Requirement
86
100
  requirements:
87
101
  - - ">="
@@ -101,15 +115,8 @@ executables: []
101
115
  extensions: []
102
116
  extra_rdoc_files: []
103
117
  files:
104
- - ".gitignore"
105
- - ".rspec"
106
- - ".travis.yml"
107
- - Gemfile
108
- - LICENSE.txt
118
+ - CHANGELOG.md
109
119
  - README.md
110
- - Rakefile
111
- - bin/console
112
- - bin/setup
113
120
  - coverage-kit.gemspec
114
121
  - lib/coverage/kit.rb
115
122
  - lib/coverage/kit/version.rb
@@ -132,8 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
139
  - !ruby/object:Gem::Version
133
140
  version: '0'
134
141
  requirements: []
135
- rubyforge_project:
136
- rubygems_version: 2.4.8
142
+ rubygems_version: 3.3.0.dev
137
143
  signing_key:
138
144
  specification_version: 4
139
145
  summary: Helper to setup good coverage for tests
data/.gitignore DELETED
@@ -1,9 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --format documentation
2
- --color
data/.travis.yml DELETED
@@ -1,5 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.2.5
5
- before_install: gem install bundler -v 1.13.1
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in coverage-kit.gemspec
4
- gemspec
data/LICENSE.txt DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2016 Michael Noack
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
data/Rakefile DELETED
@@ -1,6 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
-
4
- RSpec::Core::RakeTask.new(:spec)
5
-
6
- task :default => :spec
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "coverage/kit"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here