Skip to content

Instantly share code, notes, and snippets.

@coreyhaines
Created December 8, 2011 21:08
Show Gist options
  • Save coreyhaines/1448598 to your computer and use it in GitHub Desktop.
Save coreyhaines/1448598 to your computer and use it in GitHub Desktop.
Sample of my old custom stats file that adds spec_no_rails
if ENV['LOAD_RAILS'] == '1'
task :stats => "ma:add_no_rails_dirs_to_stats"
namespace :ma do
desc "Report code statistics (KLOCs, etc) from the application"
task :add_no_rails_dirs_to_stats do
require 'rails/code_statistics'
::STATS_DIRECTORIES << %w(NoRails\ Lib\ specs spec_no_rails/lib) if File.exist?('spec_no_rails/lib')
::CodeStatistics::TEST_TYPES << "NoRails Lib specs" if File.exist?('spec_no_rails/lib')
::STATS_DIRECTORIES << %w(NoRails\ Model\ specs spec_no_rails/model) if File.exist?('spec_no_rails/model')
::CodeStatistics::TEST_TYPES << "NoRails Model specs" if File.exist?('spec_no_rails/model')
end
end
end
@coreyhaines
Copy link
Author

This is back when I was putting my code in lib/app_name. I put it in app/app_name now, so you can alter this, if you like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment