class RBT::Cookbooks::ReportMissingLicenceEntries

Public Class Methods

new( run_already = true ) click to toggle source
#

initialize

#
# File lib/rbt/checks_and_validations/report_missing_licence_entries.rb, line 27
def initialize(
    run_already = true
  )
  reset
  case run_already
  when :do_not_run_yet
    run_already = false
  end
  run if run_already
end

Public Instance Methods

menu(i) click to toggle source
#

menu

#
report_this_program_has_a_missing_licence_entry(i) click to toggle source
#

report_this_program_has_a_missing_licence_entry

#
# File lib/rbt/checks_and_validations/report_missing_licence_entries.rb, line 76
def report_this_program_has_a_missing_licence_entry(i)
  e "  #{orange(i)} has no #{steelblue('licence')} entry."
end
report_this_program_has_no_complete_licence_entry(i) click to toggle source
#

report_this_program_has_no_complete_licence_entry

#
# File lib/rbt/checks_and_validations/report_missing_licence_entries.rb, line 83
def report_this_program_has_no_complete_licence_entry(i)
  e steelblue(i.ljust(30))+
    ' has an incomplete/missing licence entry.'
end
reset() click to toggle source
#

reset

#
Calls superclass method RBT::Base#reset
# File lib/rbt/checks_and_validations/report_missing_licence_entries.rb, line 41
def reset
  super()
  infer_the_namespace
end
run() click to toggle source
#

run (run tag)

#
# File lib/rbt/checks_and_validations/report_missing_licence_entries.rb, line 91
def run
  all_available_programs?.each {|this_program|
    _ = nil
    if does_this_expanded_cookbook_file_exist_for_this_program? this_program
      dataset = load_dataset_from_this_expanded_cookbook(this_program)
    else # else load from the default cookbook directory.
      dataset = load_yaml_file_from_the_cookbook_directory_for_this_program(this_program)
    end
    if dataset.has_key? this_program
      dataset = dataset[this_program]
    end
    the_licence = dataset['licence'.to_sym]
    if dataset.has_key? 'licence'.to_sym
      if the_licence == 'unknown'
        report_this_program_has_no_complete_licence_entry(this_program)
      end
    else
      report_this_program_has_a_missing_licence_entry(this_program)
    end
  }
end
show_help() click to toggle source
#

show_help (help tag)

#
# File lib/rbt/checks_and_validations/report_missing_licence_entries.rb, line 49
def show_help
  e
  e 'Currently no help options are documented for this class.'
  e
end