"Chris Morris" <chrismo / clabs.org> wrote:

> Just had a frustrating thing come up. With the following:
>
>   var = <<-DOC
>     yo
>   DOC
>
> .. and trailing spaces after the final DOC, I get this:

Ruby insists on a newline following the here-doc closer.

----
var = <<-DOC
    yo
  DOC
  DOC
puts var
----

produces

#->    yo
#->  DOC

because the first appearance of DOC is actually 'DOC '.

>
> Is this a bug?
>

Yes, but you fixed it ;-)

If an editor can be configured to strip trailing spaces
from lines,  I use it.


daz