instiki/vendor/rails/railties/lib/tasks/statistics.rake

18 lines
588 B
Ruby
Raw Normal View History

2007-01-22 14:43:50 +01:00
STATS_DIRECTORIES = [
%w(Controllers app/controllers),
2007-01-22 14:43:50 +01:00
%w(Helpers app/helpers),
%w(Models app/models),
%w(Libraries lib/),
2007-01-22 14:43:50 +01:00
%w(APIs app/apis),
%w(Integration\ tests test/integration),
2007-01-22 14:43:50 +01:00
%w(Functional\ tests test/functional),
%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