Sha256: 0be19107e420b322d53740ba98589306fee1918fc51df2a9b8f4269de9d7e1a1

Contents?: true

Size: 1.42 KB

Versions: 28

Compression:

Stored size: 1.42 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),
]

desc "Report code statistics (KLOCs, etc) from the application or engine"
task :stats do
  require "rails/code_statistics"
  stat_directories = STATS_DIRECTORIES.collect do |name, dir|
    [ name, "#{File.dirname(Rake.application.rakefile_location)}/#{dir}" ]
  end.select { |name, dir| File.directory?(dir) }
  CodeStatistics.new(*stat_directories).to_s
end

Version data entries

28 entries across 28 versions & 4 rubygems

Version Path
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/railties-7.1.3.4/lib/rails/tasks/statistics.rake
railties-7.2.2.1 lib/rails/tasks/statistics.rake
railties-7.1.5.1 lib/rails/tasks/statistics.rake
railties-7.2.2 lib/rails/tasks/statistics.rake
railties-7.1.5 lib/rails/tasks/statistics.rake
railties-7.2.1.2 lib/rails/tasks/statistics.rake
railties-7.1.4.2 lib/rails/tasks/statistics.rake
railties-7.2.1.1 lib/rails/tasks/statistics.rake
railties-7.1.4.1 lib/rails/tasks/statistics.rake
railties-7.1.4 lib/rails/tasks/statistics.rake
railties-7.2.1 lib/rails/tasks/statistics.rake
railties-7.2.0 lib/rails/tasks/statistics.rake
railties-7.2.0.rc1 lib/rails/tasks/statistics.rake
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/railties-7.1.3.4/lib/rails/tasks/statistics.rake
railties-7.2.0.beta3 lib/rails/tasks/statistics.rake
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/tasks/statistics.rake
railties-7.2.0.beta2 lib/rails/tasks/statistics.rake
railties-7.1.3.4 lib/rails/tasks/statistics.rake
railties-7.2.0.beta1 lib/rails/tasks/statistics.rake
railties-7.1.3.2 lib/rails/tasks/statistics.rake