summaryrefslogtreecommitdiff
path: root/lib/bundler/source
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2019-10-18 14:56:22 -0700
committerJeremy Evans <code@jeremyevans.net>2019-10-18 15:06:01 -0700
commit8b1b7c199224a10c44c869654f061560852a3795 (patch)
tree39b15d6a46d43d4317eef20802f371042815ae98 /lib/bundler/source
parentc9d16351b4e2a8a41ce9e3a812b7612970b25a78 (diff)
downloadbundler-8b1b7c199224a10c44c869654f061560852a3795.tar.gz
Only untaint strings on Ruby <2.7
Ruby 2.7 deprecates taint and it no longer has an effect. This attempts to leave the behavior the same on older Ruby versions, but avoid the use of untaint on Ruby 2.7+. See https://bugs.ruby-lang.org/issues/16131 for details.
Diffstat (limited to 'lib/bundler/source')
-rw-r--r--lib/bundler/source/git.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bundler/source/git.rb b/lib/bundler/source/git.rb
index 73123622d4..736f5bb546 100644
--- a/lib/bundler/source/git.rb
+++ b/lib/bundler/source/git.rb
@@ -316,7 +316,7 @@ module Bundler
def load_gemspec(file)
stub = Gem::StubSpecification.gemspec_stub(file, install_path.parent, install_path.parent)
- stub.full_gem_path = Pathname.new(file).dirname.expand_path(root).to_s.untaint
+ stub.full_gem_path = Pathname.new(file).dirname.expand_path(root).to_s.tap{|x| x.untaint if RUBY_VERSION < "2.7" }
StubSpecification.from_stub(stub)
end