omnizip 0.4.9-arm-linux → 0.4.11-arm-linux
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop-oss.yml +814 -0
- data/.rubocop.yml +15 -1
- data/.rubocop_todo.yml +7 -1
- data/CHANGELOG.md +17 -0
- data/Gemfile +23 -1
- data/README.adoc +101 -1282
- data/docs/compatibility.adoc +1 -2
- data/docs/lychee.toml +1 -7
- data/lib/omnizip/algorithms/deflate/constants.rb +5 -3
- data/lib/omnizip/implementations/rust/archive.rb +9 -41
- data/lib/omnizip/implementations/rust/ffi_library.rb +127 -0
- data/lib/omnizip/implementations/rust/fiddle_library.rb +144 -0
- data/lib/omnizip/implementations/rust/library.rb +39 -104
- data/lib/omnizip/implementations/rust.rb +2 -0
- data/lib/omnizip/version.rb +1 -1
- data/lib/tasks/docs.rake +146 -0
- data/readme-docs/rar-archives.adoc +505 -0
- data/scripts/generate_rar_oracle_fixtures.rb +177 -0
- data/vendor/libomnizip_ffi.so +0 -0
- metadata +21 -74
- data/TODO.refactor/00-overview.md +0 -67
- data/TODO.refactor/01-registry-base-class.md +0 -81
- data/TODO.refactor/02-error-hierarchy.md +0 -57
- data/TODO.refactor/03-autoload-entry-point.md +0 -69
- data/TODO.refactor/04-filter-base-consolidation.md +0 -49
- data/TODO.refactor/05-send-private-methods.md +0 -64
- data/TODO.refactor/06-instance-variable-access.md +0 -69
- data/TODO.refactor/07-respond-to-replacement.md +0 -237
- data/TODO.refactor/08-spec-doubles.md +0 -27
- data/TODO.refactor/09-cli-shared-module.md +0 -35
- data/TODO.refactor/10-format-detector-ocp.md +0 -34
- data/TODO.refactor/11-convenience-decoupling.md +0 -38
- data/TODO.refactor/12-thread-safety.md +0 -8
- data/TODO.refactor/13-lutaml-model-migration.md +0 -158
- data/TODO.refactor/14-add-missing-specs.md +0 -25
- data/docs/.github/workflows/docs.yml +0 -142
- data/docs/.gitignore +0 -21
- data/docs/Gemfile +0 -13
- data/docs/README.md +0 -101
- data/docs/_config.yml +0 -112
- data/docs/comparison/feature-matrix.adoc +0 -694
- data/docs/comparison/index.adoc +0 -113
- data/docs/comparison/vs-7zip.adoc +0 -309
- data/docs/comparison/vs-peazip.adoc +0 -77
- data/docs/comparison/vs-rubyzip.adoc +0 -342
- data/docs/comparison/vs-winrar.adoc +0 -100
- data/docs/concepts/index.adoc +0 -129
- data/docs/developer/architecture.adoc +0 -256
- data/docs/developer/contributing.adoc +0 -158
- data/docs/developer/index.adoc +0 -25
- data/docs/developer/testing.adoc +0 -212
- data/docs/getting-started/basic-usage.adoc +0 -263
- data/docs/getting-started/index.adoc +0 -42
- data/docs/getting-started/installation.adoc +0 -138
- data/docs/getting-started/quick-start.adoc +0 -183
- data/docs/getting-started/your-first-archive.adoc +0 -219
- data/docs/guides/advanced-features/encryption.adoc +0 -277
- data/docs/guides/advanced-features/index.adoc +0 -59
- data/docs/guides/advanced-features/parallel-processing.adoc +0 -144
- data/docs/guides/advanced-features/progress-tracking.adoc +0 -124
- data/docs/guides/advanced-features/streaming.adoc +0 -142
- data/docs/guides/archive-formats/gzip-format.adoc +0 -105
- data/docs/guides/archive-formats/index.adoc +0 -160
- data/docs/guides/archive-formats/ole-format.adoc +0 -151
- data/docs/guides/archive-formats/rar-format.adoc +0 -104
- data/docs/guides/archive-formats/rar5.adoc +0 -521
- data/docs/guides/archive-formats/rpm-format.adoc +0 -108
- data/docs/guides/archive-formats/seven-zip-format.adoc +0 -35
- data/docs/guides/archive-formats/tar-format.adoc +0 -106
- data/docs/guides/archive-formats/xz-format.adoc +0 -118
- data/docs/guides/archive-formats/zip-format.adoc +0 -35
- data/docs/guides/compression-algorithms/bzip2.adoc +0 -114
- data/docs/guides/compression-algorithms/deflate.adoc +0 -313
- data/docs/guides/compression-algorithms/index.adoc +0 -190
- data/docs/guides/compression-algorithms/lzma.adoc +0 -394
- data/docs/guides/compression-algorithms/lzma2.adoc +0 -244
- data/docs/guides/compression-algorithms/ppmd.adoc +0 -313
- data/docs/guides/compression-algorithms/zstandard.adoc +0 -296
- data/docs/guides/creating-archives.adoc +0 -348
- data/docs/guides/extracting-archives.adoc +0 -53
- data/docs/guides/format-conversion.adoc +0 -64
- data/docs/guides/index.adoc +0 -49
- data/docs/guides/migration-rubyzip.adoc +0 -217
- data/docs/guides/parity-archives.adoc +0 -605
- data/docs/guides/performance-tuning.adoc +0 -88
- data/docs/index.adoc +0 -228
- data/docs/reference/api/overview.adoc +0 -187
- data/docs/reference/cli/compress-command.adoc +0 -114
- data/docs/reference/cli/overview.adoc +0 -140
- data/docs/reference/index.adoc +0 -26
- data/docs/resources/faq.adoc +0 -185
- data/docs/resources/quick-reference.adoc +0 -222
- data/docs/troubleshooting/index.adoc +0 -207
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Migrating from Rubyzip
|
|
3
|
-
nav_order: 4
|
|
4
|
-
parent: Guides
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
== Migrating from Rubyzip
|
|
8
|
-
|
|
9
|
-
Complete guide to migrating from the rubyzip gem to Omnizip.
|
|
10
|
-
|
|
11
|
-
== Quick Migration
|
|
12
|
-
|
|
13
|
-
=== Step 1: Install Omnizip
|
|
14
|
-
|
|
15
|
-
[source,ruby]
|
|
16
|
-
----
|
|
17
|
-
# Gemfile
|
|
18
|
-
gem 'omnizip', '~> 1.0'
|
|
19
|
-
----
|
|
20
|
-
|
|
21
|
-
=== Step 2: Use Compatibility Layer
|
|
22
|
-
|
|
23
|
-
[source,ruby]
|
|
24
|
-
----
|
|
25
|
-
# Before (rubyzip)
|
|
26
|
-
require 'zip'
|
|
27
|
-
|
|
28
|
-
# After (Omnizip with compatibility)
|
|
29
|
-
require 'omnizip/rubyzip_compat'
|
|
30
|
-
|
|
31
|
-
# All existing Zip::* code works unchanged!
|
|
32
|
-
----
|
|
33
|
-
|
|
34
|
-
== Why Migrate?
|
|
35
|
-
|
|
36
|
-
✅ **Format Flexibility** - Support both ZIP and 7z formats
|
|
37
|
-
|
|
38
|
-
✅ **Better Compression** - LZMA2, BZip2, PPMd, Deflate64
|
|
39
|
-
|
|
40
|
-
✅ **Pure Ruby** - No external dependencies
|
|
41
|
-
|
|
42
|
-
✅ **Backward Compatible** - Drop-in replacement
|
|
43
|
-
|
|
44
|
-
✅ **Better Architecture** - Clean OOP design
|
|
45
|
-
|
|
46
|
-
== Code Examples
|
|
47
|
-
|
|
48
|
-
=== Creating Archives
|
|
49
|
-
|
|
50
|
-
**Before (rubyzip):**
|
|
51
|
-
|
|
52
|
-
[source,ruby]
|
|
53
|
-
----
|
|
54
|
-
Zip::File.open('archive.zip', create: true) do |zip|
|
|
55
|
-
zip.add('file.txt', 'path/to/file.txt')
|
|
56
|
-
end
|
|
57
|
-
----
|
|
58
|
-
|
|
59
|
-
**After (with compatibility layer):**
|
|
60
|
-
|
|
61
|
-
[source,ruby]
|
|
62
|
-
----
|
|
63
|
-
require 'omnizip/rubyzip_compat'
|
|
64
|
-
|
|
65
|
-
Zip::File.open('archive.zip', create: true) do |zip|
|
|
66
|
-
zip.add('file.txt', 'path/to/file.txt')
|
|
67
|
-
end
|
|
68
|
-
----
|
|
69
|
-
|
|
70
|
-
**After (enhanced API):**
|
|
71
|
-
|
|
72
|
-
[source,ruby]
|
|
73
|
-
----
|
|
74
|
-
require 'omnizip'
|
|
75
|
-
|
|
76
|
-
Omnizip::Archive.create('archive.zip') do |archive|
|
|
77
|
-
archive.add_file('path/to/file.txt', 'file.txt')
|
|
78
|
-
end
|
|
79
|
-
----
|
|
80
|
-
|
|
81
|
-
=== Extracting Archives
|
|
82
|
-
|
|
83
|
-
**Before (rubyzip):**
|
|
84
|
-
|
|
85
|
-
[source,ruby]
|
|
86
|
-
----
|
|
87
|
-
Zip::File.open('archive.zip') do |zip|
|
|
88
|
-
zip.each do |entry|
|
|
89
|
-
entry.extract("output/#{entry.name}")
|
|
90
|
-
end
|
|
91
|
-
end
|
|
92
|
-
----
|
|
93
|
-
|
|
94
|
-
**After (enhanced API):**
|
|
95
|
-
|
|
96
|
-
[source,ruby]
|
|
97
|
-
----
|
|
98
|
-
Omnizip::Archive.open('archive.zip') do |archive|
|
|
99
|
-
archive.extract_all('output/')
|
|
100
|
-
end
|
|
101
|
-
----
|
|
102
|
-
|
|
103
|
-
== Migration Strategies
|
|
104
|
-
|
|
105
|
-
=== Strategy 1: Drop-in Replacement
|
|
106
|
-
|
|
107
|
-
For simple codebases - just change the require:
|
|
108
|
-
|
|
109
|
-
[source,ruby]
|
|
110
|
-
----
|
|
111
|
-
# config/initializers/omnizip.rb
|
|
112
|
-
require 'omnizip/rubyzip_compat'
|
|
113
|
-
----
|
|
114
|
-
|
|
115
|
-
All existing `Zip::*` code works unchanged!
|
|
116
|
-
|
|
117
|
-
=== Strategy 2: Gradual Migration
|
|
118
|
-
|
|
119
|
-
Keep both gems during transition:
|
|
120
|
-
|
|
121
|
-
[source,ruby]
|
|
122
|
-
----
|
|
123
|
-
# Gemfile
|
|
124
|
-
gem 'rubyzip', '~> 3.0'
|
|
125
|
-
gem 'omnizip', '~> 1.0'
|
|
126
|
-
|
|
127
|
-
# Migrate file by file
|
|
128
|
-
require 'zip' # Old code
|
|
129
|
-
require 'omnizip' # New code
|
|
130
|
-
----
|
|
131
|
-
|
|
132
|
-
=== Strategy 3: Full Migration
|
|
133
|
-
|
|
134
|
-
New projects - use enhanced API:
|
|
135
|
-
|
|
136
|
-
[source,ruby]
|
|
137
|
-
----
|
|
138
|
-
require 'omnizip'
|
|
139
|
-
|
|
140
|
-
# Use Omnizip's improved API from the start
|
|
141
|
-
Omnizip::Archive.create('backup.7z', format: :seven_zip) do |archive|
|
|
142
|
-
archive.add_directory('data/')
|
|
143
|
-
end
|
|
144
|
-
----
|
|
145
|
-
|
|
146
|
-
== Common Patterns
|
|
147
|
-
|
|
148
|
-
=== Reading Archive Contents
|
|
149
|
-
|
|
150
|
-
[source,ruby]
|
|
151
|
-
----
|
|
152
|
-
Omnizip::Zip::File.open('archive.zip') do |zip|
|
|
153
|
-
zip.each do |entry|
|
|
154
|
-
next unless entry.file?
|
|
155
|
-
content = entry.get_input_stream.read
|
|
156
|
-
process(entry.name, content)
|
|
157
|
-
end
|
|
158
|
-
end
|
|
159
|
-
----
|
|
160
|
-
|
|
161
|
-
=== Streaming Operations
|
|
162
|
-
|
|
163
|
-
[source,ruby]
|
|
164
|
-
----
|
|
165
|
-
Omnizip::Zip::OutputStream.open('archive.zip') do |zos|
|
|
166
|
-
files.each do |file|
|
|
167
|
-
zos.put_next_entry(file[:name])
|
|
168
|
-
zos.write file[:data]
|
|
169
|
-
end
|
|
170
|
-
end
|
|
171
|
-
----
|
|
172
|
-
|
|
173
|
-
=== Encrypted Archives
|
|
174
|
-
|
|
175
|
-
[source,ruby]
|
|
176
|
-
----
|
|
177
|
-
# Use 7z for AES-256 encryption
|
|
178
|
-
Omnizip::Archive.create('secure.7z',
|
|
179
|
-
format: :seven_zip,
|
|
180
|
-
password: 'secret') do |archive|
|
|
181
|
-
archive.add_file('sensitive.txt')
|
|
182
|
-
end
|
|
183
|
-
----
|
|
184
|
-
|
|
185
|
-
== Migration Checklist
|
|
186
|
-
|
|
187
|
-
- [ ] Install Omnizip gem
|
|
188
|
-
- [ ] Choose migration strategy
|
|
189
|
-
- [ ] Update require statements
|
|
190
|
-
- [ ] Run tests
|
|
191
|
-
- [ ] Verify compatibility
|
|
192
|
-
- [ ] Deploy to staging
|
|
193
|
-
- [ ] Monitor performance
|
|
194
|
-
- [ ] Deploy to production
|
|
195
|
-
|
|
196
|
-
== Complete Migration Guide
|
|
197
|
-
|
|
198
|
-
For the complete migration guide with advanced topics, see:
|
|
199
|
-
|
|
200
|
-
* link:https://github.com/metanorma/omnizip/blob/main/MIGRATION_GUIDE.md[Full Migration Guide] (GitHub)
|
|
201
|
-
|
|
202
|
-
Topics covered in full guide:
|
|
203
|
-
|
|
204
|
-
* Advanced migration patterns
|
|
205
|
-
* Handling large files
|
|
206
|
-
* Using both libraries together
|
|
207
|
-
* Converting ZIP to 7z
|
|
208
|
-
* Integration testing
|
|
209
|
-
* Performance optimization
|
|
210
|
-
* Troubleshooting
|
|
211
|
-
* Rollback plan
|
|
212
|
-
|
|
213
|
-
== See Also
|
|
214
|
-
|
|
215
|
-
* link:../comparison/vs-rubyzip.html[Omnizip vs rubyzip Comparison]
|
|
216
|
-
* link:../getting-started/quick-start.html[Quick Start Guide]
|
|
217
|
-
* link:../reference/api/overview.html[Ruby API Reference]
|