capistrano/capistrano — pull request #242 by cgriego (2012-07-20 03:51:39+00:00)
Title: Fix capture by listening for method definition on Kernel and undefine on Namespace

Fixes capture method issues when ActiveSupport Kernel extensions are loaded after a namespace is defined (code added before fixes when AS is loaded before the namespace is defined). Given the new use of capture in the deploy:clean task, AS would have to be loaded before the deploy recipe to work with the existing code.

It's ugly but it seems to work to fix capture even if loaded after a namespace is defined. It's based on similar strategies for recreating BasicObject in Ruby 1.8.

Fixes #175 #168 #170 #239 #169