Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

root/tags/capistrano_1-99-3/Rakefile

Revision 6589, 1.6 kB (checked in by minam, 1 year ago)

Start writing tests for the deployment code. Make the copy strategy checkout to a customizable tmpdir, instead of merely using cwd

Line 
1 require 'rake'
2 require 'rake/testtask'
3 require 'rake/rdoctask'
4 require 'rake/packagetask'
5 require 'rake/gempackagetask'
6 require 'rake/contrib/rubyforgepublisher'
7
8 require "./lib/capistrano/version"
9
10 PKG_NAME      = "capistrano"
11 PKG_BUILD     = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
12 PKG_VERSION   = Capistrano::Version::STRING + PKG_BUILD
13 PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
14
15 desc "Default task"
16 task :default => [ :test ]
17
18 desc "Build documentation"
19 task :doc => [ :rdoc ]
20
21 Rake::TestTask.new do |t|
22   t.test_files = Dir["test/**/*_test.rb"]
23   t.verbose = true
24 end
25
26 desc "Run code-coverage analysis using rcov"
27 task :coverage do
28   rm_rf "coverage"
29   files = Dir["test/**/*_test.rb"]
30   system "rcov #{files.join(' ')}"
31 end
32
33 GEM_SPEC = eval(File.read("#{File.dirname(__FILE__)}/#{PKG_NAME}.gemspec"))
34
35 Rake::GemPackageTask.new(GEM_SPEC) do |p|
36   p.gem_spec = GEM_SPEC
37   p.need_tar = true
38   p.need_zip = true
39 end
40
41 desc "Build the RDoc API documentation"
42 Rake::RDocTask.new do |rdoc|
43   rdoc.rdoc_dir = "doc"
44   rdoc.title    = "Capistrano -- A framework for remote command execution"
45   rdoc.options += %w(--line-numbers --inline-source --main README)
46   rdoc.rdoc_files.include 'README'
47   rdoc.rdoc_files.include 'lib/**/*.rb'
48   rdoc.template = "jamis"
49 end
50
51 desc "Publish the beta gem"
52 task :pgem => [:package] do
53   Rake::SshFilePublisher.new("wrath.rubyonrails.org", "public_html/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload
54   `ssh wrath.rubyonrails.org './gemupdate.sh'`
55 end
56
57 desc "Clean up generated directories and files"
58 task :clean do
59   rm_rf "pkg"
60   rm_rf "doc"
61   rm_rf "coverage"
62 end
Note: See TracBrowser for help on using the browser.