Skip to content

Commit

Permalink
Add Camping::RDocTask in extras
Browse files Browse the repository at this point in the history
  • Loading branch information
judofyr committed Aug 2, 2009
1 parent 2bc587e commit daccba9
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions extras/rdoctask.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit daccba9

Please sign in to comment.