aboutsummaryrefslogblamecommitdiffstats
path: root/railties/lib/rails/tasks/statistics.rake
blob: f684e712675d1cdf0f0618a749386d8fe9aeb300 (plain) (tree)
1
2
3
4
5
6
7
8
9
                     
                                         
                                     
                                    
                                     
                              
                                  
                                          
                                         
                                  
                                                                                                      
 

                                                               
                                 
                                             
   
STATS_DIRECTORIES = [
  %w(Controllers        app/controllers),
  %w(Helpers            app/helpers),
  %w(Models             app/models),
  %w(Mailers            app/mailers),
  %w(Libraries          lib/),
  %w(APIs               app/apis),
  %w(Integration\ tests test/integration),
  %w(Functional\ tests  test/functional),
  %w(Unit\ tests        test/unit)
].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