Skip to content

Commit

Permalink
Make sure the task is actually ran before running the after callback
Browse files Browse the repository at this point in the history
  • Loading branch information
judofyr committed Oct 17, 2009
1 parent fa88025 commit 8a8d6ab
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion extras/rdoctask.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ def after_running_rdoc(&block)
end

def define
pre = @before_running_rdoc
ran = false
@before_running_rdoc = proc { ran = true; pre.call if pre }

super
return unless after = @after_running_rdoc

Expand All @@ -18,7 +22,7 @@ def define
begin
target.invoke
ensure
after.call
after.call if ran
end
end
end
Expand Down

0 comments on commit 8a8d6ab

Please sign in to comment.