Sha256: 17c0aea14c60addf3445d49c170c31673382077f896709a66d8692515aefecc2

Contents?: true

Size: 1.38 KB

Versions: 53

Compression:

Stored size: 1.38 KB

Contents

# frozen_string_literal: true

# While global constants are bad, many 3rd party tools depend on this one (e.g
# rspec-rails & cucumber-rails). So a deprecation warning is needed if we want
# to remove it.
STATS_DIRECTORIES ||= [
  %w(Controllers        app/controllers),
  %w(Helpers            app/helpers),
  %w(Jobs               app/jobs),
  %w(Models             app/models),
  %w(Mailers            app/mailers),
  %w(Mailboxes          app/mailboxes),
  %w(Channels           app/channels),
  %w(Views              app/views),
  %w(JavaScripts        app/assets/javascripts),
  %w(Stylesheets        app/assets/stylesheets),
  %w(JavaScript         app/javascript),
  %w(Libraries          lib/),
  %w(APIs               app/apis),
  %w(Controller\ tests  test/controllers),
  %w(Helper\ tests      test/helpers),
  %w(Job\ tests         test/jobs),
  %w(Model\ tests       test/models),
  %w(Mailer\ tests      test/mailers),
  %w(Mailbox\ tests     test/mailboxes),
  %w(Channel\ tests     test/channels),
  %w(Integration\ tests test/integration),
  %w(System\ tests      test/system),
].collect do |name, dir|
  [ name, "#{File.dirname(Rake.application.rakefile_location)}/#{dir}" ]
end.select { |name, dir| File.directory?(dir) }

desc "Report code statistics (KLOCs, etc) from the application or engine"
task :stats do
  require "rails/code_statistics"
  CodeStatistics.new(*STATS_DIRECTORIES).to_s
end

Version data entries

53 entries across 51 versions & 5 rubygems

Version Path
railties-7.0.8.7 lib/rails/tasks/statistics.rake
railties-7.0.8.6 lib/rails/tasks/statistics.rake
railties-7.0.8.5 lib/rails/tasks/statistics.rake
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/railties-7.0.8.4/lib/rails/tasks/statistics.rake
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/railties-7.0.5.1/lib/rails/tasks/statistics.rake
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/railties-7.0.5.1/lib/rails/tasks/statistics.rake
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/railties-7.0.5.1/lib/rails/tasks/statistics.rake
railties-7.0.8.4 lib/rails/tasks/statistics.rake
jets-5.0.13 lib/jets/tasks/statistics.rake
jets-5.0.12 lib/jets/tasks/statistics.rake
jets-5.0.11 lib/jets/tasks/statistics.rake
railties-7.0.8.1 lib/rails/tasks/statistics.rake
jets-5.0.10 lib/jets/tasks/statistics.rake
jets-5.0.9 lib/jets/tasks/statistics.rake
jets-5.0.8 lib/jets/tasks/statistics.rake
jets-5.0.7 lib/jets/tasks/statistics.rake
jets-5.0.6 lib/jets/tasks/statistics.rake
jets-5.0.5 lib/jets/tasks/statistics.rake
jets-5.0.4 lib/jets/tasks/statistics.rake
jets-5.0.3 lib/jets/tasks/statistics.rake