class Cookbooks::FindMultipleVersions
Constants
- ARRAY_IGNORE_THESE_DIRECTORIES
#¶ ↑
ARRAY_IGNORE_THESE_DIRECTORIES¶ ↑
These directories will be ignored.
#¶ ↑
- LOCATION
#¶ ↑
LOCATION¶ ↑
#¶ ↑
- NAMESPACE
#¶ ↑
NAMESPACE¶ ↑
#¶ ↑
Public Class Methods
Public Instance Methods
find_all_directories_with_more_than_one_program()
click to toggle source
#¶ ↑
#find_all_directories_with_more_than_one_program¶ ↑
#¶ ↑
# File lib/cookbooks/utility_scripts/find_multiple_versions.rb, line 65 def find_all_directories_with_more_than_one_program result = Dir[LOCATION+'*'].reject {|entry| !File.directory? entry} # ======================================================================= # # Next, we have to filter out entries that we do not want to have. # ======================================================================= # unless ARRAY_IGNORE_THESE_DIRECTORIES.empty? result.reject! {|entry| ARRAY_IGNORE_THESE_DIRECTORIES.include? File.basename(entry) } end result.sort! # Keep it sorted alphabetically. result.map! {|entry| (entry << '/').squeeze('/') } return result end
Also aliased as: all_dirs?
opnn()
click to toggle source
reset()
click to toggle source
run()
click to toggle source
seek_and_report_directories_with_more_than_one_entry()
click to toggle source
#¶ ↑
#seek_and_report_directories_with_more_than_one_entry¶ ↑
#¶ ↑
# File lib/cookbooks/utility_scripts/find_multiple_versions.rb, line 83 def seek_and_report_directories_with_more_than_one_entry counter = 0 all_dirs?.each {|dir| _ = Dir[dir+'*'] if _.size > 1 counter += 1 opnn; e '('+sfancy(counter.to_s)+') The directory at `'+sdir(dir)+ '` has more than one entry.' pp _ e end } end