If you're doing your own module, you need to do the aliasing in the
included() method of the module:
module MyModule
def self.included(base)
base.send(:alias_method, :run_without_error_handling, :run)
base.send(:alias_method, :run, :run_with_error_handling)
end
def run_with_error_handling(...)
...
end
end
Capistrano::Configuration.send(:include, MyModule)
If you try to alias in the body of the module, then you'll get
complaints that the run method doesn't exist. And you'll also need to
make sure you are including your module after the Invocation module is
included.
- Jamis