From 60efee7386f0ce27a26834b9ab313b8951d431bb Mon Sep 17 00:00:00 2001 From: Paul Pettengill Date: Mon, 29 Jan 2024 22:11:38 -0800 Subject: [PATCH] Fix - Deprecation Warning on DebugInspector --- binding_of_caller.gemspec | 2 +- lib/binding_of_caller/mri.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/binding_of_caller.gemspec b/binding_of_caller.gemspec index a40068f..dd45f96 100644 --- a/binding_of_caller.gemspec +++ b/binding_of_caller.gemspec @@ -31,5 +31,5 @@ TXT spec.require_paths = ["lib"] - spec.add_dependency "debug_inspector", ">= 0.0.1" + spec.add_dependency "debug_inspector", ">= 1.2.0" end diff --git a/lib/binding_of_caller/mri.rb b/lib/binding_of_caller/mri.rb index 3bc2437..751dd44 100644 --- a/lib/binding_of_caller/mri.rb +++ b/lib/binding_of_caller/mri.rb @@ -18,7 +18,7 @@ def of_caller(n) def callers ary = [] - RubyVM::DebugInspector.open do |dc| + DebugInspector.open do |dc| locs = dc.backtrace_locations locs.size.times do |i| @@ -43,7 +43,7 @@ def frame_count # @return [Symbol] def frame_type return nil if !@iseq - + # apparently the 9th element of the iseq array holds the frame type # ...not sure how reliable this is. @frame_type ||= @iseq.to_a[9]