From: Robert Klemme Date: 2010-02-15T23:19:25+09:00 Subject: Re: Some noob questions 2010/2/15 John Ydil : > John Ydil wrote: >> >>> >>> Slowly....  I believe #each_slice was added later as well.  Oh well. >>> Can't you just upgrade your Ruby version?  That seems a much better >>> option than trying to retrofit all the new behavior on the old >>> version. >>> >>> Kind regards >>> >>> robert >> >> I'll try to upgrade. > > > Unfortunately, the provider doesn't have a newer version of ruby :s module Enumerable def each_slice(num) sl = [] each do |x| sl << x if sl.size == num yield sl sl = [] end end yield sl unless sl.empty? self end end Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/