From: Akinori MUSHA Date: 2009-02-12T22:55:12+09:00 Subject: [ruby-core:22039] Re: 1.8.7 Specifics On Thu, Feb 12, 2009 at 9:59 PM, Michal Suchanek wrote: > 2009/2/12 Akinori MUSHA : >> On Thu, Feb 12, 2009 at 9:24 AM, Michal Suchanek wrote: >>> Some methods in 1.8.7 return Enumerator instead of an Array. This adds >> >> Would you please name an example? >> >> I think I was careful enough not to change the existing behavior >> unless it was pretty certain that no one would rely on it. (e.g. >> return value was undefined/undetermined/undocumented, omitting a block >> simply causes exception, etc.) > > To give an example of code which is broken by Enumerator: > > File.open("2.6.28-rc6-rc7.patch"){|f|f.lines[1..3]} > NoMethodError: undefined method `[]' for # > from (irb):1 > from (irb):1:in `open' > from (irb):1 > from :0 Ruby 1.8.6 did not have {IO,File}#lines. It first appeared in 1.8.7 as part of backport from 1.9. You must be confusing with something else. -- Akinori MUSHA / http://akinori.org/