diff options
author | Andriy Tyurnikov <Andriy.Tyurnikov@gmail.com> | 2014-05-23 23:28:06 +0300 |
---|---|---|
committer | Andriy Tyurnikov <Andriy.Tyurnikov@gmail.com> | 2014-05-24 20:48:24 +0300 |
commit | b71f5f4f55f50bf215a650c0555f6603a3bed84b (patch) | |
tree | c2e84dc0bb137eb26522ca70c4f78f954fde8388 /railties/lib/rails/tasks | |
parent | a6f55fe257512731d7f3f41976648d99e9ec95be (diff) | |
download | rails-b71f5f4f55f50bf215a650c0555f6603a3bed84b.tar.gz rails-b71f5f4f55f50bf215a650c0555f6603a3bed84b.tar.bz2 rails-b71f5f4f55f50bf215a650c0555f6603a3bed84b.zip |
rake stats for engines
Diffstat (limited to 'railties/lib/rails/tasks')
-rw-r--r-- | railties/lib/rails/tasks/statistics.rake | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/railties/lib/rails/tasks/statistics.rake b/railties/lib/rails/tasks/statistics.rake index c1674c72ad..019aaf9add 100644 --- a/railties/lib/rails/tasks/statistics.rake +++ b/railties/lib/rails/tasks/statistics.rake @@ -1,22 +1,23 @@ -STATS_DIRECTORIES = [ - %w(Controllers app/controllers), - %w(Helpers app/helpers), - %w(Models app/models), - %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) -].collect { |name, dir| [ name, "#{Rails.root}/#{dir}" ] }.select { |name, dir| File.directory?(dir) } - -desc "Report code statistics (KLOCs, etc) from the application" +desc "Report code statistics (KLOCs, etc) from the application or engine" task :stats do require 'rails/code_statistics' + + STATS_DIRECTORIES = [ + %w(Controllers app/controllers), + %w(Helpers app/helpers), + %w(Models app/models), + %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) + ].collect { |name, dir| [ name, "#{defined?(ENGINE_PATH)? ENGINE_PATH : Rails.root}/#{dir}" ] }.select { |name, dir| File.directory?(dir) } + CodeStatistics.new(*STATS_DIRECTORIES).to_s -end +end
\ No newline at end of file |