Catches stdout and stderr for ruby blocks