From c032e2c225f4c20ba35cc40a3dd00eef9ae62cfd Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 14 Dec 2022 02:16:43 +0900 Subject: [rubygems/rubygems] Use `caller_locations` instead of splitting `caller` Also limit caller ranges https://github.com/rubygems/rubygems/commit/a274b1af78 --- spec/bundler/support/builders.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'spec') diff --git a/spec/bundler/support/builders.rb b/spec/bundler/support/builders.rb index b2de94601a..cb7f419f42 100644 --- a/spec/bundler/support/builders.rb +++ b/spec/bundler/support/builders.rb @@ -245,7 +245,8 @@ module Spec end def update_repo(path, build_compact_index: true) - if path == gem_repo1 && caller.first.split(" ").last != "`build_repo'" + exempted_caller = Gem.ruby_version >= Gem::Version.new("3.4.0.dev") ? "#{Module.nesting.first}#build_repo" : "build_repo" + if path == gem_repo1 && caller_locations(1, 1).first.label != exempted_caller raise "Updating gem_repo1 is unsupported -- use gem_repo2 instead" end return unless block_given? -- cgit v1.2.3