--0016e64fd3e4d6708a04ae664c3c
Content-Type: text/plain; charset=ISO-8859-1
How does String#margin behave when given irregular input?
For example
string <-END.margin
<tab>|doc
<3spaces>|doc
<1space>|doc
doc
doc
END
On Mon, Oct 3, 2011 at 10:00 AM, Trans <transfire / gmail.com> wrote:
> On Mon, Oct 3, 2011 at 8:16 AM, Yusuke Endoh <mame / tsg.ne.jp> wrote:
>
> > How about importing String#margin from Facets?
> >
> > my_string <-END.margin
> > |doc
> > |doc
> > |doc
> > END
> >
> > p my_string # "doc\ndoc\ndoc"
> >
> >
> >
> http://rubyworks.github.com/facets/doc/api/core/String.html#method-i-margin
>
> 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).
>
>
--
Jim Freeze
--0016e64fd3e4d6708a04ae664c3c
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
How does String#margin behave when given irregular input?<div>For example</div><div><br></div><div>string = <<-END.margin</div><div><tab>|doc</div><div><3spaces>|doc</div><div><1space>|doc</div><div>
doc</div><div>doc</div><div>END</div><div><br><br><div class="gmail_quote">On Mon, Oct 3, 2011 at 10:00 AM, Trans <span dir="ltr"><transfire / gmail.com></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
On Mon, Oct 3, 2011 at 8:16 AM, Yusuke Endoh <mame / tsg.ne.jp> wrote:<br>
<br>
> How about importing String#margin from Facets?<br>
><br>
> ¨Âùßóôòéîç ¦ìô»¦ìô»ÅÎÄ®íáòçéî¼âò> ¨Âäïã¼âò> ¨Âäïã¼âò> ¨Âäïã¼âò> ¨ÂÎļâò¾
><br>
> ¨Â íùßóôòéçô¦ñõïô»äïãÜîäïãÜîäïã¦ñõïô»¼âò><br>
><br>
> <a href="http://rubyworks.github.com/facets/doc/api/core/String.html#method-i-margin" target="_blank">http://rubyworks.github.com/facets/doc/api/core/String.html#method-i-margin</a><br>
<br>
Yes, in fact #margin was born from the idea of %L. The downside of<br>
#margin is that it requires more processing overhead, where as the<br>
literal notation would be very fast (if it is possible to implement in<br>
Ruby parser).<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Jim Freeze<br>
</div>
--0016e64fd3e4d6708a04ae664c3c--