I'm a big fan of heredoc + margin removal for this sort of thing (e.g., https://github.com/matschaffer/knife-solo/blob/master/lib/knife-solo/info.rb#L7) Might be time just just pull in https://github.com/rubyworks/facets/blob/master/lib/core/facets/string/trim.rb and standardize on that.