require-hooks 0.4.0 → 0.4.1

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: 046c644cbb446d1abd3263c3c1ee0c578cddac17693d102172e123f1a880966a
4
- data.tar.gz: a102736a0665a9de69c9aba242033a479af9b090bf135fa729e74b9bd8f6e006
3
+ metadata.gz: 5179f6010729ac30b40c0040f2d00956164c8f765d41e2d095eeefa9b96da842
4
+ data.tar.gz: f836cd71ec64084e4145ac572a555b7a32b7abdacd7d7d25965766bca2d264bc
5
5
  SHA512:
6
- metadata.gz: 35e088739e021cc4e83827122ce2daa63934439f6e4d0c9597ccafdaf6f6a08b50eba9302cfed1ced10538a62b317406ded4da1882b06f4d04b527a5e4902b47
7
- data.tar.gz: 801d491df8a08926067f47b44ee2372d73a53fada8cdfe36b62c0d66191f52f6900499121fc87a326125f00e443848734e5f7756df541d7e92f688ae293e5026
6
+ metadata.gz: 93559e1cc1b84d23e17b60abb8f92e47c67ea6f66f1dcbc4243b34f3d68345674c96da73aa890ba8c79e226209877a48aa4438343a51ba3ce736160403597abb
7
+ data.tar.gz: 4c36e011286728aee0f43a81411875c38fee956e34105c4dcba87bc4cf52aaee6a2d4e97d332bd2727551c85bc009ddba646b3a9764ca19c3521b7687bf43a1c
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 0.4.1 (2026-07-22)
6
+
7
+ - Bring back Ruby 2.3 compatibility.
8
+
5
9
  ## 0.4.0 (2026-04-29)
6
10
 
7
11
  - Improved Bootsnap cache invalidation logic on hooks configuration changes.
data/README.md CHANGED
@@ -128,7 +128,7 @@ Thus, if you introduce new source transformers or hijackers, you must invalidate
128
128
 
129
129
  ## Limitations
130
130
 
131
- - Coverage tracking is only supported if `eval` coverage tracking is enabled (`Coverage.start(eval: true, ...)` or `Simplecov.start { enable_coverage_for_eval; ... }`). Currently requires **Ruby 3.4+**.
131
+ - Coverage tracking is only supported in Ruby 4.0.4+ (or 3.4.10+ for 3.4.x series); for older versions in 3.4 and 4.0 series, you can enable `eval` coverage tracking to make it work with Require Hooks (`Coverage.start(eval: true, ...)` or `SimpleCov.enable_coverage :eval`). For Ruby 3.2.x and 3.3.x, only around hooks are supported.
132
132
  - `Kernel#load` with a wrap argument (e.g., `load "some_path", true` or `load "some_path", MyModule)`) is not supported (fallbacked to the original implementation). The biggest challenge here is to support constants nesting.
133
133
  - Some very edgy symlinking scenarios are not supported (unlikely to affect real-world projects).
134
134
 
@@ -69,22 +69,24 @@ module RequireHooks
69
69
  ::Bootsnap::CompileCache::ISeq.cache_dir = File.join(LoadIseqExt.orig_cache_dir, RequireHooks::Bootsnap.version_hash)
70
70
 
71
71
  ctx.run_around_load_callbacks(path) do
72
- iseq = super
72
+ begin
73
+ iseq = super
73
74
 
74
- ::Bootsnap::CompileCache::ISeq.cache_dir = LoadIseqExt.orig_cache_dir
75
+ ::Bootsnap::CompileCache::ISeq.cache_dir = LoadIseqExt.orig_cache_dir
75
76
 
76
- # Bootsnap returns nil when the coverage is on,
77
- # we fallback to our custom #compile_with_coverage
78
- unless iseq
79
- next unless defined?(Coverage) && Coverage.running?
77
+ # Bootsnap returns nil when the coverage is on,
78
+ # we fallback to our custom #compile_with_coverage
79
+ unless iseq
80
+ next unless defined?(Coverage) && Coverage.running?
80
81
 
81
- iseq = RequireHooks::Iseq.compile_with_coverage(ctx, path)
82
- end
82
+ iseq = RequireHooks::Iseq.compile_with_coverage(ctx, path)
83
+ end
83
84
 
84
- iseq.eval
85
- EMPTY_ISEQ
86
- ensure
87
- ::Bootsnap::CompileCache::ISeq.cache_dir = LoadIseqExt.orig_cache_dir
85
+ iseq.eval
86
+ EMPTY_ISEQ
87
+ ensure
88
+ ::Bootsnap::CompileCache::ISeq.cache_dir = LoadIseqExt.orig_cache_dir
89
+ end
88
90
  end
89
91
  end
90
92
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RequireHooks
4
- VERSION = "0.4.0"
4
+ VERSION = "0.4.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: require-hooks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladimir Dementyev