Class: Jsus::Util::Validator::Mooforge

Inherits:
Base
  • Object
show all
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

Methods inherited from Base

#initialize, #validate, validate

Methods included from Mixins::OperatesOnSources

#source_files, #source_files=

Constructor Details

This class inherits a constructor from Jsus::Util::Validator::Base

Instance Method Details

#validation_errorsArray

Mooforge validator checks every file for the following:

  • Presence of header
  • Presence of authors field
  • Presence of license field

Returns:

  • (Array)

    list oferrors



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