2005-09-05 11:39:20 -04:00
|
|
|
STATS_DIRECTORIES = [
|
2006-10-26 21:26:11 -04:00
|
|
|
%w(Controllers app/controllers),
|
2006-02-28 13:57:32 -05:00
|
|
|
%w(Helpers app/helpers),
|
2006-10-26 21:26:11 -04:00
|
|
|
%w(Models app/models),
|
|
|
|
%w(Libraries lib/),
|
2006-02-28 13:57:32 -05:00
|
|
|
%w(APIs app/apis),
|
2006-10-26 21:26:11 -04:00
|
|
|
%w(Integration\ tests test/integration),
|
2006-02-28 13:57:32 -05:00
|
|
|
%w(Functional\ tests test/functional),
|
2006-10-26 21:26:11 -04:00
|
|
|
%w(Unit\ tests test/unit)
|
|
|
|
|
2005-09-13 14:43:23 -04:00
|
|
|
].collect { |name, dir| [ name, "#{RAILS_ROOT}/#{dir}" ] }.select { |name, dir| File.directory?(dir) }
|
2005-09-05 11:39:20 -04:00
|
|
|
|
2005-09-03 11:13:06 -04:00
|
|
|
desc "Report code statistics (KLOCs, etc) from the application"
|
|
|
|
task :stats do
|
|
|
|
require 'code_statistics'
|
2005-09-05 11:39:20 -04:00
|
|
|
CodeStatistics.new(*STATS_DIRECTORIES).to_s
|
2005-09-03 11:13:06 -04:00
|
|
|
end
|