From c6983e66b491ba6bd6d2cccbc9d2f9f1bafb280c Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 17 Oct 2026 12:15:34 +0900 Subject: [PATCH 1/3] Drop `UnboundMethod#bind_call` fallback definition --- lib/debug/session.rb | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lib/debug/session.rb b/lib/debug/session.rb index 99c78af1d..d13bcffb4 100644 --- a/lib/debug/session.rb +++ b/lib/debug/session.rb @@ -2664,12 +2664,3 @@ class Binding alias break debugger alias b debugger end - -# for Ruby 2.6 compatibility -unless method(:p).unbind.respond_to? :bind_call - class UnboundMethod - def bind_call(obj, *args) - self.bind(obj).call(*args) - end - end -end From 52a44f3063ebd64552e5661bd962ca484c95a3ab Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 17 Oct 2026 12:15:45 +0900 Subject: [PATCH 2/3] Drop `DEBUGGER__::MethodBreakpoint#override` definition for 2.6 --- lib/debug/breakpoint.rb | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/lib/debug/breakpoint.rb b/lib/debug/breakpoint.rb index 78c4d2174..224c35e58 100644 --- a/lib/debug/breakpoint.rb +++ b/lib/debug/breakpoint.rb @@ -476,24 +476,13 @@ def enable try_enable end - if RUBY_VERSION.to_f <= 2.6 - def override klass - sig_method_name = @sig_method_name - klass.prepend Module.new{ - define_method(sig_method_name) do |*args, &block| - super(*args, &block) - end - } - end - else - def override klass - sig_method_name = @sig_method_name - klass.prepend Module.new{ - define_method(sig_method_name) do |*args, **kw, &block| - super(*args, **kw, &block) - end - } - end + def override klass + sig_method_name = @sig_method_name + klass.prepend Module.new{ + define_method(sig_method_name) do |*args, **kw, &block| + super(*args, **kw, &block) + end + } end def try_enable added: false From 3b62bbf7bf9f68f4044fb77af926408436f9ba10 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 17 Oct 2026 12:16:39 +0900 Subject: [PATCH 3/3] Drop fallback for `$:.resolve_feature_path` --- exe/rdbg | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/exe/rdbg b/exe/rdbg index 14b5e978c..0d753c171 100755 --- a/exe/rdbg +++ b/exe/rdbg @@ -13,18 +13,12 @@ when :start start_mode = config[:open] ? "open" : 'start' cmd = config[:command] ? ARGV.shift : (ENV['RUBY'] || RbConfig.ruby) - if defined?($:.resolve_feature_path) - begin - _, sopath = $:.resolve_feature_path('debug/debug.so') - rescue LoadError - # raises LoadError before 3.1 (2.7 and 3.0) - else - sopath = File.dirname(File.dirname(sopath)) if sopath - end + begin + _, sopath = $:.resolve_feature_path('debug/debug.so') + rescue LoadError + # raises LoadError before 3.1 (2.7 and 3.0) else - # `$:.resolve_feature_path` is not defined in 2.6 or earlier. - so = "debug/debug.#{RbConfig::CONFIG['DLEXT']}" - sopath = $:.find {|dir| File.exist?(File.join(dir, so))} + sopath = File.dirname(File.dirname(sopath)) if sopath end added = "-r #{libpath}/#{start_mode}" added = "-I #{sopath} #{added}" if sopath