From: Eric Christopherson Date: 2012-04-28T06:01:37+09:00 Subject: Re: Global variable for spaces per tab? --f46d043bdb76e10e1a04beaf68b0 Content-Type: text/plain; charset=UTF-8 On Apr 27, 2012 3:29 PM, "Aaron Patterson" wrote: > > On Sat, Apr 28, 2012 at 05:22:47AM +0900, Ryan Davis wrote: > > > > On Apr 27, 2012, at 11:51 , Intransition wrote: > > > > > Is there any global variable in Ruby for specifying how tabs ("\t") should be translated into spaces? > > > > Huh? > > > > Where would this global be used, exactly? > > I think the variable is $NUMBER_OF_SPACES_PER_TAB_FOR_TRANSLATION_SUBSTITUTIONS. > > Here is the usage: > > $NUMBER_OF_SPACES_PER_TAB_FOR_TRANSLATION_SUBSTITUTIONS = 4 > > string.gsub(/\t/, ' ' * $NUMBER_OF_SPACES_PER_TAB_FOR_TRANSLATION_SUBSTITUTIONS) > > Hope that helps! > > -- > Aaron Patterson > http://tenderlovemaking.com/ LOL. Intransition: the amount of space shown by a tab is totally dependent on the terminal used to display the text, and (unlike some terminal parameters) there is no way for Ruby or any language to change it. I guess the best thing you could do would be to implement a writer stream that converted tabs to spaces. --f46d043bdb76e10e1a04beaf68b0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On Apr 27, 2012 3:29 PM, "Aaron Patterson" <tenderlove@ruby-lang.org> wrote:
>
> On Sat, Apr 28, 2012 at 05:22:47AM +0900, Ryan Davis wrote:
> >
> > On Apr 27, 2012, at 11:51 , Intransition wrote:
> >
> > > Is there any global variable in Ruby for specifying how tabs= ("\t") should be translated into spaces?
> >
> > Huh?
> >
> > Where would this global be used, exactly?
>
> I think the variable is $NUMBER_OF_SPACES_PER_TAB_FOR_TRANSLATION_SUBS= TITUTIONS.
>
> Here is the usage:
>
> =C2=A0$NUMBER_OF_SPACES_PER_TAB_FOR_TRANSLATION_SUBSTITUTIONS =3D 4 >
> =C2=A0string.gsub(/\t/, ' ' * $NUMBER_OF_SPACES_PER_TAB_FOR_TR= ANSLATION_SUBSTITUTIONS)
>
> Hope that helps!
>
> --
> Aaron Patterson
> http://tenderlovemaking.com/<= /a>

LOL.

Intransition: the amount of space shown by a tab is totally dependent on= the terminal used to display the text, and (unlike some terminal parameter= s) there is no way for Ruby or any language to change it. I guess the best = thing you could do would be to implement a writer stream that converted tab= s to spaces.

--f46d043bdb76e10e1a04beaf68b0--