From: Rick DeNatale Date: 2010-04-01T10:01:43+09:00 Subject: Re: each_slice() No, each_slice is/was in Ruby 1.8, but it is defined as part of the enumerator extension which needs to be required in order to add each_slice and several other instance methods to the enumerable module. It wasn't backported from 1.9, rather 1.9 made the extension a standard part of the Enumerable class. So requiring enumerator should work for any version of 1.8.x, or at least back to 1.8.2 which is the version documented by the 2nd edition of the Pickaxe. On Wed, Mar 31, 2010 at 7:47 PM, Albert Schlef wrote: > Albert Schlef wrote: >> But how is your answer helpful? >> >> I know each_slice() works in some versions of 1.8. It works on my 1.8 >> too. My question was: starting with *which* version? > > Let me be more elaborate: > > each_slice() was introduced in 1.9. It was then backported to 1.8. > That's how i understand what I read on the internet (I may be wrong). > > What I was trying to do was to find out, for example, if all "1.8.7" > versions have each_slice() and can be called without a block (so that I > could add ">= 1.8.7" as a dependency to my gem). > > When you say "ruby 1.8.7 (2009-12-24 patchlevel 248)" has this > each_slice(), it doesn't yet help me. > -- > Posted via http://www.ruby-forum.com/. > > -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Github: http://github.com/rubyredrick Twitter: @RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale