require 'rubygems' require 'rake' $:.unshift File.join(File.dirname(__FILE__), 'lib') require 'compass' # ----- Default: Testing ------ task :default => :run_tests require 'rake/testtask' require 'fileutils' Rake::TestTask.new :run_tests do |t| t.libs << 'lib' t.libs << 'test' test_files = FileList['test/**/*_test.rb'] test_files.exclude('test/rails/*', 'test/haml/*') t.test_files = test_files t.verbose = true end Rake::Task[:test].send(:add_comment, < haml_file) puts " haml #{File.basename(basename)}" output = open(basename,'w') output.write(engine.render) output.close end end end namespace :examples do desc "clean up the example directories" task :clean do puts "Cleaning Examples" Dir.glob('examples/*/clean.rb').each do |cleaner| load cleaner end end end task "gemspec:generate" => "examples:clean" namespace :git do task :clean do sh "git", "clean", "-fdx" end end begin require 'cucumber/rake/task' require 'rcov/rcovtask' namespace :rcov do Cucumber::Rake::Task.new(:cucumber) do |t| t.rcov = true t.rcov_opts = %w{--exclude osx\/objc,gems\/,spec\/,features\/ --aggregate coverage.data} t.rcov_opts << %[-o "coverage"] end Rcov::RcovTask.new(:units) do |rcov| rcov.libs << 'lib' test_files = FileList['test/**/*_test.rb'] test_files.exclude('test/rails/*', 'test/haml/*') rcov.pattern = test_files rcov.output_dir = 'coverage' rcov.verbose = true rcov.rcov_opts = %w{--exclude osx\/objc,gems\/,spec\/,features\/ --aggregate coverage.data} rcov.rcov_opts << %[-o "coverage" --sort coverage] end desc "Run both specs and features to generate aggregated coverage" task :all do |t| rm "coverage.data" if File.exist?("coverage.data") Rake::Task["rcov:units"].invoke Rake::Task["rcov:cucumber"].invoke end end rescue LoadError => e puts "WARNING: #{e}" end