On Wed, Apr 15, 2009 at 9:24 AM, Srijayanth Sridhar
<srijayanth / gmail.com> wrote:

> The hack works fine, but on a broader subject, is there a nice easy way of
> grouping arrays?

You could use Enumerator#each_slice:

    require 'enumerator'

    def pretty_print_list(list, num=5)
      a = []
      list.each_slice(5) {|s| a << s.join(",") }
      a
    end

Hope this helps,

Lyle