Sha256: abc3fc04bb25febdd911b837df8e761c710caf49ed6160eed7b2679066b2ef3a
Contents?: true
Size: 1.2 KB
Versions: 3
Compression:
Stored size: 1.2 KB
Contents
# Author:: Marco Tessari <marco.tessari@epita.fr>. # Copyright:: Copyright (c) 2004, 2005 Uttk team. All rights reserved. # License:: LGPL # $Id: /w/fey/uttk/trunk/lib/uttk/strategies/Authors.rb 22102 2006-02-21T23:03:39.538964Z pouillar $ module Uttk module Strategies # I check whether a student has well written his _AUTHORS_ file. I'm very # specific to the test of Epita's student tarballs. class Authors < Strategy include Concrete 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 attribute :author, 'the author to match', :mandatory attribute :dir, 'the directory where the AUTHORS file is located', :mandatory attribute :file, 'the name of the AUTHORS file, appended to "dir" path', 'AUTHORS' end # class Authors end # module Strategies end # module Uttk
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
uttk-0.3.5.0 | lib/uttk/strategies/Authors.rb |
uttk-0.3.6.1 | lib/uttk/strategies/Authors.rb |
uttk-0.3.1.2 | lib/uttk/strategies/Authors.rb |