Rakefile: use yardoc to generate documentation
authorWincent Colaiuta <win@wincent.com>
Thu, 29 Jul 2010 17:10:43 +0000 (19:10 +0200)
committerWincent Colaiuta <win@wincent.com>
Thu, 29 Jul 2010 17:10:43 +0000 (19:10 +0200)
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Rakefile

index 28ee99266ec58319422f4281fa4dd96d4b1ffa7f..2af03ea3c82eaa9110e48dd01398f8574f1fbf92 100644 (file)
--- a/Rakefile
+++ b/Rakefile
@@ -23,8 +23,6 @@
 
 require 'rake'
 require 'rake/clean'
-require 'rake/gempackagetask'
-require 'rake/rdoctask'
 require 'rubygems'
 require 'spec/rake/spectask'
 require 'spec/rake/verify_rcov'
@@ -75,16 +73,18 @@ task :make => ['ext/mkdtemp.c', 'ext/ruby_compat.h', 'ext/Makefile'] do |t|
   end
 end
 
-Rake::RDocTask.new do |t|
-  t.rdoc_files.include 'doc/README', 'ext/mkdtemp.c'
-  t.options           << '--charset' << 'UTF-8' << '--inline-source'
-  t.main              = 'doc/README'
-  t.title             = 'mkdtemp documentation'
+desc 'Buils the YARD HTML files'
+task :yard do
+  sh 'yardoc -o html --title mkdtemp - doc/README'
 end
 
-desc 'Upload RDoc to RubyForge website'
-task :upload_rdoc => :rdoc do
-  sh 'scp -r html/* rubyforge.org:/var/www/gforge-projects/mkdtemp/'
+desc 'Upload YARD HTML'
+task :upload_yard => :yard do
+  require 'yaml'
+  config = YAML.load_file('.config.yml')
+  raise ':yardoc_host not configured' unless config.has_key?(:yardoc_host)
+  raise ':yardoc_path not configured' unless config.has_key?(:yardoc_path)
+  sh "scp -r html/* #{config[:yardoc_host]}:#{config[:yardoc_path]}"
 end
 
 EXT_FILE = "ext/mkdtemp.#{Config::CONFIG['DLEXT']}"