mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 21:14:23 +02:00
[rubygems/rubygems] Better approach to falling back to user installation when GEM_HOME not writable
f67bced16b
This commit is contained in:
parent
0f3f907e17
commit
33bd956257
6 changed files with 29 additions and 128 deletions
|
@ -22,15 +22,6 @@ class Gem::Command
|
|||
|
||||
Gem::OptionParser.accept Symbol, &:to_sym
|
||||
|
||||
##
|
||||
# Names of commands that should print "Defaulting to user installation"
|
||||
# warning.
|
||||
|
||||
COMMANDS_WITH_AUTO_INSTALL_DIR_WARNING = [
|
||||
"install",
|
||||
"update",
|
||||
].freeze
|
||||
|
||||
##
|
||||
# The name of the command.
|
||||
|
||||
|
@ -332,11 +323,6 @@ class Gem::Command
|
|||
elsif @when_invoked
|
||||
@when_invoked.call options
|
||||
else
|
||||
if COMMANDS_WITH_AUTO_INSTALL_DIR_WARNING.include?(@command) && \
|
||||
Gem.paths.auto_user_install && !options[:install_dir] && !options[:user_install]
|
||||
self.ui.say "Defaulting to user installation because default installation directory (#{Gem.default_dir}) is not writable."
|
||||
end
|
||||
|
||||
execute
|
||||
end
|
||||
ensure
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue