2010/2/12 John Ydil <john.gendrot / cnsi.fr>:

> Thanks again Robert but (there is always a BUT)....
>
> I copy paste the code you gave me

> =A0 =A0 =A0 =A0File.to_enum(:foreach, "/etc/raddb/users").each_slice 4 do
> |name, ip, dump, table|
> =A0 =A0 =A0 =A0puts name.strip!
> =A0 =A0 =A0 =A0puts ip.strip!
> =A0 =A0 =A0 =A0puts table.strip!
> end
>
> ./test.rb:31: undefined method `each_slice' for #<struct Enum inst=3DFile=
,
> args=3D[:foreach, "/etc/raddb/users"]> (NoMethodError)
>
>
> I think we progress....

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


--=20
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/