aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2005-09-05 15:39:20 +0000
committerJamis Buck <jamis@37signals.com>2005-09-05 15:39:20 +0000
commitb70e2db64af856b46571c66877762837a0f3a95a (patch)
tree6f96009e39b0cf482dfc4d57a98fbf2bd27819da /railties
parent9eef247339c1cc08de7be3d9f7ac9048cb62adcc (diff)
downloadrails-b70e2db64af856b46571c66877762837a0f3a95a.tar.gz
rails-b70e2db64af856b46571c66877762837a0f3a95a.tar.bz2
rails-b70e2db64af856b46571c66877762837a0f3a95a.zip
Make the default stats task extendable by modifying the STATS_DIRECTORIES constant
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2135 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties')
-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