On Tue, May 24, 2011 at 1:59 PM, I=F1aki Baz Castillo <ibc / aliax.net> wrote=
:
> 2011/5/24 I=F1aki Baz Castillo <ibc / aliax.net>:
>> I've got the following output by using sprintf("%20s %20s",
>> "#{key.to_s}:", value.to_s):
>>
>> ------------------------------------
>> =A0 =A0 =A0 =A0listen_ip: =A0 =A0 =A0 1.2.3.4
>> =A0 =A0 listen_port: =A0 =A0 =A0 =A0 =A0 =A0 =A090
>> =A0 =A0 =A0 =A0 use_tls: =A0 =A0 =A0 =A0 =A0 =A0true
>> =A0compression: =A0 =A0 =A0 =A0 =A0 false
>> ------------------------------------
>>
>> but it's not exactly what I need.
>
> Got it!:
>
> sprintf(" =A0%-20s %20s", "#{key.to_s}:", value.to_s)

That's overly complicated: you employ two text replacement mechanisms.  Jus=
t do

printf("  %-20s: %20s\n", key, value)

Cheers

robert

--=20
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/