End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Gem::Commands::SetupCommand#remove_old_bin_files
remove_old_bin_files(bin_dir)
lib/rubygems/commands/setup_command.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/lib/rubygems/commands/setup_command.rb, line 494
def remove_old_bin_files(bin_dir)
old_bin_files = {
'gem_mirror' => 'gem mirror',
'gem_server' => 'gem server',
'gemlock' => 'gem lock',
'gemri' => 'ri',
'gemwhich' => 'gem which',
'index_gem_repository.rb' => 'gem generate_index',
}
old_bin_files.each do |old_bin_file, new_name|
old_bin_path = File.join bin_dir, old_bin_file
next unless File.exist? old_bin_path
deprecation_message = "`#{old_bin_file}` has been deprecated. Use `#{new_name}` instead."
File.open old_bin_path, 'w' do |fp|
fp.write <<-EOF
#!#{Gem.ruby}
abort "#{deprecation_message}"
EOF
end
next unless Gem.win_platform?
File.open "#{old_bin_path}.bat", 'w' do |fp|
fp.puts %(@ECHO.#{deprecation_message})
end
end
end
No documentation available
See also
#remove_file_list
#remove_old_lib_files
#regenerate_plugins
#remove_old_man_files
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1