Where you have been using
File.open("some_file").collect #in 1.8

Most ruby programmers probably would've used:
File.readlines("some_file")

It is shorter (by 3 whole characters), does the same thing as your
code, and has the added benefit of not using collect in a  quirky way.
Array#collect is for sending data into a block and getting the result
of the block back collected into an array.
When used without a block the usage is opaque. And though terse it is
hard to understand the implied {|x| x }.

Try File.readlines("some_file"). Try it and you may I say. Try it, try
it and you may...
Tim


On Dec 5, 9:40    ꮮ
> Under ruby 1.8.6, running
>
> [1, 2, 3].collect
>
> results in an array of [1, 2, 3].  ±  >
> [1, 2, 3].collect
>
> results in an Enumerator, which I then have to call .to_a on.
> Alternately, I can supply a block
>
> [1, 2, 3].collect {|x| x }
>
> and end up with an array.    > of {|x| x} was removed from the function.    
> anyone had any insight into why that change was made, because it feels
> very counter intuitive to me. I really liked the elegance of opening
> up a file and just calling collect to turn it into an array.





> --
> Posted viahttp://www.ruby-forum.com/.