rspec-tracer 1.0.2 → 1.0.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: 57dd6b7ba2dafd73bbe30d91e42c36498c7e4fb505e02c405825cf45d8ac0787
4
- data.tar.gz: e8886b116e2412f566ae908d3f0e2d9213df9ff70e0c88d54a8a4fb28dab9788
3
+ metadata.gz: bd23aee4693655e787948be6a1e049f99942f8bf0b7f763dd7b2df9f04a01eec
4
+ data.tar.gz: a88e6daf316e8f35fecb6661a08c837470c7f0e3396d5e63522c29614e975d6e
5
5
  SHA512:
6
- metadata.gz: 88ea3fbe3fef4c4ab2b2d2664ac5915b4e7eaa97b5ecc0d2b77dfeb03604e7f54faf4a567f65ff31235464f351a60e8817527d51f64f5a2717bb267f1cf72261
7
- data.tar.gz: fbba1feed081e49a4cef7338c05b6d1022ecac5f013b499150b42b817e1cdb13bf2dc29ad993a502d8233bfe52dc89f991ad036eaeb513cde0b5d029b6413a46
6
+ metadata.gz: f9ab2ad270d188230c5d6eb82593055151dcb1f0d43d2c15fb15bab5d96876d8cae12f70c75eff7c80e81c6c53d8930812c173b5e67899f007237170b66deb9a
7
+ data.tar.gz: 9d3ce6ded81c0ce02a6a294d1317a732890ef3814a443e87c5345c65e316463e9266af701fe03520283cf58e1e7ecf9165d5ad45aa224e4f46f5410b0790394a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,34 @@
1
+ ## [1.0.3] - 2026-05-04
2
+
3
+ ### Fixed
4
+
5
+ - **Carry-forward filter contract** — newly-added filters now apply
6
+ uniformly to both fresh attribution AND prior-snapshot carry-forward.
7
+ Previously, `Cache#load_all_files_cache` and `load_dependency_cache`
8
+ read previous-run state without re-applying the current filter list.
9
+ A user adding a new filter mid-development saw the filter take
10
+ effect only for fresh attributions on cold runs; previously-cached
11
+ paths matching the new filter persisted in `all_files` and
12
+ `dependency` until the next cold run. Filter additions now take
13
+ effect on the very next warm run. (from upstream
14
+ [PR #161](https://github.com/avmnu-sng/rspec-tracer/pull/161))
15
+
16
+ ### Note on exclusions
17
+
18
+ The companion default-filter expansion shipped in upstream PR #161
19
+ (adds `rspec_tracer_cache/`, `rspec_tracer_coverage/`,
20
+ `rspec_tracer_report/`, `rspec_tracer.lock` to the default
21
+ `add_filter` / `add_coverage_filter` lists) is intentionally NOT
22
+ backported to this 1.0.x line, for the same reason the broader
23
+ 1.1.0 default-filter expansion was excluded from 1.0.1: changing
24
+ the default filter set shifts the files present in `all_files.json`
25
+ for users who track tracer-self paths, which would invalidate their
26
+ existing caches on upgrade. Users on 1.0.x who want this default
27
+ hygiene can either upgrade to 1.2.x / 2.0.x OR add the four paths
28
+ to their own `.rspec-tracer` config explicitly. The carry-forward
29
+ filter check shipped here MAKES that user-side `add_filter` take
30
+ effect on the next warm run.
31
+
1
32
  ## [1.0.2] - 2026-05-01
2
33
 
3
34
  ### Fixed
@@ -152,9 +152,10 @@ module RSpecTracer
152
152
 
153
153
  return unless File.file?(file_name)
154
154
 
155
- @all_files = JSON.parse(File.read(file_name, encoding: 'UTF-8')).transform_values do |files|
155
+ raw = JSON.parse(File.read(file_name, encoding: 'UTF-8')).transform_values do |files|
156
156
  files.transform_keys(&:to_sym)
157
157
  end
158
+ @all_files = raw.reject { |fname, _| filtered_by_current_filters?(fname) }
158
159
  end
159
160
 
160
161
  def load_dependency_cache(cache_dir)
@@ -162,7 +163,18 @@ module RSpecTracer
162
163
 
163
164
  return unless File.file?(file_name)
164
165
 
165
- @dependency = JSON.parse(File.read(file_name, encoding: 'UTF-8')).transform_values(&:to_set)
166
+ raw = JSON.parse(File.read(file_name, encoding: 'UTF-8')).transform_values(&:to_set)
167
+ @dependency = raw.transform_values do |files|
168
+ files.reject { |fname| filtered_by_current_filters?(fname) }.to_set
169
+ end
170
+ end
171
+
172
+ # True iff `file_name` matches any currently-configured filter.
173
+ # Applied at carry-forward seed time so newly-added filters take
174
+ # effect on the very next warm run instead of waiting for a cold
175
+ # run.
176
+ def filtered_by_current_filters?(file_name)
177
+ RSpecTracer.filters.any? { |f| f.match?(file_name: file_name) }
166
178
  end
167
179
 
168
180
  def load_examples_coverage_cache(cache_dir)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RSpecTracer
4
- VERSION = '1.0.2'
4
+ VERSION = '1.0.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-tracer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abhimanyu Singh
@@ -118,7 +118,7 @@ licenses:
118
118
  - MIT
119
119
  metadata:
120
120
  homepage_uri: https://github.com/avmnu-sng/rspec-tracer
121
- source_code_uri: https://github.com/avmnu-sng/rspec-tracer/tree/v1.0.2
121
+ source_code_uri: https://github.com/avmnu-sng/rspec-tracer/tree/v1.0.3
122
122
  changelog_uri: https://github.com/avmnu-sng/rspec-tracer/blob/main/CHANGELOG.md
123
123
  bug_tracker_uri: https://github.com/avmnu-sng/rspec-tracer/issues
124
124
  rdoc_options: []