From: ded Date: 2005-09-04T01:11:27+09:00 Subject: Re: Zip Extraction Bug? Thomas, While you're making a list of Todo for zlib, I thought I would pass along a couple of other things I noticed. Some of these may just be my newbitude with respect to the ruby language. 1. "rake test" fails on my system because it assumes that each directory has a .cvsignore file (which are not part of the distribution). After doing a "touch .cvsignore" in each of the installation directories, the problem went away. 2. I used Zip::ZipFile.each to enumerate the entries in the archive, but in reading the documentation it looks like "foreach" is the iterator. When I tried that, I got an error saying there was no such method for the Zip::ZipFile class. There is an "each" but that does not appear in the documentation. 3. I would have found it really helpful to see an example of iterating through a zip archive and extracting all the entries. The documentation appears to lack one for this very common unzip operation. 4. A design issue. I would have thought it natural for "extract" to default the second argument to "./entry.name" so that in the most common case, it would not need to be supplied. 5. Another design issue. It would seem more natural to me to make "extract" a method of the Zip::ZipEntry class, which would defult to extracting itself into the current directory with the entry name. That way, an unzip operation would become: Zip::ZipFile.open("archive.zip").each { |entry| entry.extract } Extraction now requires an awkward reference to the Zip::ZipFile object inside the block. 6. The extract method should have a parameter that specifies whether over-writing an existing file should occur. In my opinion, it should default to overwriting, but I'll concede that that may be the wrong choice. My two cents. Thanks for the great library, and keep up the good work. Thanks, Dan Doherty (ded) P.S. Strip off the -google part of my email address if you want to send e-mail. I dump all the -google stuff, which is rife with spammers.