On Tue, May 24, 2011 at 5:29 PM, Xavier Noria <fxn / hashref.com> wrote:
> On Tue, May 24, 2011 at 5:25 PM, I=F1aki Baz Castillo <ibc / aliax.net> wro=
te:
>
> 2011/5/24 Robert Klemme <shortcutter / googlemail.com>:
>> >> sprintf(" =A0%-20s %20s", "#{key.to_s}:", value.to_s)
>> >
>> > That's overly complicated: you employ two text replacement mechanisms.
>> =A0Just do
>> >
>> > printf(" =A0%-20s: %20s\n", key, value)
>>
>> Yes, initially I used key.to_s as I have Symbols as keys and thougth
>> that a string is required.
>
>
> Note that the colon belongs to the argument though. Otherwise they won't =
be
> next to their keys.

Right, I overlooked that.  Good catch!  I usually prefer to have all
colons aligned, that's why I probably didn't notice.

Kind regards

robert

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