2005-08-03 08:59:03 -04:00
|
|
|
require 'rake'
|
|
|
|
require 'rake/testtask'
|
|
|
|
require 'rake/rdoctask'
|
2005-10-18 20:52:09 -04:00
|
|
|
require 'rake/packagetask'
|
2005-08-03 08:59:03 -04:00
|
|
|
require 'rake/gempackagetask'
|
2005-08-30 16:53:32 -04:00
|
|
|
require 'rake/contrib/rubyforgepublisher'
|
2005-08-03 08:59:03 -04:00
|
|
|
|
2006-03-05 22:48:35 -05:00
|
|
|
require "./lib/capistrano/version"
|
2005-08-03 08:59:03 -04:00
|
|
|
|
2006-03-05 22:48:35 -05:00
|
|
|
PKG_NAME = "capistrano"
|
2005-08-30 16:53:32 -04:00
|
|
|
PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
|
2006-03-05 22:48:35 -05:00
|
|
|
PKG_VERSION = Capistrano::Version::STRING + PKG_BUILD
|
2005-08-30 16:53:32 -04:00
|
|
|
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
|
2005-08-03 08:59:03 -04:00
|
|
|
|
|
|
|
desc "Default task"
|
|
|
|
task :default => [ :test ]
|
|
|
|
|
|
|
|
desc "Build documentation"
|
|
|
|
task :doc => [ :rdoc ]
|
|
|
|
|
|
|
|
Rake::TestTask.new do |t|
|
2005-08-12 17:40:38 -04:00
|
|
|
t.test_files = Dir["test/**/*_test.rb"]
|
2005-08-03 08:59:03 -04:00
|
|
|
t.verbose = true
|
|
|
|
end
|
|
|
|
|
2007-03-04 15:11:09 -05:00
|
|
|
desc "Run code-coverage analysis using rcov"
|
|
|
|
task :coverage do
|
|
|
|
rm_rf "coverage"
|
|
|
|
files = Dir["test/**/*_test.rb"]
|
|
|
|
system "rcov #{files.join(' ')}"
|
|
|
|
end
|
|
|
|
|
2005-08-30 16:53:32 -04:00
|
|
|
GEM_SPEC = eval(File.read("#{File.dirname(__FILE__)}/#{PKG_NAME}.gemspec"))
|
2005-08-03 08:59:03 -04:00
|
|
|
|
|
|
|
Rake::GemPackageTask.new(GEM_SPEC) do |p|
|
|
|
|
p.gem_spec = GEM_SPEC
|
|
|
|
p.need_tar = true
|
|
|
|
p.need_zip = true
|
|
|
|
end
|
|
|
|
|
|
|
|
desc "Build the RDoc API documentation"
|
|
|
|
Rake::RDocTask.new do |rdoc|
|
|
|
|
rdoc.rdoc_dir = "doc"
|
2006-03-05 22:48:35 -05:00
|
|
|
rdoc.title = "Capistrano -- A framework for remote command execution"
|
2007-03-04 15:11:09 -05:00
|
|
|
rdoc.options += %w(--line-numbers --inline-source --main README)
|
2005-08-03 08:59:03 -04:00
|
|
|
rdoc.rdoc_files.include 'README'
|
|
|
|
rdoc.rdoc_files.include 'lib/**/*.rb'
|
|
|
|
rdoc.template = "jamis"
|
|
|
|
end
|
2005-08-30 16:53:32 -04:00
|
|
|
|
|
|
|
desc "Publish the beta gem"
|
|
|
|
task :pgem => [:package] do
|
2007-04-26 22:20:21 -04:00
|
|
|
Rake::SshFilePublisher.new("wrath.rubyonrails.org", "public_html/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload
|
|
|
|
`ssh wrath.rubyonrails.org './gemupdate.sh'`
|
2006-01-28 10:58:04 -05:00
|
|
|
end
|
2006-07-06 10:22:30 -04:00
|
|
|
|
|
|
|
desc "Clean up generated directories and files"
|
|
|
|
task :clean do
|
|
|
|
rm_rf "pkg"
|
2007-03-04 16:09:37 -05:00
|
|
|
rm_rf "doc"
|
|
|
|
rm_rf "coverage"
|
2007-04-26 22:20:21 -04:00
|
|
|
end
|