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