class RBT::Cookbooks::CheckIfSourceDirectoriesExist
Constants
- PADDING
#¶ ↑
PADDING
¶ ↑#¶ ↑
Public Class Methods
new( optional_input = nil, run_already = true )
click to toggle source
Public Instance Methods
check_commandline_arguments()
click to toggle source
check_each_entry()
click to toggle source
#¶ ↑
check_each_entry
¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/check_for_existing_source_directories.rb, line 130 def check_each_entry available_programs?.each {|entry| target = source_directory?+File.basename(entry).sub(/\.yml$/,'')+'/' shall_we_check_this_target = false if File.exist? target # ok, the target exists, all may be fine, so we pass through. shall_we_check_this_target = true end # ===================================================================== # # Some entries in the yaml file have a "do_not_download" # entry. In that case we will ignore them. # ===================================================================== # location = individual_cookbooks_directory?+File.basename(entry) if File.exist? location hash = load_this_cookbook(location) # in module_methods.rb unless hash['do_not_download'].nil? end end if shall_we_check_this_target if be_verbose? e 'Target '+sfile(target.ljust(padding?))+' does exist.' end else # does not exist, report register_target_does_not_exist(target) end } end
load_this_cookbook(i)
click to toggle source
padding?()
click to toggle source
register_target_does_not_exist(i)
click to toggle source
report_missing_entries()
click to toggle source
#¶ ↑
report_missing_entries
¶ ↑
Report all missing entries here.
#¶ ↑
# File lib/rbt/utility_scripts/check_for_existing_source_directories.rb, line 99 def report_missing_entries # report them all now. sanitize_targets @array_targets.sort.each {|entry| e sdir(entry.squeeze('/').ljust(PADDING))+' does not exist.' } unless @array_targets.empty? _ = @array_targets.size.to_s # ===================================================================== # # Always report non-existing directories. # ===================================================================== # opn; e "We found #{simp(_)} non-existing directories." end end
reset()
click to toggle source
run()
click to toggle source
sanitize_targets()
click to toggle source
set_commandline_arguments(i = nil)
click to toggle source
show_help(optional_then_exit = false)
click to toggle source