
Datamapper's addition of emtpy? and size to Enumerable leads to weird issues with fileutils.
Reported by Jonas Nicklas | February 6th, 2010 @ 08:37 AM | in 1.0.0
Basically, fileutils makes files enumerable, which means that they gain the size and empty? methods from Enumerable that datamapper patches in. This in itself wouldn't be that bad, if those methods didn't actually return incorrect values.
This pastie illustrates the problem: http://pastie.org/812376
Clearly, the size is bigger than 1, and the file is not empty. Yet the implementation of Enumerable#size and Enumerable#empty? returns just these values.
Imho, it doesn't make sense for all enumberables to have a size, and Datamapper shouldn't be patching in these methods.
Comments and changes to this ticket
-
Dan Kubb (dkubb) February 7th, 2010 @ 01:24 AM
- State changed from new to accepted
- Assigned user set to Dan Kubb (dkubb)
- Milestone set to 1.0.0
-
Dan Kubb (dkubb) February 7th, 2010 @ 02:50 AM
- State changed from accepted to resolved
(from [f5df62c3c0cd95739e4d747beeb41fc9ce8710f1]) Removed Enumerable patches
- Not sure what I was thinking when I added these methods. Patching Enumerable was a mistake for more than just this specific ticket.
[#1195 state:resolved] http://github.com/datamapper/dm-core/commit/f5df62c3c0cd95739e4d747...
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
People watching this ticket
Referenced by
-
1195 Datamapper's addition of emtpy? and size to Enumerable leads to weird issues with fileutils. [#1195 state:resolved] http://github.com/datamapper/dm-c...