summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-12-14 02:16:43 +0900
committergit <svn-admin@ruby-lang.org>2024-07-18 04:20:07 +0000
commitc032e2c225f4c20ba35cc40a3dd00eef9ae62cfd (patch)
treef722c2955279f488dac914176f9ff15882e610e5 /spec
parentc639bacd454dcf43619591f0f0eaa1ac7226f77c (diff)
[rubygems/rubygems] Use `caller_locations` instead of splitting `caller`
Also limit caller ranges https://github.com/rubygems/rubygems/commit/a274b1af78
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/support/builders.rb3
1 files changed, 2 insertions, 1 deletions
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?