Sent from my iPad

On Oct 3, 2011, at 10:49 AM, Trans <transfire / gmail.com> wrote:

> On Mon, Oct 3, 2011 at 11:05 AM, Jim Freeze <jimfreeze / gmail.com> wrote:
>> How does String#margin behave when given irregular input?
>> For example
>> string =3D <<-END.margin
>> <tab>|doc
>> <3spaces>|doc
>> <1space>|doc
>> doc
>>     doc
>> END
>=20
> It takes the first non-whitespace character to be the indent marker,
> so in the case it's controlling the margin using '<', and you get:
>=20
>  tab>|doc
>  3spaces>|doc
>  1space>|doc
>  doc
>      doc

The <3spaces> is notation for three spaces. There is no '<' char.
>=20
>=20
>=20
>> On Mon, Oct 3, 2011 at 10:00 AM, Trans <transfire / gmail.com> wrote:
>>>=20
>>> On Mon, Oct 3, 2011 at 8:16 AM, Yusuke Endoh <mame / tsg.ne.jp> wrote:
>>>=20
>>>> How about importing String#margin from Facets?
>>>>=20
>>>>  my_string =3D <<-END.margin
>>>>    |doc
>>>>    |doc
>>>>    |doc
>>>>  END
>>>>=20
>>>>  p my_string  #=3D> "doc\ndoc\ndoc"
>>>>=20
>>>>=20
>>>>=20
>>>> http://rubyworks.github.com/facets/doc/api/core/String.html#method-i-ma=
rgin
>>>=20
>>> Yes, in fact #margin was born from the idea of %L. The downside of
>>> #margin is that it requires more processing overhead, where as the
>>> literal notation would be very fast (if it is possible to implement in
>>> Ruby parser).
>>>=20
>>=20
>>=20
>>=20
>> --
>> Jim Freeze
>>=20
>=20
>=20
>=20
> --=20
> Sorry, says the barman, we don't serve neutrinos. A neutrino walks into a b=
ar.
>=20
> Trans <transfire / gmail.com>
> 7r4n5.com      http://7r4n5.com
>=20