Class Uttk::Strategies::Authors
In: lib/uttk/strategies/Authors.rb
Parent: Strategy

I check whether a student has well written his AUTHORS file. I‘m very specific to the test of Epita‘s student tarballs.

Methods

run_impl  

Included Modules

Concrete

Public Instance methods

[Source]

# File lib/uttk/strategies/Authors.rb, line 16
      def run_impl
        author = "#{@dir}/#{@file}"

        unless File.exists?(author)
          fail "No '#{author}' file found"
        end

        authors = []
        IO.foreach(author) do |line|
          authors << $1 if line =~ /^\* ([-a-z]{1,6}_[-_a-zA-Z\d]).*$/
        end

        unless authors.include?(@author)
          fail "AUTHORS not well formatted"
        end

        pass
      end

[Validate]