Menu

#1 Extract API and Doc Improvements

open
None
5
2012-07-18
2005-09-03
No

I posted these on comp.lang.ruby, but realized that this is
probably the better place for these.

  1. It would be 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.

  2. 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.

  3. 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.

  1. 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.

Discussion

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.