method
remove_old_lib_files
Ruby latest stable (v2_5_5)
-
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
- 1_9_3_392
- 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_lib_files(lib_dir)
public
Hide source
# File lib/rubygems/commands/setup_command.rb, line 512 def remove_old_lib_files lib_dir lib_dirs = { File.join(lib_dir, 'rubygems') => 'lib/rubygems' } lib_dirs[File.join(lib_dir, 'bundler')] = 'bundler/lib/bundler' if Gem::USE_BUNDLER_FOR_GEMDEPS lib_dirs.each do |old_lib_dir, new_lib_dir| lib_files = rb_files_in(new_lib_dir) lib_files.concat(template_files_in(new_lib_dir)) if new_lib_dir =~ /bundler/ old_lib_files = rb_files_in(old_lib_dir) old_lib_files.concat(template_files_in(old_lib_dir)) if old_lib_dir =~ /bundler/ to_remove = old_lib_files - lib_files to_remove.delete_if do |file| file.start_with? 'defaults' end Dir.chdir old_lib_dir do to_remove.each do |file| FileUtils.rm_f file warn "unable to remove old file #{file} please remove it by hand" if File.exist? file end end end end