diff options
author | Mohammed Morsi <mmorsi@redhat.com> | 2011-02-04 11:46:02 -0500 |
---|---|---|
committer | Mohammed Morsi <mmorsi@redhat.com> | 2011-02-04 11:46:02 -0500 |
commit | 27692c1a1daba06093bba9f0c0a43f7e2289f86e (patch) | |
tree | 25f026e586252788e7a3661d7f19dc158ef40849 /Rakefile | |
parent | e8b4c1afac825b3a67b62d9b6e2a36e337ac439a (diff) | |
download | rubygem-actionpack-27692c1a1daba06093bba9f0c0a43f7e2289f86e.tar.gz rubygem-actionpack-27692c1a1daba06093bba9f0c0a43f7e2289f86e.tar.xz rubygem-actionpack-27692c1a1daba06093bba9f0c0a43f7e2289f86e.zip |
update to actionpack 3.0.3
Diffstat (limited to 'Rakefile')
-rw-r--r-- | Rakefile | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..30e81b6 --- /dev/null +++ b/Rakefile @@ -0,0 +1,65 @@ +require 'rake' +require 'rake/testtask' +require 'rake/packagetask' +require 'rake/gempackagetask' + +desc "Default Task" +task :default => :test + +# Run the unit tests + +desc "Run all unit tests" +task :test => [:test_action_pack, :test_active_record_integration] + +Rake::TestTask.new(:test_action_pack) do |t| + t.libs << 'test' + + # make sure we include the tests in alphabetical order as on some systems + # this will not happen automatically and the tests (as a whole) will error + t.test_files = Dir.glob('test/{abstract,controller,dispatch,template}/**/*_test.rb').sort + + # t.warning = true +end + +namespace :test do + Rake::TestTask.new(:isolated) do |t| + t.pattern = 'test/ts_isolated.rb' + end +end + +desc 'ActiveRecord Integration Tests' +Rake::TestTask.new(:test_active_record_integration) do |t| + t.libs << 'test' + t.test_files = Dir.glob("test/activerecord/*_test.rb") +end + +desc "Release to gemcutter" +task :release => :package do + require 'rake/gemcutter' + Rake::Gemcutter::Tasks.new(spec).define + Rake::Task['gem:push'].invoke +end + +task :lines do + lines, codelines, total_lines, total_codelines = 0, 0, 0, 0 + + for file_name in FileList["lib/**/*.rb"] + next if file_name =~ /vendor/ + f = File.open(file_name) + + while line = f.gets + lines += 1 + next if line =~ /^\s*$/ + next if line =~ /^\s*#/ + codelines += 1 + end + puts "L: #{sprintf("%4d", lines)}, LOC #{sprintf("%4d", codelines)} | #{file_name}" + + total_lines += lines + total_codelines += codelines + + lines, codelines = 0, 0 + end + + puts "Total: Lines #{total_lines}, LOC #{total_codelines}" +end |