--f46d043bdb76e10e1a04beaf68b0 Content-Type: text/plain; charset=UTF-8 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_SUBSTITUTIONS. > > Here is the usage: > > $NUMBER_OF_SPACES_PER_TAB_FOR_TRANSLATION_SUBSTITUTIONS > > 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 <p>On Apr 27, 2012 3:29 PM, "Aaron Patterson" <tenderlove / ruby-lang.org> wrote:<br> ><br> > On Sat, Apr 28, 2012 at 05:22:47AM +0900, Ryan Davis wrote:<br> > ><br> > > On Apr 27, 2012, at 11:51 , Intransition wrote:<br> > ><br> > > > Is there any global variable in Ruby for specifying how tabs"\t") should be translated into spaces?<br> > ><br> > > Huh?<br> > ><br> > > Where would this global be used, exactly?<br> ><br> > I think the variable is $NUMBER_OF_SPACES_PER_TAB_FOR_TRANSLATION_SUBSTITUTIONS.<br> ><br> > Here is the usage:<br> ><br> > $NUMBER_OF_SPACES_PER_TAB_FOR_TRANSLATION_SUBSTITUTIONS = 4<br> ><br> > string.gsub(/\t/, ' ' * $NUMBER_OF_SPACES_PER_TAB_FOR_TRANSLATION_SUBSTITUTIONS)<br> ><br> > Hope that helps!<br> ><br> > --<br> > Aaron Patterson<br> > http://tenderlovemaking.com/</p> <p>LOL.</p> <p>Intransition: the amount of space shown by a tab is totally dependent onhe 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.<br> </p> --f46d043bdb76e10e1a04beaf68b0--