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_commandline_arguments
¶ ↑
#¶ ↑
# File lib/rbt/cookbooks/check_for_existing_source_directories.rb, line 83 def check_commandline_arguments case first_argument? # case tag # ======================================================================= # # === --help # ======================================================================= # when /^-?-?help$/i show_help_then_exit end end
check_each_entry()
click to toggle source
#¶ ↑
check_each_entry
¶ ↑
#¶ ↑
# File lib/rbt/cookbooks/check_for_existing_source_directories.rb, line 149 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/cookbooks/check_for_existing_source_directories.rb, line 105 def report_missing_entries # report them all now. sanitize_targets # ======================================================================= # # Next display all found targets: # ======================================================================= # e @array_targets.sort.each {|entry| e " #{sdir(entry.squeeze('/').ljust(PADDING))} #{rev}does "\ "#{tomato('not')} #{rev}exist." } e unless @array_targets.empty? _ = @array_targets.size.to_s # ===================================================================== # # Always report non-existing directories. # ===================================================================== # opne "#{simp(_)} #{rev}non-existing directories were found." end end
reset()
click to toggle source
#¶ ↑
reset¶ ↑
#¶ ↑
Calls superclass method
RBT::LeanPrototype#reset
# File lib/rbt/cookbooks/check_for_existing_source_directories.rb, line 46 def reset super() # ======================================================================= # # === @array_targets # ======================================================================= # @array_targets = [] # ======================================================================= # # === :be_verbose # ======================================================================= # set_do_not_be_verbose # if true then we will also report directories that exist. end
run()
click to toggle source
sanitize_targets()
click to toggle source
show_help( optional_then_exit = false )
click to toggle source
#¶ ↑
show_help
¶ ↑
#¶ ↑
# File lib/rbt/cookbooks/check_for_existing_source_directories.rb, line 68 def show_help( optional_then_exit = false ) begin require 'class_docu_shower' rescue LoadError; end if Object.const_defined? :ClassDocuShower ClassDocuShower.new(__FILE__) end exit if optional_then_exit end