Smarter expansion of ruby heredoc contents