mirror of https://github.com/mastodon/mastodon
Replace deprecated `STATS_DIRECTORIES` with `Rails::CodeStatistics.register_directory` approach (#33445)
This commit is contained in:
parent
02fe176fd4
commit
af7d6e59af
|
@ -0,0 +1,13 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
[
|
||||
%w(AppLibs app/lib),
|
||||
%w(Policies app/policies),
|
||||
%w(Presenters app/presenters),
|
||||
%w(Serializers app/serializers),
|
||||
%w(Services app/services),
|
||||
%w(Validators app/validators),
|
||||
%w(Workers app/workers),
|
||||
].each do |name, directory|
|
||||
Rails::CodeStatistics.register_directory(name.titleize, directory)
|
||||
end
|
|
@ -1,21 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
task stats: 'mastodon:stats'
|
||||
|
||||
namespace :mastodon do
|
||||
desc 'Report code statistics (KLOCs, etc)'
|
||||
task :stats do
|
||||
require 'rails/code_statistics'
|
||||
[
|
||||
['App Libraries', 'app/lib'],
|
||||
%w(Presenters app/presenters),
|
||||
%w(Policies app/policies),
|
||||
%w(Serializers app/serializers),
|
||||
%w(Services app/services),
|
||||
%w(Validators app/validators),
|
||||
%w(Workers app/workers),
|
||||
].each do |name, dir|
|
||||
STATS_DIRECTORIES << [name, dir]
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue