]> cat aescling's git repositories - mastodon.git/commitdiff
add task to report code statistics (#2489)
authoryhirano <yhirano@me.com>
Wed, 26 Apr 2017 16:47:22 +0000 (01:47 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Wed, 26 Apr 2017 16:47:22 +0000 (18:47 +0200)
lib/tasks/statistics.rake [new file with mode: 0644]

diff --git a/lib/tasks/statistics.rake b/lib/tasks/statistics.rake
new file mode 100644 (file)
index 0000000..82f2b54
--- /dev/null
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+task stats: 'mastodon:stats'
+
+namespace :mastodon do
+  desc 'Report code statistics (KLOCs, etc)'
+  task :stats do
+    require 'rails/code_statistics'
+    [
+      %w(App\ Libraries app/lib),
+      %w(Presenters app/presenters),
+      %w(Services app/services),
+      %w(Validators app/validators),
+      %w(Workers app/workers),
+    ].each do |name, dir|
+      ::STATS_DIRECTORIES << [name, Rails.root.join(dir)]
+    end
+  end
+end