How about:
```ruby
content = strip_heredoc <<-TEXT
...
TEXT
...

private

def strip_heredoc(text)
  text.strip_heredoc.sub(/\n$/, '')
end
```