Skip to content

Instantly share code, notes, and snippets.

@teeparham
Created November 9, 2018 18:17
Show Gist options
  • Save teeparham/4a1b9b2eb47ea1f4b1f5f76dee4aefdd to your computer and use it in GitHub Desktop.
Save teeparham/4a1b9b2eb47ea1f4b1f5f76dee4aefdd to your computer and use it in GitHub Desktop.
Add directories to rake stats
# lib/stats.rake
require "rails/code_statistics"
task stats: :more_stats
task :more_stats do
%w[Forms Policies Presenters Serializers Services].each_with_index do |type, i|
STATS_DIRECTORIES.insert i + 5, [type, "app/#{type.downcase}"]
STATS_DIRECTORIES.insert i * 2 + 13, ["#{type} tests", "test/#{type.downcase}"]
CodeStatistics::TEST_TYPES << "#{type} tests"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment