class RBT::CheckForDuplicateBinaries
Constants
- DEFAULT_TARGET_DIRECTORY
#¶ ↑
DEFAULT_TARGET_DIRECTORY
¶ ↑#¶ ↑
Public Class Methods
[](i = ARGV)
click to toggle source
new( commandline_arguments = nil, run_already = true )
click to toggle source
Public Instance Methods
check_on_the_files_of_the_target_directory( all_binaries = RBT.all_binaries? )
click to toggle source
#¶ ↑
check_on_the_files_of_the_target_directory
¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/check_for_duplicate_binaries.rb, line 111 def check_on_the_files_of_the_target_directory( all_binaries = RBT.all_binaries? ) array_all_binaries = RBT.registered_binaries? entries = Dir[target_dir?+'*'] entries.each {|this_file| result = sfile(this_file.ljust(32)) if array_all_binaries.include?(File.basename(this_file)) program_name = all_binaries[File.basename(this_file)] e "#{result} is part of the program `"+ "#{saddlebrown(program_name)}`." # =================================================================== # # Next, we will also check whether there is a duplicate. # =================================================================== # target_for_binary_duplicate = programs_directory?+ program_name.capitalize+'/'+ 'Current/bin/'+program_name if File.exist?(target_for_binary_duplicate) e (' ' * 31)+ crimson('This appears to be a duplicate entry, for the file at') e (' ' * 31)+ crimson('`')+sfancy(target_for_binary_duplicate)+crimson('` exists.') end end } end
reset()
click to toggle source
run()
click to toggle source
set_pwd_as_directory()
click to toggle source
set_target_directory( i = DEFAULT_TARGET_DIRECTORY )
click to toggle source
#¶ ↑
set_target_directory
¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/check_for_duplicate_binaries.rb, line 63 def set_target_directory( i = DEFAULT_TARGET_DIRECTORY ) i = i.join(' ').strip if i.is_a? Array case i # ======================================================================== # # === :pwd # ======================================================================== # when :pwd i = return_pwd # ======================================================================== # # === :default # ======================================================================== # when :default, nil, '' i = DEFAULT_TARGET_DIRECTORY end i = i.dup if i.frozen? i << '/' unless i.end_with? '/' @target_directory = i end
Also aliased as: set_directory, set_dir