Class: Jsus::Util::Validator::Mooforge
- Defined in:
- lib/jsus/util/validator/mooforge.rb
Overview
Mooforge validator checks every file for the following:
- Presence of header
- Presence of authors field
- Presence of license field
Instance Method Summary collapse
-
#validation_errors ⇒ Array
Mooforge validator checks every file for the following: * Presence of header * Presence of authors field * Presence of license field.
Methods inherited from Base
#initialize, #validate, validate
Methods included from Mixins::OperatesOnSources
Constructor Details
This class inherits a constructor from Jsus::Util::Validator::Base
Instance Method Details
#validation_errors ⇒ Array
Mooforge validator checks every file for the following:
- Presence of header
- Presence of authors field
- Presence of license field
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/jsus/util/validator/mooforge.rb', line 15 def validation_errors @validation_errors ||= sources.inject([]) do |result, sf| if !sf.header result << "#{sf.filename} is missing header" elsif !sf.header["authors"] result << "#{sf.filename} is missing authors" elsif !sf.header["license"] result << "#{sf.filename} is missing license" else result end end end |