[ruby/rubygems] Extract and generate only bundler bin files instead of full installation.

https://github.com/ruby/rubygems/commit/a70e573973
This commit is contained in:
Hiroshi SHIBATA 2025-12-08 15:33:54 +09:00 committed by git
parent 55ea3ec00f
commit ca8630b636
2 changed files with 8 additions and 2 deletions

View File

@ -402,8 +402,10 @@ By default, this RubyGems will install gem as:
install_dir: default_dir,
wrappers: true
)
installer.install
File.delete installer.spec_file
# We need to install only executable and default spec files.
# lib/bundler.rb and lib/bundler/* are available under the site_ruby directory.
installer.extract_bin
installer.generate_bin
installer.write_default_spec
ensure
FileUtils.rm_f built_gem

View File

@ -31,6 +31,7 @@ class TestGemCommandsSetupCommand < Gem::TestCase
gemspec = util_spec "bundler", "9.9.9" do |s|
s.bindir = "exe"
s.executables = ["bundle", "bundler"]
s.files = ["lib/bundler.rb"]
end
File.open "bundler/bundler.gemspec", "w" do |io|
@ -222,6 +223,9 @@ class TestGemCommandsSetupCommand < Gem::TestCase
assert_path_exist "#{Gem.dir}/gems/bundler-#{bundler_version}"
assert_path_exist "#{Gem.dir}/gems/bundler-audit-1.0.0"
assert_path_exist "#{Gem.dir}/gems/bundler-#{bundler_version}/exe/bundle"
assert_path_not_exist "#{Gem.dir}/gems/bundler-#{bundler_version}/lib/bundler.rb"
end
def test_install_default_bundler_gem_with_default_gems_not_installed_at_default_dir