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.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop-oss.yml +814 -0
  3. data/.rubocop.yml +15 -1
  4. data/.rubocop_todo.yml +7 -1
  5. data/CHANGELOG.md +17 -0
  6. data/Gemfile +23 -1
  7. data/README.adoc +101 -1282
  8. data/docs/compatibility.adoc +1 -2
  9. data/docs/lychee.toml +1 -7
  10. data/lib/omnizip/algorithms/deflate/constants.rb +5 -3
  11. data/lib/omnizip/implementations/rust/archive.rb +9 -41
  12. data/lib/omnizip/implementations/rust/ffi_library.rb +127 -0
  13. data/lib/omnizip/implementations/rust/fiddle_library.rb +144 -0
  14. data/lib/omnizip/implementations/rust/library.rb +39 -104
  15. data/lib/omnizip/implementations/rust.rb +2 -0
  16. data/lib/omnizip/version.rb +1 -1
  17. data/lib/tasks/docs.rake +146 -0
  18. data/readme-docs/rar-archives.adoc +505 -0
  19. data/scripts/generate_rar_oracle_fixtures.rb +177 -0
  20. data/vendor/libomnizip_ffi.so +0 -0
  21. metadata +21 -74
  22. data/TODO.refactor/00-overview.md +0 -67
  23. data/TODO.refactor/01-registry-base-class.md +0 -81
  24. data/TODO.refactor/02-error-hierarchy.md +0 -57
  25. data/TODO.refactor/03-autoload-entry-point.md +0 -69
  26. data/TODO.refactor/04-filter-base-consolidation.md +0 -49
  27. data/TODO.refactor/05-send-private-methods.md +0 -64
  28. data/TODO.refactor/06-instance-variable-access.md +0 -69
  29. data/TODO.refactor/07-respond-to-replacement.md +0 -237
  30. data/TODO.refactor/08-spec-doubles.md +0 -27
  31. data/TODO.refactor/09-cli-shared-module.md +0 -35
  32. data/TODO.refactor/10-format-detector-ocp.md +0 -34
  33. data/TODO.refactor/11-convenience-decoupling.md +0 -38
  34. data/TODO.refactor/12-thread-safety.md +0 -8
  35. data/TODO.refactor/13-lutaml-model-migration.md +0 -158
  36. data/TODO.refactor/14-add-missing-specs.md +0 -25
  37. data/docs/.github/workflows/docs.yml +0 -142
  38. data/docs/.gitignore +0 -21
  39. data/docs/Gemfile +0 -13
  40. data/docs/README.md +0 -101
  41. data/docs/_config.yml +0 -112
  42. data/docs/comparison/feature-matrix.adoc +0 -694
  43. data/docs/comparison/index.adoc +0 -113
  44. data/docs/comparison/vs-7zip.adoc +0 -309
  45. data/docs/comparison/vs-peazip.adoc +0 -77
  46. data/docs/comparison/vs-rubyzip.adoc +0 -342
  47. data/docs/comparison/vs-winrar.adoc +0 -100
  48. data/docs/concepts/index.adoc +0 -129
  49. data/docs/developer/architecture.adoc +0 -256
  50. data/docs/developer/contributing.adoc +0 -158
  51. data/docs/developer/index.adoc +0 -25
  52. data/docs/developer/testing.adoc +0 -212
  53. data/docs/getting-started/basic-usage.adoc +0 -263
  54. data/docs/getting-started/index.adoc +0 -42
  55. data/docs/getting-started/installation.adoc +0 -138
  56. data/docs/getting-started/quick-start.adoc +0 -183
  57. data/docs/getting-started/your-first-archive.adoc +0 -219
  58. data/docs/guides/advanced-features/encryption.adoc +0 -277
  59. data/docs/guides/advanced-features/index.adoc +0 -59
  60. data/docs/guides/advanced-features/parallel-processing.adoc +0 -144
  61. data/docs/guides/advanced-features/progress-tracking.adoc +0 -124
  62. data/docs/guides/advanced-features/streaming.adoc +0 -142
  63. data/docs/guides/archive-formats/gzip-format.adoc +0 -105
  64. data/docs/guides/archive-formats/index.adoc +0 -160
  65. data/docs/guides/archive-formats/ole-format.adoc +0 -151
  66. data/docs/guides/archive-formats/rar-format.adoc +0 -104
  67. data/docs/guides/archive-formats/rar5.adoc +0 -521
  68. data/docs/guides/archive-formats/rpm-format.adoc +0 -108
  69. data/docs/guides/archive-formats/seven-zip-format.adoc +0 -35
  70. data/docs/guides/archive-formats/tar-format.adoc +0 -106
  71. data/docs/guides/archive-formats/xz-format.adoc +0 -118
  72. data/docs/guides/archive-formats/zip-format.adoc +0 -35
  73. data/docs/guides/compression-algorithms/bzip2.adoc +0 -114
  74. data/docs/guides/compression-algorithms/deflate.adoc +0 -313
  75. data/docs/guides/compression-algorithms/index.adoc +0 -190
  76. data/docs/guides/compression-algorithms/lzma.adoc +0 -394
  77. data/docs/guides/compression-algorithms/lzma2.adoc +0 -244
  78. data/docs/guides/compression-algorithms/ppmd.adoc +0 -313
  79. data/docs/guides/compression-algorithms/zstandard.adoc +0 -296
  80. data/docs/guides/creating-archives.adoc +0 -348
  81. data/docs/guides/extracting-archives.adoc +0 -53
  82. data/docs/guides/format-conversion.adoc +0 -64
  83. data/docs/guides/index.adoc +0 -49
  84. data/docs/guides/migration-rubyzip.adoc +0 -217
  85. data/docs/guides/parity-archives.adoc +0 -605
  86. data/docs/guides/performance-tuning.adoc +0 -88
  87. data/docs/index.adoc +0 -228
  88. data/docs/reference/api/overview.adoc +0 -187
  89. data/docs/reference/cli/compress-command.adoc +0 -114
  90. data/docs/reference/cli/overview.adoc +0 -140
  91. data/docs/reference/index.adoc +0 -26
  92. data/docs/resources/faq.adoc +0 -185
  93. data/docs/resources/quick-reference.adoc +0 -222
  94. data/docs/troubleshooting/index.adoc +0 -207
@@ -1,348 +0,0 @@
1
- ---
2
- title: Creating Archives
3
- nav_order: 1
4
- parent: Guides
5
- ---
6
-
7
- == Creating Archives
8
-
9
- Step-by-step guide to creating archives with Omnizip.
10
-
11
- == Quick Examples
12
-
13
- === Create ZIP Archive
14
-
15
- [source,ruby]
16
- ----
17
- require 'omnizip'
18
-
19
- Omnizip::Archive.create('backup.zip') do |archive|
20
- archive.add_file('document.pdf')
21
- archive.add_directory('photos/')
22
- end
23
- ----
24
-
25
- === Create 7z Archive
26
-
27
- [source,ruby]
28
- ----
29
- Omnizip::Archive.create('backup.7z', format: :seven_zip) do |archive|
30
- archive.add_directory('data/')
31
- end
32
- ----
33
-
34
- === Create RAR5 Archive
35
-
36
- [source,ruby]
37
- ----
38
- require 'omnizip/formats/rar/rar5/writer'
39
-
40
- # STORE compression (uncompressed)
41
- writer = Omnizip::Formats::Rar::Rar5::Writer.new('archive.rar')
42
- writer.add_file('document.txt')
43
- writer.add_file('image.png')
44
- writer.write
45
-
46
- # LZMA compression (default level 3)
47
- writer = Omnizip::Formats::Rar::Rar5::Writer.new('archive.rar',
48
- compression: :lzma
49
- )
50
- writer.add_file('large_dataset.json')
51
- writer.write
52
-
53
- # LZMA level 5 (best compression)
54
- writer = Omnizip::Formats::Rar::Rar5::Writer.new('archive.rar',
55
- compression: :lzma,
56
- level: 5
57
- )
58
- writer.add_directory('photos/')
59
- writer.write
60
-
61
- # Include modification time
62
- writer = Omnizip::Formats::Rar::Rar5::Writer.new('archive.rar',
63
- include_mtime: true
64
- )
65
- writer.add_file('document.txt')
66
- writer.write
67
-
68
- # Include CRC32 (STORE compression only)
69
- writer = Omnizip::Formats::Rar::Rar5::Writer.new('archive.rar',
70
- compression: :store,
71
- include_crc32: true
72
- )
73
- writer.add_file('data.bin')
74
- writer.write
75
- ----
76
-
77
- IMPORTANT: RAR5 CRC32 checksums only work with STORE compression. When LZMA is used, CRC32 is automatically disabled. Use BLAKE2sp (always present) for compressed file integrity.
78
-
79
- === RAR5 Multi-Volume Archives
80
-
81
- Split large archives across multiple volumes:
82
-
83
- [source,ruby]
84
- ----
85
- require 'omnizip/formats/rar/rar5/writer'
86
-
87
- # Basic multi-volume with default naming (part1, part2, ...)
88
- writer = Omnizip::Formats::Rar::Rar5::Writer.new('backup.rar',
89
- multi_volume: true,
90
- volume_size: '100M' # Human-readable sizes supported
91
- )
92
- writer.add_directory('large_dataset/')
93
- volumes = writer.write
94
- # => ['backup.part1.rar', 'backup.part2.rar', ...]
95
-
96
- # Custom volume naming patterns
97
- writer = Omnizip::Formats::Rar::Rar5::Writer.new('data.rar',
98
- multi_volume: true,
99
- volume_size: '4.7GB', # CD/DVD sizes
100
- volume_naming: 'numeric' # data.001.rar, data.002.rar, ...
101
- )
102
- writer.add_file('huge_database.sql')
103
- volumes = writer.write
104
-
105
- # Volume naming options:
106
- # - 'part' (default): archive.part1.rar, archive.part2.rar
107
- # - 'volume': archive.volume1.rar, archive.volume2.rar
108
- # - 'numeric': archive.001.rar, archive.002.rar
109
-
110
- # Minimum volume size: 64 KB
111
- ----
112
-
113
- === RAR5 Solid Archives
114
-
115
- `solid: true` requests a shared solid block, but the RAR-compatible
116
- LZSS encoder is not implemented yet — the writer warns and writes
117
- independent STORE entries instead, so the archive stays extractable
118
- by official unrar:
119
-
120
- [source,ruby]
121
- ----
122
- require 'omnizip/formats/rar/rar5/writer'
123
-
124
- writer = Omnizip::Formats::Rar::Rar5::Writer.new('project.rar',
125
- solid: true # warns: falls back to independent STORE entries
126
- )
127
- writer.add_directory('source_code/')
128
- writer.write
129
- ----
130
-
131
- Solid compression (shared dictionary across files, better ratios
132
- for similar content) arrives when the RAR-compatible LZSS encoder
133
- lands.
134
- ----
135
-
136
- === RAR5 AES-256 Encryption
137
-
138
- Password-protect archives with industry-standard encryption:
139
-
140
- [source,ruby]
141
- ----
142
- require 'omnizip/formats/rar/rar5/writer'
143
-
144
- # Basic password protection
145
- writer = Omnizip::Formats::Rar::Rar5::Writer.new('secure.rar',
146
- compression: :lzma,
147
- password: 'SecurePassword123!'
148
- )
149
- writer.add_file('confidential.pdf')
150
- writer.write
151
-
152
- # Custom key derivation iterations (higher = more secure, slower)
153
- writer = Omnizip::Formats::Rar::Rar5::Writer.new('protected.rar',
154
- compression: :lzma,
155
- level: 5,
156
- password: 'VerySecurePassword2025!',
157
- kdf_iterations: 524_288 # 2^19, more secure than default
158
- )
159
- writer.add_directory('sensitive_data/')
160
- writer.write
161
-
162
- # KDF iteration options:
163
- # - 65,536 (2^16): Minimum, fast but less secure
164
- # - 262,144 (2^18): Default, balanced security/performance
165
- # - 1,048,576 (2^20): Maximum, strongest security
166
-
167
- # Security features:
168
- # - AES-256-CBC encryption with PKCS#7 padding
169
- # - PBKDF2-HMAC-SHA256 key derivation
170
- # - Per-file IV generation
171
- # - Password verification before decryption
172
- ----
173
-
174
- === RAR5 PAR2 Recovery Records
175
-
176
- Add error correction for archive recovery:
177
-
178
- [source,ruby]
179
- ----
180
- require 'omnizip/formats/rar/rar5/writer'
181
-
182
- # Enable PAR2 recovery with default 5% redundancy
183
- writer = Omnizip::Formats::Rar::Rar5::Writer.new('backup.rar',
184
- compression: :lzma,
185
- recovery: true
186
- )
187
- writer.add_directory('important_data/')
188
- files = writer.write
189
- # => ['backup.rar', 'backup.par2', 'backup.vol00+01.par2', ...]
190
-
191
- # Custom redundancy percentage
192
- writer = Omnizip::Formats::Rar::Rar5::Writer.new('critical.rar',
193
- compression: :lzma,
194
- level: 5,
195
- recovery: true,
196
- recovery_percent: 15 # Can recover up to 15% data loss
197
- )
198
- writer.add_file('mission_critical.db')
199
- files = writer.write
200
-
201
- # Redundancy guidelines:
202
- # - 5% (default): General backups
203
- # - 10%: Important data
204
- # - 20-30%: High-value data
205
- # - 50-100%: Maximum protection
206
-
207
- # Recovery capabilities:
208
- # - Detect corruption at block level
209
- # - Repair damaged archives automatically
210
- # - Works with multi-volume, solid, and encrypted archives
211
- ----
212
-
213
- === RAR5 Combined Features
214
-
215
- Use all features together for comprehensive protection:
216
-
217
- [source,ruby]
218
- ----
219
- require 'omnizip/formats/rar/rar5/writer'
220
-
221
- # Production-ready backup configuration
222
- writer = Omnizip::Formats::Rar::Rar5::Writer.new('complete_backup.rar',
223
- # Compression
224
- compression: :lzma,
225
- level: 5,
226
- solid: true,
227
-
228
- # Security
229
- password: 'SecureBackup2025!',
230
- kdf_iterations: 262_144,
231
-
232
- # Multi-volume
233
- multi_volume: true,
234
- volume_size: '4G', # DVD-sized volumes
235
- volume_naming: 'part',
236
-
237
- # Recovery
238
- recovery: true,
239
- recovery_percent: 10,
240
-
241
- # Optional fields
242
- include_mtime: true
243
- )
244
-
245
- writer.add_directory('/critical/data')
246
- writer.add_directory('/important/documents')
247
- files = writer.write
248
-
249
- puts "Backup created: #{files.size} files"
250
- archive_files = files.select { |f| f.end_with?('.rar') }
251
- par2_files = files.select { |f| f.include?('.par2') }
252
- puts " Archive volumes: #{archive_files.size}"
253
- puts " PAR2 files: #{par2_files.size}"
254
- puts " Total size: #{files.sum { |f| File.size(f) } / 1024 / 1024}MB"
255
- ----
256
-
257
- === RAR5 Best Practices
258
-
259
- **For Maximum Compatibility:**
260
- [source,ruby]
261
- ----
262
- writer = Omnizip::Formats::Rar::Rar5::Writer.new('archive.rar',
263
- compression: :lzma,
264
- level: 5, # Honored by the 7z-style writers; RAR5 entries
265
- # are STORE until the LZSS encoder lands
266
- include_mtime: true
267
- )
268
- ----
269
-
270
- **For Important Data:**
271
- [source,ruby]
272
- ----
273
- writer = Omnizip::Formats::Rar::Rar5::Writer.new('backup.rar',
274
- compression: :lzma,
275
- level: 3, # Balanced performance
276
- recovery: true,
277
- recovery_percent: 15, # 15% redundancy
278
- include_mtime: true
279
- )
280
- ----
281
-
282
- **For Optical Media:**
283
- [source,ruby]
284
- ----
285
- writer = Omnizip::Formats::Rar::Rar5::Writer.new('archive.rar',
286
- compression: :lzma,
287
- level: 5,
288
- solid: true,
289
- multi_volume: true,
290
- volume_size: '4.7GB', # DVD size
291
- recovery: true,
292
- include_mtime: true
293
- )
294
- ----
295
-
296
- **For Secure Archives:**
297
- [source,ruby]
298
- ----
299
- writer = Omnizip::Formats::Rar::Rar5::Writer.new('secure.rar',
300
- compression: :lzma,
301
- level: 5,
302
- password: ENV['BACKUP_PASSWORD'],
303
- kdf_iterations: 524_288, # Enhanced security
304
- recovery: true,
305
- recovery_percent: 10,
306
- include_mtime: true
307
- )
308
- ----
309
-
310
- == Adding Files
311
-
312
- === Individual Files
313
-
314
- [source,ruby]
315
- ----
316
- archive.add_file('source.txt', 'dest.txt')
317
- ----
318
-
319
- === Directories
320
-
321
- [source,ruby]
322
- ----
323
- archive.add_directory('folder/')
324
- ----
325
-
326
- === From Data
327
-
328
- [source,ruby]
329
- ----
330
- archive.add_data('config.json', JSON.generate(config))
331
- ----
332
-
333
- == Compression Options
334
-
335
- [source,ruby]
336
- ----
337
- Omnizip::Archive.create('archive.7z',
338
- format: :seven_zip,
339
- algorithm: :lzma2,
340
- level: 9) do |archive|
341
- # ...
342
- end
343
- ----
344
-
345
- == See Also
346
-
347
- * link:extracting-archives.html[Extracting Archives]
348
- * link:../reference/api/overview.html[Ruby API]
@@ -1,53 +0,0 @@
1
- ---
2
- title: Extracting Archives
3
- nav_order: 2
4
- parent: Guides
5
- ---
6
-
7
- == Extracting Archives
8
-
9
- Guide to extracting files from archives.
10
-
11
- == Quick Examples
12
-
13
- === Extract All Files
14
-
15
- [source,ruby]
16
- ----
17
- require 'omnizip'
18
-
19
- Omnizip::Archive.open('backup.zip') do |archive|
20
- archive.extract_all('output/')
21
- end
22
- ----
23
-
24
- === Extract Specific Files
25
-
26
- [source,ruby]
27
- ----
28
- Omnizip::Archive.open('backup.zip') do |archive|
29
- archive.extract('document.pdf', 'restored/document.pdf')
30
- end
31
- ----
32
-
33
- === List Contents
34
-
35
- [source,ruby]
36
- ----
37
- entries = Omnizip.list_archive('backup.zip')
38
- entries.each do |entry|
39
- puts "#{entry.name}: #{entry.size} bytes"
40
- end
41
- ----
42
-
43
- == Pattern Matching
44
-
45
- [source,ruby]
46
- ----
47
- archive.extract_matching('*.txt', 'output/')
48
- ----
49
-
50
- == See Also
51
-
52
- * link:creating-archives.html[Creating Archives]
53
- * link:../reference/api/overview.html[Ruby API]
@@ -1,64 +0,0 @@
1
- ---
2
- title: Format Conversion
3
- nav_order: 3
4
- parent: Guides
5
- ---
6
-
7
- == Format Conversion
8
-
9
- Converting archives between different formats.
10
-
11
- == ZIP to 7z
12
-
13
- [source,ruby]
14
- ----
15
- require 'omnizip'
16
-
17
- Omnizip::Archive.open('input.zip') do |zip_archive|
18
- Omnizip::Archive.create('output.7z', format: :seven_zip) do |sevenz_archive|
19
- zip_archive.entries.each do |entry|
20
- next if entry.directory?
21
- data = zip_archive.read(entry.name)
22
- sevenz_archive.add_data(entry.name, data)
23
- end
24
- end
25
- end
26
- ----
27
-
28
- == 7z to ZIP
29
-
30
- [source,ruby]
31
- ----
32
- Omnizip::Archive.open('input.7z') do |sevenz_archive|
33
- Omnizip::Archive.create('output.zip', format: :zip) do |zip_archive|
34
- sevenz_archive.entries.each do |entry|
35
- next if entry.directory?
36
- data = sevenz_archive.read(entry.name)
37
- zip_archive.add_data(entry.name, data)
38
- end
39
- end
40
- end
41
- ----
42
-
43
- == Batch Conversion
44
-
45
- [source,ruby]
46
- ----
47
- Dir.glob('*.zip').each do |zip_file|
48
- sevenz_file = zip_file.sub('.zip', '.7z')
49
-
50
- Omnizip::Archive.open(zip_file) do |src|
51
- Omnizip::Archive.create(sevenz_file, format: :seven_zip, level: 9) do |dest|
52
- src.entries.each do |entry|
53
- next if entry.directory?
54
- dest.add_data(entry.name, src.read(entry.name))
55
- end
56
- end
57
- end
58
- end
59
- ----
60
-
61
- == See Also
62
-
63
- * link:creating-archives.html[Creating Archives]
64
- * link:../comparison/feature-matrix.html[Format Comparison]
@@ -1,49 +0,0 @@
1
- ---
2
- title: Guides
3
- nav_order: 10
4
- has_children: true
5
- ---
6
-
7
- == Guides
8
-
9
- Comprehensive guides for all Omnizip features and formats.
10
-
11
- === Core Operations
12
-
13
- * link:creating-archives.html[Creating Archives] - Build new archives with comprehensive examples
14
- * link:extracting-archives.html[Extracting Archives] - Extract files from archives
15
- * link:format-conversion.html[Format Conversion] - Convert between archive formats
16
-
17
- === Compression Algorithms
18
-
19
- * link:compression-algorithms/[Compression Algorithms Overview] - Algorithm comparison and selection guide
20
- * link:compression-algorithms/lzma.html[LZMA] - High compression ratio algorithm
21
- * link:compression-algorithms/lzma2.html[LZMA2] - Enhanced LZMA with multi-threading
22
- * link:compression-algorithms/bzip2.html[BZip2] - Text file compression
23
- * link:compression-algorithms/ppmd.html[PPMd] - Prediction by Partial Matching for text
24
- * link:compression-algorithms/deflate.html[Deflate] - ZIP-compatible compression
25
- * link:compression-algorithms/zstandard.html[Zstandard] - Modern fast compression
26
-
27
- === Archive Formats
28
-
29
- * link:archive-formats/[Archive Formats Overview] - Format comparison and selection guide
30
- * link:archive-formats/seven-zip-format.html[7z Format] - 7-Zip archives with solid compression
31
- * link:archive-formats/zip-format.html[ZIP Format] - ZIP archives with ZIP64 support
32
- * link:archive-formats/rar-format.html[RAR Format] - RAR4/RAR5 archives (read-only)
33
- * link:archive-formats/tar-format.html[TAR Format] - TAR archives with POSIX extensions
34
- * link:archive-formats/gzip-format.html[GZIP Format] - GZIP single file compression
35
- * link:archive-formats/xz-format.html[XZ Format] - XZ compressed files with LZMA2
36
-
37
- === Advanced Features
38
-
39
- * link:advanced-features/[Advanced Features Overview] - Power user features
40
- * link:advanced-features/streaming.html[Streaming Operations] - Memory-efficient processing
41
- * link:advanced-features/parallel-processing.html[Parallel Processing] - Multi-threaded compression
42
- * link:advanced-features/progress-tracking.html[Progress Tracking] - Real-time progress monitoring
43
- * link:advanced-features/encryption.html[Encryption] - AES-256 password protection
44
-
45
- === Migration & Optimization
46
-
47
- * link:migration-rubyzip.html[Migrating from Rubyzip] - Migration guide for rubyzip users
48
- * link:performance-tuning.html[Performance Tuning] - Optimize compression performance
49
- * link:parity-archives.html[PAR2 Parity Archives] - Error correction and recovery