summaryrefslogtreecommitdiff
path: root/lib/bundler/rubygems_ext.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-12-27 08:56:00 +0900
committerGitHub <noreply@github.com>2021-12-27 08:56:00 +0900
commit9736cb890bb80924e7d1f3189232bfe60519bd29 (patch)
tree14a239c4cdbf38a34161d6287b627c6542294232 /lib/bundler/rubygems_ext.rb
parent1f877fa238a839dcb77fb88158ea912a43cbf564 (diff)
Check if `Kernel#untaint` is defined instead of version comparison
Probably `RUBY_VERSION` seems overwritten somewhere in the tests.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/5349 Merged-By: nobu <nobu@ruby-lang.org>
Diffstat (limited to 'lib/bundler/rubygems_ext.rb')
-rw-r--r--lib/bundler/rubygems_ext.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb
index 5d572aa73d..97d1c957ca 100644
--- a/lib/bundler/rubygems_ext.rb
+++ b/lib/bundler/rubygems_ext.rb
@@ -29,7 +29,7 @@ module Gem
# gems at that time, this method could be called inside another require,
# thus raising with that constant being undefined. Better to check a method
if source.respond_to?(:path) || (source.respond_to?(:bundler_plugin_api_source?) && source.bundler_plugin_api_source?)
- Pathname.new(loaded_from).dirname.expand_path(source.root).to_s.tap{|x| x.untaint if RUBY_VERSION < "2.7" }
+ Pathname.new(loaded_from).dirname.expand_path(source.root).to_s.tap{|x| x.untaint if Kernel.method_defined?(:untaint) }
else
rg_full_gem_path
end