Changeset 1174

Show
Ignore:
Timestamp:
01/05/08 17:17:35 (9 months ago)
Author:
lancecarls..@gmail.com
Message:

Added coverage, rdoc and windows compatibilty to rake tasks

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/merb_helpers/Rakefile

    r1172 r1174  
    11require 'rubygems' 
    22require 'rake/gempackagetask' 
     3require 'rake/rdoctask' 
    34require 'spec/rake/spectask' 
    45 
     
    1011HOMEPAGE = "http://merb.rubyforge.org/" 
    1112SUMMARY = "Helper support for merb (similar to the Rails form helpers)" 
     13 
     14windows = (PLATFORM =~ /win32|cygwin/) 
     15 
     16SUDO = windows ? "" : "sudo" 
    1217 
    1318spec = Gem::Specification.new do |s| 
     
    3540desc "Run :package and install resulting .gem" 
    3641task :install => [:package] do 
    37   sh %{sudo gem install pkg/#{NAME}-#{GEM_VERSION} --no-rdoc --no-ri} 
     42  sh %{#{SUDO} gem install pkg/#{NAME}-#{GEM_VERSION} --no-rdoc --no-ri} 
    3843end 
     44 
     45Rake::RDocTask.new do |rdoc| 
     46      files = ['README', 'LICENSE', 
     47               'lib/**/*.rb'] 
     48      rdoc.rdoc_files.add(files) 
     49      rdoc.main = 'README' 
     50      rdoc.title = 'Merb Helper Docs' 
     51      rdoc.rdoc_dir = 'doc/rdoc' 
     52      rdoc.options << '--line-numbers' << '--inline-source' 
     53end 
     54 
    3955 
    4056Spec::Rake::SpecTask.new do |t| 
     
    4359   t.spec_files = Dir['spec/**/*_spec.rb'].sort    
    4460end 
     61 
     62desc "Run all specs and generate an rcov report" 
     63Spec::Rake::SpecTask.new('rcov') do |t| 
     64  t.spec_files = FileList['spec/**/*_spec.rb'] 
     65  t.spec_opts = ["--format", "specdoc", "--colour"] 
     66  t.rcov = true 
     67  t.rcov_dir = 'coverage' 
     68  t.rcov_opts = ['--exclude', 'gems', '--exclude', 'spec'] 
     69end 
     70 
     71