rails--rails/railties/lib/rails/tasks/statistics.rake

23 lines
852 B
Ruby
Raw Normal View History

STATS_DIRECTORIES = [
%w(Controllers app/controllers),
2009-10-17 00:40:59 +00:00
%w(Helpers app/helpers),
%w(Models app/models),
2012-01-16 05:53:23 +00:00
%w(Mailers app/mailers),
%w(Javascripts app/assets/javascripts),
%w(Libraries lib/),
%w(APIs app/apis),
%w(Controller\ tests test/controllers),
%w(Helper\ tests test/helpers),
%w(Model\ tests test/models),
%w(Mailer\ tests test/mailers),
%w(Integration\ tests test/integration),
%w(Functional\ tests\ (old) test/functional),
%w(Unit\ tests \ (old) test/unit)
2009-10-17 00:40:59 +00: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 'rails/code_statistics'
CodeStatistics.new(*STATS_DIRECTORIES).to_s
end