This is a sample from a tar file class I created for a chef cookbook. In this example I'm iterating over entries in the tar file. Because of the way tar handles filenames over 100 chars (././@LongLink) I have to do something to register that i'm dealing a longlink and treat the next entry differently.
I would love any advice on how to clean this up. Its a super long method, I especially don't like that I have to set full_name
to nil and twice.
@josephholsten
I agree,
gzip_reader
shouldn't be in here, just consider that we are working with a IO stream.I don't really have any tests for this specifically. I have a test-kitchen wrapper that you could run. I have no good excuses =) I'm still learning to flex that muscle.
bundle exec kitchen test
You may want to replace my simple .tar.gz in the files directory with a real java tar.gz. You can see the tests all under the appropriate directory. I can give more details if needed. =)
@mwhooker
Yes, that is accurate.
@mattupstate
That may work. I don't know how I feel about
map!
though, can we just assign that output to a new variable?