Sha256: 58be5f7fcf0b85a38d135995eb00a748b208940e99fe042cbe933907b3b0a353

Contents?: true

Size: 979 Bytes

Versions: 2

Compression:

Stored size: 979 Bytes

Contents

#!rake
# coding: utf-8

require 'pathname'
require 'English'
require 'pp'

# Project-specific tasks

#####################################################################
###	T A S K S
#####################################################################

MANUAL_PAGES = Pathname.glob( MANUALDIR + '**/*.page' )

task :local => :check_manual

# Check the manual for laika references before committing
Rake::Task[ 'checkin' ].prerequisites.unshift( 'check_manual' )

desc "Check the manual for various problems and/or inconsistencies"
task :check_manual => MANUAL_PAGES do
	MANUAL_PAGES.each do |page|
		lines = page.readlines
		lines.each_with_index do |line, i|
			if line =~ /\blaika\b/i
				msg = [
					'   ',
					i.zero? ? "" : lines[ i - 1 ],
					'   ',
					$PREMATCH,
					colorize( :bold, :yellow ) { $MATCH },
					$POSTMATCH,
					'   ',
					lines[ i + 1 ]
				].join
				abort "Page #{page} has a LAIKA reference on line #{i + 1}:\n#{msg}"
			end
		end
	end
end


Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
treequel-1.0.1 Rakefile.local
treequel-1.0.0 Rakefile.local