On Mon, Oct 3, 2011 at 14:16, Yusuke Endoh <mame / tsg.ne.jp> wrote:

> 2011/10/3"Martin J. Durst" <duerst / it.aoyama.ac.jp>:
>> What we'd like to have is something like
>>
>> my_string = <<+HERE
>>  doc
>>  doc
>>  doc
>>  HERE
>> -> "doc\ndoc\ndoc\n"

> How about importing String#margin from Facets?
>
> my_string = <<-END.margin
>  |doc
>  |doc
>  |doc
> END

Why not implement it by checking the amount of leading whitespace on
the first line and strip that amount of whitespace from all subsequent
lines?  String#margin should in that case also take an optional
Integer argument that states how many characters to strip from the
start of each line that is used instead of the heuristic method.