Join GitHub today
Added better support for windows mingw users #25
Had been running into a couple of problems since bumping a windows project I work on up to ruby1.8.7mingw recently. There were about 14 broken tests when I first got the tests running. Have fixed the majority of them I think, there's still 3 left, but the 3 remaining I believe are for legitimate reasons..
95 tests, 933 assertions, 1 failures, 2 errors
I've narrowed down the problem a bit.. If I just take a fresh copy of 5entry.zip I can unzip its contents to a local windows directory fine and all the files within it are fine also. If I then take that exact same zip file and run the following:
The file is now corrupt and will not extract properly anymore. I've spent a few hours trying to figure out why but I'm a bit stumped? Have you guys got any ideas? If I try and re-open it with your gem at this point, it chokes on the zlib inflater method with the same error as in the tests above if that helps.
Apologies about the syntax changes in the pull request also. I can remove them if you'd prefer? Let me know if you'd like me to change anything and I will.
added a commit
this pull request
Feb 7, 2012
I don't use the rename method for anything in my actual application so the gem works fine for everything I need.
..sorry alex.. it's nothing to do with the rename method.. it's the 5entry.zip file itself..
It's not a bug within the rubyzip gem, apologies.. I just tested it with some other zip files and it works fine. The problem is coming from the way the test files within 5entry.zip are being generated in the gentestfiles.rb
To reproduce.. This is my current environment:
Get a copy of zip.exe (Basically a windows version of Info-Zip) from here http://stahlworks.com/dev/zip.exe
Then just run:
This generates the 5entry.zip file now located at c:/rubyzip/test/data/generated/5entry.zip
If you try extracting the files from the zip at this point, it works correctly and everything extracts properly.
Now try extracting that same zip file and you'll find that the file is now corrupt and won't extract properly anymore?