class RBT::Cookbooks::ReportUselessDescriptions
Constants
- ALSO_OPEN_VIA_EDITOR
#¶ ↑
ALSO_OPEN_VIA_EDITOR
¶ ↑#¶ ↑
- DEFAULT_DESCRIPTION_OF_THE_PROGRAM
#¶ ↑
DEFAULT_DESCRIPTION_OF_THE_PROGRAM
¶ ↑#¶ ↑
- NAMESPACE
#¶ ↑
NAMESPACE
¶ ↑#¶ ↑
- SLEEP_FOR_THIS_AMOUNT
#¶ ↑
SLEEP_FOR_THIS_AMOUNT
¶ ↑#¶ ↑
Public Class Methods
[](i = '')
click to toggle source
Public Instance Methods
do_not_open_files_in_the_editor()
click to toggle source
input?()
click to toggle source
iterate_over_every_available_program()
click to toggle source
#¶ ↑
iterate_over_every_available_program
¶ ↑
#¶ ↑
# File lib/rbt/validation/report_useless_descriptions.rb, line 132 def iterate_over_every_available_program @available_programs.each {|this_program| _ = individual_cookbooks_dir?+this_program+'.yml' dataset = YAML.load_file(_)[this_program] if dataset.nil? this_program_is_problematic(this_program) else description = dataset['description'] # =================================================================== # # Nil descriptions or empty descriptions will be reported. # =================================================================== # if description.nil? or description.strip.empty? this_program_is_problematic(this_program) # =================================================================== # # As will those programs that conform to a default, but # =================================================================== # # pretty useless, description. elsif description.strip == DEFAULT_DESCRIPTION_OF_THE_PROGRAM this_program_is_problematic(this_program) else # Else all seems fine. end end } end
obtain_available_programs()
click to toggle source
report_results()
click to toggle source
#¶ ↑
report_results
(report tag)¶ ↑
#¶ ↑
# File lib/rbt/validation/report_useless_descriptions.rb, line 174 def report_results _ = @array_these_programs_are_problematic opnn; e "A total of #{sfancy(_.size.to_s)} problematic "\ "descriptions were found." if _.empty? opnn; e 'This is '+lightgreen('excellent')+'! All programs '\ 'appear to have a useful description.' else e _.each {|this_program| e ' - '+simp(this_program) if @also_open_via_editor open_in_editor this_program sleep SLEEP_FOR_THIS_AMOUNT end } e end end
Also aliased as: report
reset()
click to toggle source
#¶ ↑
reset (reset tag)¶ ↑
#¶ ↑
Calls superclass method
RBT::Base#reset
# File lib/rbt/validation/report_useless_descriptions.rb, line 75 def reset super() @namespace = NAMESPACE # ======================================================================= # # Store the problematic programs in the following Array: # ======================================================================= # @array_these_programs_are_problematic = [] @also_open_via_editor = ALSO_OPEN_VIA_EDITOR end
run()
click to toggle source
set_input( i = '' )
click to toggle source