From daccba92ee7f80036ceb0593737e632718ed6730 Mon Sep 17 00:00:00 2001 From: Magnus Holm Date: Mon, 3 Aug 2009 01:03:03 +0200 Subject: [PATCH] Add Camping::RDocTask in extras --- extras/rdoctask.rb | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 extras/rdoctask.rb diff --git a/extras/rdoctask.rb b/extras/rdoctask.rb new file mode 100644 index 0000000..bed7e26 --- /dev/null +++ b/extras/rdoctask.rb @@ -0,0 +1,26 @@ +require 'rdoc/task' + +module Camping + # Adds after_running_rdoc + class RDocTask < RDoc::Task + def after_running_rdoc(&block) + @after_running_rdoc = block + end + + def define + super + return unless after = @after_running_rdoc + + task = Rake::Task[rdoc_task_name.to_sym] + target = Rake::Task[rdoc_target.to_sym] + + task.clear.enhance do + begin + target.invoke + ensure + after.call + end + end + end + end +end \ No newline at end of file