summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2024-06-25 14:24:09 +0200
committergit <svn-admin@ruby-lang.org>2024-06-27 12:53:04 +0000
commitd29a76b90bae06cbad72bf9d14ff5581206e6f74 (patch)
tree582b95634e419954a448e9050881c5d4cc6a1150 /lib
parent0c7776a22656c45c8df59ab6faa4a62ba7dfe42c (diff)
[rubygems/rubygems] Only override `pre_install_checks` when necessary
RubyGems >= 3.5 no longer raises `Gem::FilePermissionError` explicitly. https://github.com/rubygems/rubygems/commit/df54b9fd90
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/rubygems_gem_installer.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/bundler/rubygems_gem_installer.rb b/lib/bundler/rubygems_gem_installer.rb
index aee908c47e..10c2da1781 100644
--- a/lib/bundler/rubygems_gem_installer.rb
+++ b/lib/bundler/rubygems_gem_installer.rb
@@ -48,12 +48,14 @@ module Bundler
spec
end
- def pre_install_checks
- super
- rescue Gem::FilePermissionError
- # Ignore permission checks in RubyGems. Instead, go on, and try to write
- # for real. We properly handle permission errors when they happen.
- nil
+ if Bundler.rubygems.provides?("< 3.5")
+ def pre_install_checks
+ super
+ rescue Gem::FilePermissionError
+ # Ignore permission checks in RubyGems. Instead, go on, and try to write
+ # for real. We properly handle permission errors when they happen.
+ nil
+ end
end
def generate_plugins