On Tue, May 24, 2011 at 5:25 PM, Iaki Baz Castillo <ibc / aliax.net> wrote:

2011/5/24 Robert Klemme <shortcutter / googlemail.com>:
> >> sprintf("  %-20s %20s", "#{key.to_s}:", value.to_s)
> >
> > That's overly complicated: you employ two text replacement mechanisms.
>  Just do
> >
> > printf("  %-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.