DM 10.2 does: module Enumerable ... def size size = 0 each { size += 1 } size end end
RightAWS S3 put streaming does: if (data.respond_to?(:lstat) && data.lstat.size >= USE_100_CONTINUE_PUT_SIZE) || (data.respond_to?(:size) && data.size >= USE_100_CONTINUE_PUT_SIZE) headers['expect'] = '100-continue' end Note that data is often File.open('...') (an IO object), and then .size will actually read from the file. I'm not sure how deep the Enum size thing is in DM 10.2 (I bet it's pretty involved to remove it), so I'm patching up RightAWS with the following: if (data.respond_to?(:lstat) && data.lstat.size >= USE_100_CONTINUE_PUT_SIZE) || (!data.respond_to?(:lstat) && data.respond_to?(:size) && data.size >= USE_100_CONTINUE_PUT_SIZE) headers['expect'] = '100-continue' end -Gary (who seems to be the king of weird bugs lately) -- You received this message because you are subscribed to the Google Groups "DataMapper" group. To post to this group, send email to datamap...@googlegroups.com. To unsubscribe from this group, send email to datamapper+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/datamapper?hl=en.