Apache Solr open-source search software
Cosmetic cleanup of Rakefile, adding descriptions for all publicly desirable tasks
Erik Hatcherbcc539c7ae73
diff --git a/client/ruby/solrb/Rakefile b/client/ruby/solrb/Rakefileindex c5b6078dc6a..b99c7b668f8 100644--- a/client/ruby/solrb/Rakefile+++ b/client/ruby/solrb/Rakefile@@ -62,7 +62,7 @@ Rake::GemPackageTask.new(spec) do |pkg|pkg.need_tar = trueend-# Generate rdoc documentation+desc "Generate rdoc documentation"Rake::RDocTask.new('doc') do |rd|rd.rdoc_files.include("lib/**/*.rb")rd.rdoc_files.include('README', 'CHANGES.txt', 'LICENSE.txt')@@ -70,32 +70,13 @@ Rake::RDocTask.new('doc') do |rd|rd.rdoc_dir = 'doc'end-# Run unit tests+desc "Run unit tests"Rake::TestTask.new(:test_units) do |t|t.pattern = 'test/unit/*_test.rb't.verbose = truet.ruby_opts = ['-r solr', '-r test/unit', '-Itest/unit']end-def egrep(pattern)- Dir['**/*.rb'].each do |fn|- count = 0- open(fn) do |f|- while line = f.gets- count += 1- if line =~ pattern- puts "#{fn}:#{count}:#{line}"- end- end- end- end-end--desc "Look for TODO/FIXME/TBD tags in the code"-task :todo do- egrep /#.*(FIXME|TODO|TBD)/-end-# NOTE: test_functionals does not work standalone currently. It needs the TestSolrServer wrapper in the :test taskRake::TestTask.new(:test_functionals) do |t|t.pattern = 'test/functional/*_test.rb'@@ -103,10 +84,8 @@ Rake::TestTask.new(:test_functionals) do |t|t.ruby_opts = ['-r solr', '-r test/unit', '-Itest/functional']end-task :test do- # unit tests don't require a solr server- Rake::Task[:test_units].invoke-+desc "Run unit and functional tests"+task :test => [:test_units] dorm_rf "test/data" # remove functional test temp data directory# wrap functional tests with a test-specific Solr server@@ -117,17 +96,39 @@ task :test doraise "test failures" if got_errorend+# TODO: consider replacing system() to rcov with the included+# Rake task: http://eigenclass.org/hiki.rb?cmd=view&p=rcov+FAQ&key=rakenamespace :test dodesc 'Measures test coverage'# borrowed from here: http://clarkware.com/cgi/blosxom/2007/01/05#RcovRakeTasktask :coverage dorm_rf "coverage"rm_rf "coverage.data"- TestSolrServer.wrap do+ TestSolrServer.wrap(:quiet => ENV['SOLR_CONSOLE'] ? false : true) dosystem("rcov --aggregate coverage.data --text-summary -Ilib:test/functional test/functional/*_test.rb")endsystem("rcov --aggregate coverage.data --text-summary -Ilib:test/unit test/unit/*_test.rb")system("open coverage/index.html") if PLATFORM['darwin']end+end++def egrep(pattern)+ Dir['**/*.rb'].each do |fn|+ count = 0+ open(fn) do |f|+ while line = f.gets+ count += 1+ if line =~ pattern+ puts "#{fn}:#{count}:#{line}"+ end+ end+ end+ endend++desc "Report TODO/FIXME/TBD tags in the code"+task :todo do+ egrep /#.*(FIXME|TODO|TBD)/+end+