single_cov 1.6.0 → 1.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b1061e2ee0841966f31a082926db0474550414ac8e06f395696152ba3b985aa5
4
- data.tar.gz: 836d974a4b39cbbf4b5454334997f60ac4d2afe5aafd4609bc2e04fb57f5a991
3
+ metadata.gz: 335d34d5996fcce343f9169f6ac25438b067c5a3c15bdd1d98dcee3735fa466d
4
+ data.tar.gz: 29f107401979e13f522f68ea7c5fe5dd669da526e63b058be5f4801ad9ba99d6
5
5
  SHA512:
6
- metadata.gz: e30055d56774315c96b907ef0d930c83a4ac921855d0000760ade00d47af0e3394a96853f13f669e4fd797e0d8d2d5aeadbfb1e8a8549f45ca36629a80befae6
7
- data.tar.gz: 6e42c196b4cbb0eccb982b3bb942cf1664d8aa99925eabc7c9fb6165d10dd94de36640527556a9209739058501a36e191fc9136f21c903e0aa57307c63b2bd73
6
+ metadata.gz: 72a285bece4433388ec47c2559c4c0635660620f4d9c0887d431ecd4915bc41131c495bff35040801bcfe1835fb393a05e84661b4379d037d8874cb4e5e6e440
7
+ data.tar.gz: 408ef4c3a530aa768ff91db4ad31f1a028c69994ea766fc56b72d63a699f26d60be21e8f21b8f96d2dace82604615b1ddbf2050c9f367bdebaecc54a8069073e
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module SingleCov
3
- VERSION = "1.6.0"
3
+ VERSION = "1.7.1"
4
4
  end
data/lib/single_cov.rb CHANGED
@@ -38,7 +38,7 @@ module SingleCov
38
38
 
39
39
  # ignore lines that are marked as uncovered via comments
40
40
  # TODO: warn when using uncovered but the section is indeed covered
41
- content = File.readlines(file)
41
+ content = File.readlines("#{root}/#{file}")
42
42
  uncovered.reject! do |line_start, _, _, _|
43
43
  content[line_start - 1].match?(UNCOVERED_COMMENT_MARKER)
44
44
  end
@@ -50,7 +50,7 @@ module SingleCov
50
50
  return true if errors.empty?
51
51
 
52
52
  errors[MAX_OUTPUT..-1] = "... coverage output truncated" if errors.size >= MAX_OUTPUT
53
- warn errors
53
+ @error_logger.puts errors
54
54
 
55
55
  errors.all? { |l| warning?(l) }
56
56
  end
@@ -76,7 +76,9 @@ module SingleCov
76
76
  end
77
77
  end
78
78
 
79
- def setup(framework, root: nil, branches: true)
79
+ def setup(framework, root: nil, branches: true, err: $stderr)
80
+ @error_logger = err
81
+
80
82
  if defined?(SimpleCov)
81
83
  raise "Load SimpleCov after SingleCov"
82
84
  end
@@ -271,9 +273,8 @@ module SingleCov
271
273
  end
272
274
 
273
275
  def ensure_covered_file(file)
274
- raise "Use paths relative to project root." if file&.start_with?("/")
275
-
276
276
  if file
277
+ raise "Use paths relative to project root." if file.start_with?("/")
277
278
  raise "#{file} does not exist, use paths relative to project root." unless File.exist?("#{root}/#{file}")
278
279
  else
279
280
  file = guess_covered_file(caller[1])
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: single_cov
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-07 00:00:00.000000000 Z
11
+ date: 2022-12-24 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description:
13
+ description:
14
14
  email: michael@grosser.it
15
15
  executables: []
16
16
  extensions: []
@@ -23,7 +23,7 @@ homepage: https://github.com/grosser/single_cov
23
23
  licenses:
24
24
  - MIT
25
25
  metadata: {}
26
- post_install_message:
26
+ post_install_message:
27
27
  rdoc_options: []
28
28
  require_paths:
29
29
  - lib
@@ -31,15 +31,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - ">="
33
33
  - !ruby/object:Gem::Version
34
- version: 2.5.0
34
+ version: 2.7.0
35
35
  required_rubygems_version: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
39
  version: '0'
40
40
  requirements: []
41
- rubygems_version: 3.1.3
42
- signing_key:
41
+ rubygems_version: 3.3.3
42
+ signing_key:
43
43
  specification_version: 4
44
44
  summary: Actionable code coverage.
45
45
  test_files: []