Sha256: 65fa8022d16a3587e17ff0f523ecc8b9f88f7aecdfc6e9087e71f238344f4087

Contents?: true

Size: 1.07 KB

Versions: 4

Compression:

Stored size: 1.07 KB

Contents

# 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(Javascripts        app/assets/javascripts),
  %w(Libraries          lib/),
  %w(Tasks              lib/tasks),
  %w(APIs               app/apis),
  %w(Controller\ tests  test/controllers),
  %w(Helper\ tests      test/helpers),
  %w(Model\ tests       test/models),
  %w(Mailer\ tests      test/mailers),
  %w(Job\ tests         test/jobs),
  %w(Integration\ tests test/integration),
].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

4 entries across 4 versions & 1 rubygems

Version Path
railties-5.0.0.beta3 lib/rails/tasks/statistics.rake
railties-5.0.0.beta2 lib/rails/tasks/statistics.rake
railties-5.0.0.beta1.1 lib/rails/tasks/statistics.rake
railties-5.0.0.beta1 lib/rails/tasks/statistics.rake