]> git.wincent.com - walrat.git/commitdiff
Rakefile: add yard and upload_yard tasks
authorWincent Colaiuta <win@wincent.com>
Sat, 21 Aug 2010 15:38:09 +0000 (17:38 +0200)
committerWincent Colaiuta <win@wincent.com>
Sat, 21 Aug 2010 15:38:09 +0000 (17:38 +0200)
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Rakefile

index 967a5fa43b611a5fe3d2de169e227d428ba7dba4..0c849bbf3e43b1e42c51a89ff33c5b41a1831507 100644 (file)
--- a/Rakefile
+++ b/Rakefile
@@ -51,6 +51,20 @@ Spec::Rake::SpecTask.new('specdoc') do |t|
   t.out         = 'specdoc.rd'
 end
 
+desc 'Build the YARD HTML files'
+task :yard do
+  sh 'bin/yardoc -o html --title Walrat'
+end
+
+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
+
 BUILT_GEM_DEPENDENCIES = Dir[
   'walrat.gemspec',
   'lib/**/*.rb'