File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
lib/bootsnap/load_path_cache/core_ext Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 1
1
# Unreleased
2
2
3
+ * Improved the ` Kernel#require ` decorator to not cause a method redefinition warning. See #461 .
4
+
3
5
# 1.17.0
4
6
5
7
* Ensure ` $LOAD_PATH.dup ` is Ractor shareable to fix an conflict with ` did_you_mean ` .
Original file line number Diff line number Diff line change 1
1
# frozen_string_literal: true
2
2
3
3
module Kernel
4
- module_function
4
+ alias_method :require_without_bootsnap , :require
5
5
6
- alias_method ( :require_without_bootsnap , :require )
6
+ alias_method :require , :require # Avoid method redefinition warnings
7
7
8
- def require ( path )
8
+ def require ( path ) # rubocop:disable Lint/DuplicateMethods
9
9
return require_without_bootsnap ( path ) unless Bootsnap ::LoadPathCache . enabled?
10
10
11
11
string_path = Bootsnap . rb_get_path ( path )
@@ -34,4 +34,6 @@ def require(path)
34
34
return ret
35
35
end
36
36
end
37
+
38
+ private :require
37
39
end
You can’t perform that action at this time.
0 commit comments