class RBT::Cookbooks::CheckForInclusion
Constants
- ARRAY_WITH_EXCEPTIONS
#¶ ↑
ARRAY_WITH_EXCEPTIONS
¶ ↑The following Array has a list of exceptions. If you wish to skip entries then simply add them here.
#¶ ↑
- DEFAULT_FILE
#¶ ↑
DEFAULT_FILE
¶ ↑Where to store our results. A .md markdown file may seem appropriate.
#¶ ↑
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/rbt/cookbooks/check_for_inclusion/check_for_inclusion.rb, line 103 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 file_short_name = ProgramInformation.return_real_name( File.basename(file_long_name) ) file_short_name.downcase! if file_short_name e "#{rev}Now #{steelblue('scanning')} #{rev}for the "\ "program `#{sfile(file_short_name)}#{rev}`." # ===================================================================== # # 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? opnwarn '`'+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
report_to_user_which_files_are_not_included()
click to toggle source
#¶ ↑
report_to_user_which_files_are_not_included
¶ ↑
#¶ ↑
# File lib/rbt/cookbooks/check_for_inclusion/check_for_inclusion.rb, line 145 def report_to_user_which_files_are_not_included e sfancy('These files were not found:') e cliner { @array_files_which_were_not_found.each {|entry| e steelblue(" #{entry}") } } e end
reset()
click to toggle source
#¶ ↑
reset¶ ↑
#¶ ↑
Calls superclass method
RBT::LeanPrototype#reset
# File lib/rbt/cookbooks/check_for_inclusion/check_for_inclusion.rb, line 60 def reset super() infer_the_namespace # ======================================================================= # # === @base_dir # ======================================================================= # @base_dir = source_directory? # ======================================================================= # # === @array_files_which_were_not_found # ======================================================================= # @array_files_which_were_not_found = [] # ======================================================================= # # === @all_files # ======================================================================= # @all_files = [] # ======================================================================= # # === :be_verbose # ======================================================================= # set_be_verbose # ======================================================================= # # === @query # ======================================================================= # @query = action(:SanitizeCookbook, :do_not_run_yet) { :fast } end
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/rbt/cookbooks/check_for_inclusion/check_for_inclusion.rb, line 90 def scan_for_all_files _ = @base_dir+'*/**' opne 'Scanning for all files in directory `'+sdir(_)+rev+ '` now.' opne 'Be patient, this may take a while.' @all_files = Dir[_].sort 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/rbt/cookbooks/check_for_inclusion/check_for_inclusion.rb, line 159 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(" #{where_to}") end