class Cookbooks::CheckForInclusion
Constants
- ARRAY_WITH_EXCEPTIONS
#¶ ↑
ARRAY_WITH_EXCEPTIONS¶ ↑
The following Array has a list of exceptions.
#¶ ↑
- DEFAULT_FILE
#¶ ↑
DEFAULT_FILE¶ ↑
Where to store our results. A .md markdown file may seem appropriate.
#¶ ↑
- NAMESPACE
#¶ ↑
NAMESPACE¶ ↑
#¶ ↑
Public Class Methods
Public Instance Methods
check_each_file_whether_it_is_included()
click to toggle source
#¶ ↑
#check_each_file_whether_it_is_included¶ ↑
Here we report only if @be_verbose is true. (3)
#¶ ↑
# File lib/cookbooks/utility_scripts/check_for_inclusion.rb, line 84 def check_each_file_whether_it_is_included @all_files.each { |file_long_name, file_short_name| unless ARRAY_WITH_EXCEPTIONS.empty? dirname = File.dirname(file_long_name)+'/' next if ARRAY_WITH_EXCEPTIONS.include?(dirname) end if file_short_name.nil? file_short_name = ProgramInformation.return_real_name( File.basename(file_long_name) ).downcase opnn; e 'Now scanning for the program `'+sfile(file_short_name)+'`.' end # ===================================================================== # # If it is included then everything is fine. # ===================================================================== # if is_included?(file_short_name) # f '`'+file_long_name+'` is included.' if @be_verbose # Be silent here. else # Else it is not included. if be_verbose? opnn; ewarn '`'+simp(file_long_name)+swarn('` is not included.') end @array_files_which_were_not_found << file_long_name end } end
is_included?(i)
click to toggle source
opnn()
click to toggle source
report_to_user_which_files_are_not_included()
click to toggle source
reset()
click to toggle source
run()
click to toggle source
run_everything()
click to toggle source
scan_for_all_files()
click to toggle source
#¶ ↑
#scan_for_all_files¶ ↑
Scan for all files and fill up the array @all_files
#¶ ↑
# File lib/cookbooks/utility_scripts/check_for_inclusion.rb, line 72 def scan_for_all_files _ = @base_dir+'*/**' opnn; e 'Scanning for all files in directory `'+sdir(_)+'` now.' opnn; e 'Be patient, this may take a while.' @all_files = Dir[_] end
store_results_to_file( what = @array_files_which_were_not_found, where_to = DEFAULT_FILE )
click to toggle source
#¶ ↑
#store_results_to_file¶ ↑
#¶ ↑
# File lib/cookbooks/utility_scripts/check_for_inclusion.rb, line 138 def store_results_to_file( what = @array_files_which_were_not_found, where_to = DEFAULT_FILE ) remove_file(where_to) # Delete the old file first, before appending into a new one. @array_files_which_were_not_found.each { |f| append_what_into(f+N, where_to) } e 'Stored into:' e sfancy(' '+DEFAULT_FILE) end