Skip to content

Commit

Permalink
[rubygems/rubygems] Don't use util_installer for user install
Browse files Browse the repository at this point in the history
It is not nice to require install directory to be always specified,
while this option is later ignored for user installed gems.

Actually, the next step will be to remove `check_install_dir` check and
let the install dir override the user install.

rubygems/rubygems@beb79e929f
  • Loading branch information
voxik authored and hsbt committed Nov 8, 2023
1 parent d0ad90d commit bd5368f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions test/rubygems/installer_test_case.rb
Expand Up @@ -111,7 +111,7 @@ def util_make_exec(spec = @spec, shebang = "#!/usr/bin/ruby", bindir = "bin")

def setup_base_installer(force = true)
@gem = setup_base_gem
util_installer @spec, @gemhome, false, force
util_installer @spec, @gemhome, force
end

##
Expand Down Expand Up @@ -163,7 +163,7 @@ def setup_base_user_installer

@user_gem = @user_spec.cache_file

util_installer @user_spec, Gem.user_dir, :user
Gem::Installer.at @user_gem, :user_install => true
end

##
Expand Down Expand Up @@ -219,13 +219,11 @@ def util_setup_gem(ui = @ui, force = true)
end

##
# Creates an installer for +spec+ that will install into +gem_home+. If
# +user+ is true a user-install will be performed.
# Creates an installer for +spec+ that will install into +gem_home+.

def util_installer(spec, gem_home, user=false, force=true)
def util_installer(spec, gem_home, force=true)
Gem::Installer.at(spec.cache_file,
:install_dir => gem_home,
:user_install => user,
:force => force)
end

Expand Down

0 comments on commit bd5368f

Please sign in to comment.