Trying to format a mutliline string in Ruby
heredoc and %q{ } have the issue that they include whitespace used for formatting the code.
s = %q{Foo
Bar
Baz}
puts s
Incorrectly outputs the following:
Foo
Bar
Baz
The following works, but is a bit ugly with the \ characters.
s = "Foo\n" \
" Bar\n" \
" Baz"
puts s
The following works in python:
s = ("Foo\n"
" Bar\n"
" Baz")
print s
Is there an equivalent in Ruby?
A trick I stole from The Ruby Way: