[rubygems/rubygems] Move "Defaulting to user installation ..." message, so --install-dir
and --user-install
can suppress it.
https://github.com/rubygems/rubygems/commit/6677fc6853
This commit is contained in:
parent
28a6c4a1ad
commit
be32109d64
@ -323,6 +323,10 @@ class Gem::Command
|
||||
elsif @when_invoked
|
||||
@when_invoked.call options
|
||||
else
|
||||
if Gem.paths.auto_user_install && !options[:install_dir] && !options[:user_install]
|
||||
self.ui.say "Defaulting to user installation because default GEM_HOME (#{Gem.default_dir}) is not writable."
|
||||
end
|
||||
|
||||
execute
|
||||
end
|
||||
ensure
|
||||
|
@ -18,6 +18,10 @@ class Gem::PathSupport
|
||||
# Directory with spec cache
|
||||
attr_reader :spec_cache_dir # :nodoc:
|
||||
|
||||
##
|
||||
# Whether or `Gem.paths.home` defaulted to a user install.
|
||||
attr_reader :auto_user_install
|
||||
|
||||
##
|
||||
#
|
||||
# Constructor. Takes a single argument which is to be treated like a
|
||||
@ -38,9 +42,8 @@ class Gem::PathSupport
|
||||
@home = normalize_home_dir(Gem.default_dir)
|
||||
else
|
||||
# If `GEM_HOME` is not set AND we can't use `Gem.default_dir`,
|
||||
# default to a user installation and print a message about this.
|
||||
puts "Defaulting to user installation because default GEM_HOME (#{Gem.default_dir}) is not writable."
|
||||
|
||||
# default to a user installation and set `@auto_user_install`.
|
||||
@auto_user_install = true
|
||||
@home = normalize_home_dir(Gem.user_dir)
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user