#1195 ✓resolved
Jonas Nicklas

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

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.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Referenced by

Pages