You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rubyzip is a ruby library for reading and writing zip files.
Rubyzip is a ruby library for reading and writing zip files.
## Important note
Rubyzip interface changed!!! No need to do `require "zip/zip"` and `Zip` prefix in class names removed.
The Rubyzip interface has changed!!! No need to do `require "zip/zip"` and `Zip` prefix in class names removed.
If you have issues with any third-party gems that require an old version of rubyzip, you can use this workaround:
Expand All
@@ -22,7 +22,7 @@ gem 'zip-zip' # will load compatibility for old rubyzip API.
* Ruby 1.9.2 or greater
## Installation
rubyzip is available on RubyGems, so:
Rubyzip is available on RubyGems:
```
gem install rubyzip
Expand DownExpand Up
@@ -110,7 +110,7 @@ end
### Save zip archive entries in sorted by name state
To saving zip archives in sorted order like below you need to set `::Zip.sort_entries` to `true`
To save zip archives in sorted order like below, you need to set `::Zip.sort_entries` to `true`
```
Vegetable/
Expand All
@@ -124,7 +124,7 @@ fruit/mango
fruit/orange
```
After this entries in zip archive will be saved in ordered state.
After this, entries in the zip archive will be saved in ordered state.
### Reading a Zip file
Expand All
@@ -150,17 +150,17 @@ end
`::Zip::InputStream` usable for fast reading zip file content because it not read Central directory.
But there is one exception when it not working - General Purpose Flag Bit 3.
But there is one exception when it is not working - General Purpose Flag Bit 3.
```
If bit 3 (0x08) of the general-purpose flags field is set, then the CRC-32 and file sizes are not known when the header is written. The fields in the local header are filled with zero, and the CRC-32 and size are appended in a 12-byte structure (optionally preceded by a 4-byte signature) immediately after the compressed data
```
If `::Zip::InputStream` will found such entry in zip archive it will raise exception.
If `::Zip::InputStream` finds such entry in the zip archive it will raise an exception.
### Password Protection (Experimental)
RubyZip supports reading/writing zip files with traditional zip encryption (a.k.a. "ZipCrypto"). AES encryption is not yet supported. It can be used with buffer streams, e.g.:
Rubyzip supports reading/writing zip files with traditional zip encryption (a.k.a. "ZipCrypto"). AES encryption is not yet supported. It can be used with buffer streams, e.g.:
```ruby
Zip::OutputStream.write_buffer(::StringIO.new(''), Zip::TraditionalEncrypter.new('password')) do |out|
Expand DownExpand Up
@@ -212,13 +212,13 @@ Additionally, if you want to configure rubyzip to overwrite existing files while
Zip.continue_on_exists_proc = true
```
If you want to store nonenglish names and want to open properly file on Windows(pre 7) you need to set next option:
If you want to store non-english names and want to open them on Windows(pre 7) you need to set this option:
```ruby
Zip.unicode_names = true
```
In some zip date of files stored in incorrect format. You can hide warning about it by using:
Some zip files might have an invalid date format, which will raise a warning. You can hide this warning with the following setting:
It defaults to `Zlib::DEFAULT_COMPRESSION`. Possible values are `Zlib::BEST_COMPRESSION`, `Zlib::DEFAULT_COMPRESSION` and `Zlib::NO_COMPRESSION`
All settings in same time
You can set multiple settings at the same time by using a block:
```ruby
Zip.setup do |c|
Expand All
@@ -242,7 +242,7 @@ All settings in same time
end
```
By default Zip64 support is disabled for writing. To enable it do next:
By default, Zip64 support is disabled for writing. To enable it do this:
```ruby
Zip.write_zip64_support = true
Expand All
@@ -252,7 +252,7 @@ _NOTE_: If you will enable Zip64 writing then you will need zip extractor with Z
## Developing
To run tests you need run next commands:
To run the test you need to do this:
```
bundle install
Expand All
@@ -279,5 +279,5 @@ extra-field support contributed by Tatsuki Sugiura (sugi at nemui.org)
## License
rubyzip is distributed under the same license as ruby. See
Rubyzip is distributed under the same license as ruby. See
http://www.ruby-lang.org/en/LICENSE.txt
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stable Ruby #412
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
Uh oh!
There was an error while loading. Please reload this page.
Stable Ruby #412
Changes from 1 commit
edf3126
d5f7982
b6f9176
47b72f5
930b5ae
04f6902
6a7a22f
f291e1f
31fb9d7
77b7d6c
1ba81ff
8533708
abb8c02
d6cc880
b1bfb1a
23cfcc7
2c8f6f8
b9aefaf
63b3ee3
b920a1e
112a77d
68b5fcf
068a3e7
f6693af
94c1df1
4b60095
784e70b
ce7e01a
96f3997
1759f71
aa83776
fd864bd
2007be0
e211434
32016ab
6a98297
1175abf
e1d5012
34899f3
6e8069e
faa45ef
d289780
63d388c
c0177a4
53fba8a
47aa16f
68181da
f7eec2d
37ede3c
13658b0
4c81b11
753eab1
8c13dfc
1e99ff6
bbd7cc4
9acc50f
8edb2bd
228cd4a
37a5baa
93528de
a1f75a3
0ac4a84
1a028fc
05a9ba3
04714ec
77acc03
a3ca219
7a4b8bb
e1ce501
8447f0e
9dd0912
6e1dea4
73a35d4
bee921b
73bfa59
4b41915
972749c
560bf5d
9a261bc
fb0b58c
62558f0
088f44a
3ec40d8
4a60771
66d6076
63c0ef0
4d86978
4b21d52
7aa3666
c0dccb1
b6896c4
046b7f8
4b27538
b0b54e5
7caab1f
7b14d11
b005c48
9366044
40eca74
3b75ffe
b2e65ca
36dc49b
e8def12
dee6fbe
331c4bb
63ed0d9
fc23f68
c00d767
366a1d8
6597af1
9c475f5
579e78f
80af58e
bf8ffa4
2569a65
fdc7a50
82fa57c
a0cf673
8126091
f157dfc
a4e3b55
8d1808f
c12b8b3
f34c1d9
4a7ec6a
33d0949
7c250c0
960414a
14b8fed
1dfce05
28c5dd5
df8dfbc
ce4208f
98f4f2e
722ee6e
258ef02
d80e720
9bfc52b
cf91112
41fcf0a
fc83680
3c0de6c
a9f020c
deb6616
1039b28
4ecb5b9
57c3772
a27204f
43f01f4
e19a5c1
e65bc45
cbdea2a
849e774
75cd0dc
5ac2707
2f6bc8e
ea98fa1
2f6b47d
ae9d8fb
50b01d0
6c2bddb
2f80da6
888ca88
792266d
ffd0b67
c0a8ad9
bdd57e1
05af123
c787d94
7cd263e
cfa9441
0363393
15ccc25
84c2089
cd7bb14
f073f64
8887b70
1673da7
aa6284d
6ea4a71
e89f6ac
6e0d231
8e78311
eda8862
cf71583
0586329
9c468f3
ffebfa3
3dd165b
8a1de58
ffb374c
cf35774
fd81bd5
d07b13a
afb1b79
9eac0d6
a420323
74f0d4e
0e6e626
cc7b18e
6aecdf9
3219d8e
bb34887
d40921b
fa4f7fb
d2f0f02
0f36838
8ece5c9
ad15c3c
fb1c230
a8609e1
249775f
ada408d
ef516bd
6f0b219
9d891f7
1e21121
952950e
2ffbc3b
5152f6f
b2573f6
fc23db2
8dfc95d
ee6fb82
7fbaf1e
eeef507
9a41ce6
0d85cb6
72e7ca0
09bb946
ecb2776
6619bf3
93505ca
94b7fa2
4167f0c
7849f73
97cb6ae
74d4bec
35446f4
d65fe7b
7c65e1e
e79d9ea
3641a96
e1d9af6
cb407b1
2825898
506d557
e871842
a9a313a
34d2074
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing