On Friday 21 June 2002 02:17 pm, Bil Kleb wrote:
> Currently I am using the following rather ugly bit of Ruby code
> to calculate the maximum length of the file names strings (plus
> one) in the array file_list,
>
>    fn_width = 0
>    file_list.each{ |fn| fn_width = [File.basename(fn).size,
> fn_width].max } fn_width += 1
>
> Can someone offer a more elegant method?  My brain seems to have
> shutdown on this problem today...

Why not just:

1 + file_list.each { |fn| File.basename(fn).length }.max

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE