class RBT::Cookbooks::ValidateArchiveSize
Public Class Methods
[](i = ARGV)
click to toggle source
new( commandline_arguments = ARGV, run_already = true )
click to toggle source
Public Instance Methods
notify_the_user_if_any_problematic_archive_was_discovered()
click to toggle source
#¶ ↑
notify_the_user_if_any_problematic_archive_was_discovered
¶ ↑
#¶ ↑
# File lib/rbt/checks_and_validations/validate_archive_size.rb, line 83 def notify_the_user_if_any_problematic_archive_was_discovered if @n_problematic_archives_were_found > 0 e e 'A total of '+steelblue(@n_problematic_archives_were_found.to_s)+ ' programs was found.' e end end
reset()
click to toggle source
#¶ ↑
reset (reset tag)¶ ↑
#¶ ↑
Calls superclass method
RBT::Base#reset
# File lib/rbt/checks_and_validations/validate_archive_size.rb, line 43 def reset super() infer_the_namespace # ======================================================================= # # === @n_problematic_archives_were_found # ======================================================================= # @n_problematic_archives_were_found = 0 end
run()
click to toggle source
#¶ ↑
run (run tag)¶ ↑
#¶ ↑
# File lib/rbt/checks_and_validations/validate_archive_size.rb, line 95 def run menu(commandline_arguments?) target = "#{directory_expanded_cookbooks?}*.yml" opnn { :no_colon }; e; e Dir[target].each {|this_yaml_file| dataset = File.read(this_yaml_file) archive_size_is = dataset.scan( /archive_size: (\d{1,15})/ ).flatten.first.to_i if archive_size_is == 0 @n_problematic_archives_were_found += 1 e 'The archive at '+sfile(this_yaml_file)+ ' is problematic: size of 0.' end } notify_the_user_if_any_problematic_archive_was_discovered end