From: Dimitri Aivaliotis Date: 2006-04-07T05:32:18+09:00 Subject: Re: Archive::Tar uncompress question Hi Dan, On 4/6/06, Berger, Daniel wrote: > It basically boils down to a case of unexpected usage. The assumption > is that you're creating (or going to create) an archive when you use > Archive::Tar.new. > I actually chose Archive::Tar over Archive::Tar::Minitar because I needed something quick-and-dirty that could handle all the kinds of archives in my original post. My application only deals with the un-packing of these archives - the originals stay where they are, and my app doesn't create them. > You are, of course, free to redefine uncompress_archive, but rather than > patching the lib itself, I recommend taking advantage of Ruby's open > classes: > > # Somewhere in your code: This is actually what I have done. I just presented it in pseudo-patch form for conciseness, and perhaps to convince you that it really isn't an error, but could be handled differently. :) > I suppose I could add class methods that would do the sort of thing > you're trying to do. Or, you could add your own class method. A la module Archive class Tar attr_accessor :compressed_archive_name end end ? That still involves redefinition. I try to avoid that with non-standard-lib libraries. You never know when the name is going to change. :) > Also note that I'll probably be changing the name to > Archive::Tar::External in the future. > Ok, thanks. Interesting naming discussion this started... - Dimitri