rapid7/metasploit-framework — pull request #4298 by trevrosen (2014-12-02 20:05:53+00:00)
Title: Allow replicant objects to be extended by arbitrary Ruby code

### Verification
- [ ] Have some code that uses `run_simple` or `exploit_simple` and therefore calls `Msf::Module#replicant`
- [ ] Write a Ruby module that overrides MSF psuedo-callback methods like `on_new_session` or `start_session`
- [ ] Before calling `run_simple` or `exploit_simple` on a loaded module, use the `Msf::Module#register_extensions` method like this:
```ruby
msf_module.register_extensions(MyCoolRubyModule)
```
- [ ] Allow the call to `run_simple` or `exploit_simple` to run as normal
- [ ] VERIFY: your method was called automatically and not the default implementation for the particular MSF module you are running.