Jay McGavren's Journal

2009-01-31

A quick Flay task for Rake...

The only other one I saw posted missed parts of the specified subfolders. So here goes:

begin
	require 'flay'
	desc "Run duplicate code analyzer"
	task :flay do
		output = `flay #{FileList["lib/**/*.rb", "app/**/*.rb"].join(' ')}`
		fail "Error #{$?}: #{output}" unless $? == 0
		puts output
	end
rescue LoadError => exception
	warn "Could not load flay - it might not be installed."
end
comments powered by Disqus