-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems when both rubyzip and zipruby installed #6
Conversation
…efine Zip::File. Patching rubyzip to use correct namespace
Is there a reason not to merge this? |
This would be very useful to merge in, rather than more of us needing to fork and modify rubyzip with this change. Also, it could also be fixed with zipruby changing the module namespace to ZipRuby::* instead of the same Zip::*. I had the same problem, but solved it the other way. I created a zipruby fork that addresses this problem by renaming the zipruby module Zip::* to ZipRuby::* https://github.com/jawspeak/zipruby-compatibility-with-rubyzip-fork |
This also addresses a conflict with selenium webdriver. For now I'm just using the mezza fork but it would be nice to see this merged in. http://code.google.com/p/selenium/issues/detail?id=1003#makechanges |
I cannot merge this pull automatically. |
Thanks for merging this in! Could you publish a new release of the gem please? |
Why using rubyzip and zipruby in one project? zipruby is outdate library. Last release was January 23, 2010. |
The comments in my code indicate that rubyzip does not allow you to mutate files entirely in memory. If you have sensitive data, you cannot let it touch the disk. Has this changed? |
master branch of rubyzip has support of StringIO so you can working with zip archives in memory. |
is that ready for release? |
can you test master branch? I want to have more users who using rubyzip with StringIO. Probably release ready but i need to be sure. |
guys) have huge problems with these both gems :( Please help me!!! |
Fixed bug with checking for password= function
This is so that zipruby can interoperate with rubyzip. Previously, both defined Zip::File. That was not cool, because if you had a project that used rubyzip, when you introduced rubyzip, then it will no longer work. You'd get errors like this: "undefined method `exists?' for Zip::File:Class" Another workaround is rubyzip/rubyzip#6 where they describe changing rubyzip.
I've been using rubyzip in a rails application to create custom XLSX files by compressing an expanded XLSX document tree and using ErB to replace the contents of one xml file. However, I've been experiencing a number of issues with Excel complaining about errors with the resulting XLSX file, and so tested expanding and compressing a simple XLSX file to see what happens. I also tried using rubyzip just to replace the contents of one of entries in a zip archive.
It seems that rubyzip is compressing the file in a subtly different manner from that expected by Excel, and the only solution I've found is to use zipruby instead just to modify the contents of the files I want to edit. This works fine.
However both rubyzip and zipruby define Zip::File, and other areas of the application that use other dependent gems, eg roo, have issues with Zip::File.exists? which is defined in both zip gems.
I've tried using Bundler to load gems specific to a given method, but this doesn't seem to work, and so the only other solution that works for me is to explicitly specify the namespace for any ::File method invocations.
This seems to work fine, with tests passing as well.
If you know of any other solutions I'd be interested to know, otherwise I'd request that the changes be pulled.