aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--railties/CHANGELOG2
-rw-r--r--railties/lib/tasks/statistics.rake20
2 files changed, 13 insertions, 9 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG
index 7cdef2b199..d1760e0b59 100644
--- a/railties/CHANGELOG
+++ b/railties/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Make the default stats task extendable by modifying the STATS_DIRECTORIES constant
+
* Allow the selected environment to define RAILS_DEFAULT_LOGGER, and have Rails::Initializer use it if it exists.
* Moved all the shared tasks from Rakefile into Rails, so that the Rakefile is empty and doesn't require updating.
diff --git a/railties/lib/tasks/statistics.rake b/railties/lib/tasks/statistics.rake
index 66b654725b..fccb71b311 100644
--- a/railties/lib/tasks/statistics.rake
+++ b/railties/lib/tasks/statistics.rake
@@ -1,13 +1,15 @@
+STATS_DIRECTORIES = [
+ %w(Helpers app/helpers),
+ %w(Controllers app/controllers),
+ %w(APIs app/apis),
+ %w(Components components),
+ %w(Functionals test/functional),
+ %w(Models app/models),
+ %w(Units test/unit)
+]
+
desc "Report code statistics (KLOCs, etc) from the application"
task :stats do
require 'code_statistics'
- CodeStatistics.new(
- ["Helpers", "app/helpers"],
- ["Controllers", "app/controllers"],
- ["APIs", "app/apis"],
- ["Components", "components"],
- ["Functionals", "test/functional"],
- ["Models", "app/models"],
- ["Units", "test/unit"]
- ).to_s
+ CodeStatistics.new(*STATS_DIRECTORIES).to_s
end