aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2023-07-20 17:49:07 +0900
committergit <svn-admin@ruby-lang.org>2023-07-25 06:23:27 +0000
commit422144d220e8cfec38c0b07b2ba142aa5fa9066b (patch)
tree8f97e7face4af2dfa361350908b4961a67890be3 /lib
parent6bb34a7684955a45638f48101df01c1deaff8d62 (diff)
downloadruby-422144d220e8cfec38c0b07b2ba142aa5fa9066b.tar.gz
[rubygems/rubygems] Use Kernel.singleton_class
https://github.com/rubygems/rubygems/commit/f2e8e054df
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/rubygems_integration.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb
index c74824ae1b..5f151e8c80 100644
--- a/lib/bundler/rubygems_integration.rb
+++ b/lib/bundler/rubygems_integration.rb
@@ -226,11 +226,9 @@ module Bundler
end
def replace_require(specs)
- kernel = (class << ::Kernel; self; end)
-
- return if [kernel, ::Kernel].any?{|klass| klass.respond_to?(:no_warning_require)}
+ return if [::Kernel.singleton_class, ::Kernel].any?{|klass| klass.respond_to?(:no_warning_require)}
- [kernel, ::Kernel].each do |kernel_class|
+ [::Kernel.singleton_class, ::Kernel].each do |kernel_class|
kernel_class.send(:alias_method, :no_warning_require, :require)
kernel_class.send(:define_method, :require) do |file|
name = file.tr("/", "-")