remove_old_bin_files (Gem::Commands::SetupCommand)

    # File lib/rubygems/commands/setup_command.rb, line 301
      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}\n\nabort \"\#{deprecation_message}\"\n"
          end

          next unless Gem.win_platform?

          File.open "#{old_bin_path}.bat", 'w' do |fp|
            fp.puts %{@ECHO.#{deprecation_message}}
          end
        end
      end