steverb.com

Things I Felt Like Posting

Recursively Extracting A Zip File in Ruby

Recently I had the need to let a user upload a zip file and then have the Ruby app extract it and store it in a DB. I turned to google, but beyond some posts recommending using rubyzip to do the zip file handling I couldn't find anything showing a good way to do this recursively without first actually extracting the zip file to disk and then using the dir object. 

After much adding and deleting code I have something that works reasonably well. More...