undercover 0.8.1 → 0.8.3

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
2
  SHA256:
3
- metadata.gz: 522b27800c01ddd2ed70108b080f709d4c4ec12d338c4c8ba204b54cb4c464bc
4
- data.tar.gz: 8208f484eb86247a02b0c58d5007ce6a80e29ce125a2a39516e5ee4b8acdd43b
3
+ metadata.gz: 8144aeeac145c88e63c5f57ea0d31c17648b8ea428d11755b15b4bb706fa2982
4
+ data.tar.gz: 769fbd667e3bd48572829c4214f17afcd23cafaf1e7795452a2832b8105b15e0
5
5
  SHA512:
6
- metadata.gz: a65331bb82a3a31845fea782519a4254449264b914c26d8c54277a00a9ae4653bb183aa5bdc1f66982e991ccadea1b8a066553d616bbcc2c033bcc2c0550f0c0
7
- data.tar.gz: d60a04cbd89cda50b486f850e68a0843aae0db0da5acc93acab565ba93e9eaf7090c14898140b0c120cd25ddd0164a3fbcd544f794859e3c466eccaa62a3afb7
6
+ metadata.gz: af0adac825397c7c7be37a1e4d1d0a1cc039c4b0ab3a774460d4352fbf8157f4b485b3a1f4b11621d3e2ea0368a251e43ae345ca3082f3baebd5f0d5dfe36fa5
7
+ data.tar.gz: a3ba29ca707eeac980a4d1eab2f17ec17bc206f33ef57e599bd5cb0cffa76d7aaae7934d29b2a6453942abae90f8210bc5d83e23c604349c70bec8dc45fe212a
@@ -23,7 +23,7 @@ jobs:
23
23
  run: |
24
24
  git fetch --update-head-ok origin master:master
25
25
  undercover --simplecov coverage/undercover_coverage.json --compare master
26
- - uses: actions/upload-artifact@v4
26
+ - uses: actions/upload-artifact@v5
27
27
  with:
28
28
  name: undercover-${{ matrix.ruby }}-coverage
29
29
  path: coverage/undercover_coverage.json
@@ -31,7 +31,7 @@ jobs:
31
31
  runs-on: ubuntu-latest
32
32
  needs: build
33
33
  steps:
34
- - uses: actions/download-artifact@v5
34
+ - uses: actions/download-artifact@v6
35
35
  with:
36
36
  name: undercover-3.4-coverage
37
37
  - name: Upload coverage
data/CHANGELOG.md CHANGED
@@ -6,6 +6,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ # [0.8.3] - 2025-11-20
10
+ ### Fixed
11
+ - Normalize slash prefix in FilterSet support to work with the 'rails' profile (https://github.com/grodowski/undercover/pull/244)
12
+
13
+ # [0.8.2] - 2025-11-15
14
+
15
+ ### Fixed
16
+ - Fix NoMethodError in pretty_print for ignored multi-line branch results (https://github.com/grodowski/undercover/pull/243)
17
+
9
18
  # [0.8.1] - 2025-09-27
10
19
 
11
20
  ### Fixed
@@ -200,7 +209,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
200
209
  ### Added
201
210
  - First release of `undercover` 🎉
202
211
 
203
- [Unreleased]: https://github.com/grodowski/undercover/compare/v0.8.0...HEAD
212
+ [Unreleased]: https://github.com/grodowski/undercover/compare/v0.8.3...HEAD
213
+ [0.8.3]: https://github.com/grodowski/undercover/compare/v0.8.2...v0.8.3
214
+ [0.8.2]: https://github.com/grodowski/undercover/compare/v0.8.1...v0.8.2
215
+ [0.8.1]: https://github.com/grodowski/undercover/compare/v0.8.0...v0.8.1
204
216
  [0.8.0]: https://github.com/grodowski/undercover/compare/v0.7.4...v0.8.0
205
217
  [0.7.4]: https://github.com/grodowski/undercover/compare/v0.7.3...v0.7.4
206
218
  [0.7.3]: https://github.com/grodowski/undercover/compare/v0.7.2...v0.7.3
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2018-2020 Jan Grodowski
3
+ Copyright (c) 2018-2025 Jan Grodowski
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -26,13 +26,17 @@ module Undercover
26
26
  simplecov_filters.any? do |filter|
27
27
  filter = filter.transform_keys(&:to_sym)
28
28
  if filter[:string]
29
- filepath.include?(filter[:string])
29
+ normalized(filepath).include?(filter[:string])
30
30
  elsif filter[:regex]
31
- filepath.match?(Regexp.new(filter[:regex]))
31
+ normalized(filepath).match?(Regexp.new(filter[:regex]))
32
32
  elsif filter[:file]
33
- filepath == filter[:file]
33
+ filepath == filter[:file] # TODO: check if file also gets a slash?
34
34
  end
35
35
  end
36
36
  end
37
+
38
+ def normalized(filepath)
39
+ filepath.start_with?('/') ? filepath : "/#{filepath}"
40
+ end
37
41
  end
38
42
  end
@@ -134,10 +134,12 @@ module Undercover
134
134
 
135
135
  private
136
136
 
137
- # rubocop:disable Metrics/AbcSize
138
- def count_covered_branches(line_number)
137
+ def count_covered_branches(line_number) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
139
138
  branches = coverage.select { |cov| cov.size == 4 && cov[0] == line_number }
140
- count_covered = branches.count { |cov| cov[3].positive? }
139
+ count_covered = branches.count do |cov|
140
+ branch_cov = cov[3]
141
+ branch_cov == 'ignored' || (branch_cov.respond_to?(:positive?) && branch_cov.positive?)
142
+ end
141
143
 
142
144
  return '' if branches.empty?
143
145
 
@@ -148,6 +150,5 @@ module Undercover
148
150
  Rainbow(" branches: #{count_covered}/#{branches.size}").italic.darkgray.dark
149
151
  end
150
152
  end
151
- # rubocop:enable Metrics/AbcSize
152
153
  end
153
154
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Undercover
4
- VERSION = '0.8.1'
4
+ VERSION = '0.8.3'
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: undercover
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Grodowski
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-09-27 00:00:00.000000000 Z
10
+ date: 2025-11-20 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: base64