method
remove_old_bin_files
v2_2_9 -
Show latest stable
-
0 notes -
Class: SetupCommand
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125 (0)
- 1_9_3_392 (0)
- 2_1_10 (0)
- 2_2_9 (0)
- 2_4_6 (0)
- 2_5_5 (0)
- 2_6_3 (0)
- What's this?
remove_old_bin_files(bin_dir)
public
Hide source
# File lib/rubygems/commands/setup_command.rb, line 385 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 #!#{Gem.ruby}abort "#{deprecation_message}" end next unless Gem.win_platform? File.open "#{old_bin_path}.bat", 'w' do |fp| fp.puts %{@ECHO.#{deprecation_message}} end end end