2005-09-05 11:39:20 -04:00
|
|
|
STATS_DIRECTORIES = [
|
2006-02-28 13:57:32 -05:00
|
|
|
%w(Helpers app/helpers),
|
|
|
|
%w(Controllers app/controllers),
|
|
|
|
%w(APIs app/apis),
|
|
|
|
%w(Components components),
|
|
|
|
%w(Functional\ tests test/functional),
|
|
|
|
%w(Models app/models),
|
|
|
|
%w(Unit\ tests test/unit),
|
|
|
|
%w(Libraries lib/),
|
|
|
|
%w(Integration\ tests test/integration)
|
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
|