Skip to content

Commit 8ccd830

Browse files
voxikdeivid-rodriguez
authored andcommitted
Explain the 3 states options[:user_install] can have.
This was issue previously, so hopefully this comment tries to state this explicitly for future readers.
1 parent 02b1884 commit 8ccd830

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/rubygems/installer.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,10 @@ def process_options # :nodoc:
680680
unless @gem_home
681681
# `--build-root` overrides `--user-install` and auto-user-install
682682
if @build_root.nil?
683+
# Please note that `options[:user_install]` might have three states:
684+
# * `true`: `--user-install`
685+
# * `false`: `--no-user-install` and
686+
# * `nil`: option was not specified
683687
if options[:user_install]
684688
@gem_home = Gem.user_dir
685689
elsif options[:user_install].nil? && !ENV.key?("GEM_HOME") && (File.exist?(Gem.dir) && !File.writable?(Gem.dir))

0 commit comments

Comments
 (0)