2007-01-22 14:43:50 +01:00
|
|
|
STATS_DIRECTORIES = [
|
2007-02-09 09:04:31 +01:00
|
|
|
%w(Controllers app/controllers),
|
2007-01-22 14:43:50 +01:00
|
|
|
%w(Helpers app/helpers),
|
2007-02-09 09:04:31 +01:00
|
|
|
%w(Models app/models),
|
|
|
|
%w(Libraries lib/),
|
2007-01-22 14:43:50 +01:00
|
|
|
%w(APIs app/apis),
|
2007-02-09 09:04:31 +01:00
|
|
|
%w(Integration\ tests test/integration),
|
2007-01-22 14:43:50 +01:00
|
|
|
%w(Functional\ tests test/functional),
|
2007-02-09 09:04:31 +01:00
|
|
|
%w(Unit\ tests test/unit)
|
|
|
|
|
2007-01-22 14:43:50 +01:00
|
|
|
].collect { |name, dir| [ name, "#{RAILS_ROOT}/#{dir}" ] }.select { |name, dir| File.directory?(dir) }
|
|
|
|
|
|
|
|
desc "Report code statistics (KLOCs, etc) from the application"
|
|
|
|
task :stats do
|
|
|
|
require 'code_statistics'
|
|
|
|
CodeStatistics.new(*STATS_DIRECTORIES).to_s
|
|
|
|
end
|