Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 56 lines (44 sloc) 1.11 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
require 'rubygems'
require 'rake'

class FailedCleanException < Exception;end

task :default => 'test:all'

namespace :maintenance do
  current_dir = File.dirname(__FILE__)
  client_dir = "#{current_dir}/public/generated_clients"

 desc "clean out the generated clients directory"
 task :clean do
   clean_result = %x{rm -rf #{client_dir}/*}
     print clean_result
     if clean_result.match(/error/i)
       puts "clean failed"
       throw FailedCleanException.new
     end
   end
   
 desc "run a full clean"
 task :all => [ :clean ]
end

namespace :test do

  desc "run the test suite"
  task :run do
    %x{ruby test/ts_master.rb}
  end
  
  desc "run rcov code coverage report"
  task :coverage do
    %x{rcov test/unit/*.rb}
  end
  
  desc "run saikuro cyclomatic complexity report"
  task :complexity do
    %x{saikuro -c -t -i lib -y 0 -w 11 -e 16 -o complexity/}
  end
   
 desc "run all test tasks"
 task :all => [ :run , :coverage, :complexity ]
end

namespace :server do
  desc "run the app"
  task :run do
    %x{ruby app.rb }
  end

  task :open do
    %x{open http://localhost:4567}
  end
end
Something went wrong with that request. Please try again.