Catches stdout and stderr for ruby blocks.
TODO
For a more detailed description, see (TODO blog link).