summaryrefslogtreecommitdiff
path: root/ext/json
diff options
context:
space:
mode:
authorÉtienne Barrié <etienne.barrie@gmail.com>2025-09-08 12:17:24 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2025-09-11 11:54:49 +0900
commit3097a7bd125885ae4a3256542cd4d4aebd1d82da (patch)
treec3663a7f7746905b8f7a8b9df5c23203a0887c2c /ext/json
parentfa5bebbcfad4eaa4c259444148a7391ae12e3759 (diff)
[ruby/json] Fix deprecation warning backtrace
The gem root was including the test/ directory, so lines from tests were skipped, and the deprecation warnings were shown as coming from the test framework. https://github.com/ruby/json/commit/2ec31a7363 Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
Diffstat (limited to 'ext/json')
-rw-r--r--ext/json/lib/json/common.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/json/lib/json/common.rb b/ext/json/lib/json/common.rb
index 1f82c46240..60178c2a59 100644
--- a/ext/json/lib/json/common.rb
+++ b/ext/json/lib/json/common.rb
@@ -97,7 +97,7 @@ module JSON
class << self
def deprecation_warning(message, uplevel = 3) # :nodoc:
- gem_root = File.expand_path("../../../", __FILE__) + "/"
+ gem_root = File.expand_path("..", __dir__) + "/"
caller_locations(uplevel, 10).each do |frame|
if frame.path.nil? || frame.path.start_with?(gem_root) || frame.path.end_with?("/truffle/cext_ruby.rb", ".c")
uplevel += 1