Sha256: 19f89c5ee2d1a43d4ff827d452195662f356b1ab0467b244d48fa8f415880df2

Contents?: true

Size: 985 Bytes

Versions: 6

Compression:

Stored size: 985 Bytes

Contents

module Jsus
  module Util
    module Validator
      # Mooforge validator checks every file for the following:
      #   * Presence of header
      #   * Presence of authors field
      #   * Presence of license field
      class Mooforge < Base
        # Mooforge validator checks every file for the following:
        #   * Presence of header
        #   * Presence of authors field
        #   * Presence of license field
        # @return [Array] list oferrors
        # @api public
        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
      end
    end
  end # Util
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
jsus-0.4.0 lib/jsus/util/validator/mooforge.rb
jsus-0.3.6 lib/jsus/util/validator/mooforge.rb
jsus-0.3.5 lib/jsus/util/validator/mooforge.rb
jsus-0.3.4 lib/jsus/util/validator/mooforge.rb
jsus-0.3.3 lib/jsus/util/validator/mooforge.rb
jsus-0.3.2 lib/jsus/util/validator/mooforge.rb