What zip library works well with Ruby 1.9.2?

2019-02-25 19:24发布

I used the rubyzip gem in Ruby 1.8.7 before, but I heard rubyzip doesn't work well with ruby 1.9.2.

What zip libraries work well with Ruby 1.9.2?

3条回答
劳资没心,怎么记你
2楼-- · 2019-02-25 19:55

I found zip it says it's compatible with 1.9.1 I don't think it would have any issues in 1.9.2

查看更多
成全新的幸福
3楼-- · 2019-02-25 19:58

I used rubyzip gem in Ruby 1.8.7 also. For Ruby 1.9.x you need to use version 0.9.5 or higher. Works without any problems.

查看更多
狗以群分
4楼-- · 2019-02-25 20:02

Have you actually tried using rubyzip with 1.9.2? Seems to work fine for me:

>> RUBY_VERSION 
#=> "1.9.2"
>> require 'zip/zip' 
#=> true
>> Zip::ZipFile.foreach(File.expand_path("~/Downloads/Archive.zip")) { |f| p f } 
#=> [bartxt, footxt]
bar.txt
foo.txt
查看更多
登录 后发表回答