diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-12-27 08:56:00 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-27 08:56:00 +0900 |
commit | 9736cb890bb80924e7d1f3189232bfe60519bd29 (patch) | |
tree | 14a239c4cdbf38a34161d6287b627c6542294232 /lib/bundler/dsl.rb | |
parent | 1f877fa238a839dcb77fb88158ea912a43cbf564 (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/dsl.rb')
-rw-r--r-- | lib/bundler/dsl.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb index f7922b1fba..7b0db79de6 100644 --- a/lib/bundler/dsl.rb +++ b/lib/bundler/dsl.rb @@ -46,7 +46,7 @@ module Bundler @gemfile = expanded_gemfile_path @gemfiles << expanded_gemfile_path contents ||= Bundler.read_file(@gemfile.to_s) - instance_eval(contents.dup.tap{|x| x.untaint if RUBY_VERSION < "2.7" }, gemfile.to_s, 1) + instance_eval(contents.dup.tap{|x| x.untaint if Kernel.method_defined?(:untaint) }, gemfile.to_s, 1) rescue Exception => e # rubocop:disable Lint/RescueException message = "There was an error " \ "#{e.is_a?(GemfileEvalError) ? "evaluating" : "parsing"} " \ |