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,185 +0,0 @@
1
- ---
2
- title: FAQ
3
- nav_order: 71
4
- ---
5
-
6
- == Frequently Asked Questions
7
-
8
- === General Questions
9
-
10
- ==== What is Omnizip?
11
-
12
- Omnizip is a pure Ruby compression library supporting multiple compression algorithms (LZMA, LZMA2, BZip2, PPMd, Deflate, Zstandard) and archive formats (7z, ZIP, RAR, TAR, etc.) with zero external dependencies.
13
-
14
- ==== Why use Omnizip?
15
-
16
- * **Portability** - Works on all Ruby platforms (MRI, JRuby, TruffleRuby)
17
- * **No Dependencies** - Zero external dependencies or native extensions
18
- * **Comprehensive** - Support for 10+ archive formats and 6 compression algorithms
19
- * **Extensible** - Registry-based plugin architecture
20
-
21
- ==== How fast is Omnizip?
22
-
23
- Pure Ruby implementation is 10-60x slower than native implementations:
24
-
25
- * LZMA encode: 13-15x slower
26
- * LZMA decode: 8-10x slower
27
- * BWT transform: 50-60x slower
28
-
29
- This is an acceptable trade-off for maximum portability.
30
-
31
- === Installation
32
-
33
- ==== What Ruby version is required?
34
-
35
- Ruby 3.0 or higher is required.
36
-
37
- ==== Does Omnizip work on JRuby?
38
-
39
- Yes, Omnizip works on JRuby 9.4+.
40
-
41
- ==== Does Omnizip work on TruffleRuby?
42
-
43
- Yes, Omnizip works on TruffleRuby 22+.
44
-
45
- === Usage
46
-
47
- ==== How do I compress a file?
48
-
49
- [source,bash]
50
- ----
51
- omnizip compress input.txt output.lzma
52
- ----
53
-
54
- [source,ruby]
55
- ----
56
- Omnizip.compress_file('input.txt', 'output.lzma')
57
- ----
58
-
59
- ==== How do I create an archive?
60
-
61
- [source,bash]
62
- ----
63
- omnizip archive create backup.7z documents/
64
- ----
65
-
66
- [source,ruby]
67
- ----
68
- writer = Omnizip::Formats::SevenZip::Writer.new('backup.7z')
69
- writer.add_directory('documents/')
70
- writer.close
71
- ----
72
-
73
- ==== How do I extract an archive?
74
-
75
- [source,bash]
76
- ----
77
- omnizip archive extract backup.7z output/
78
- ----
79
-
80
- [source,ruby]
81
- ----
82
- reader = Omnizip::Formats::SevenZip::Reader.new('backup.7z')
83
- reader.extract_all('output/')
84
- reader.close
85
- ----
86
-
87
- ==== What compression level should I use?
88
-
89
- * **Levels 1-3**: Fast compression for temporary files
90
- * **Levels 4-6**: Balanced speed/ratio for general use (default: 5)
91
- * **Levels 7-9**: Maximum compression for storage
92
-
93
- === Compatibility
94
-
95
- ==== Can Omnizip extract 7-Zip archives?
96
-
97
- Yes, Omnizip can extract archives created by 7-Zip.
98
-
99
- ==== Can Omnizip create ZIP files?
100
-
101
- Yes, Omnizip can create ZIP files compatible with all ZIP tools.
102
-
103
- ==== Can Omnizip create RAR archives?
104
-
105
- Yes, Omnizip can create RAR5 archives using pure Ruby implementation.
106
-
107
- === Performance
108
-
109
- ==== How can I speed up compression?
110
-
111
- 1. Use lower compression levels (--level 1-3)
112
- 2. Use faster algorithms (zstandard, deflate)
113
- 3. Enable parallel processing (--threads)
114
- 4. Use compression profiles for automatic selection
115
-
116
- ==== Why is compression slow?
117
-
118
- Pure Ruby implementation prioritizes portability over performance. Native implementations are 10-60x faster but require platform-specific compilation.
119
-
120
- === Troubleshooting
121
-
122
- ==== Compression failed with "Algorithm not found"
123
-
124
- Ensure the algorithm name is correct:
125
-
126
- [source,bash]
127
- ----
128
- omnizip list # See available algorithms
129
- ----
130
-
131
- ==== Archive extraction failed
132
-
133
- Verify the archive is not corrupted:
134
-
135
- [source,bash]
136
- ----
137
- omnizip archive list archive.7z
138
- ----
139
-
140
- Try different extraction options or check file integrity.
141
-
142
- ==== Out of memory error
143
-
144
- For large files, consider:
145
-
146
- 1. Using chunked processing
147
- 2. Reducing compression level
148
- 3. Using faster algorithms
149
-
150
- === Advanced
151
-
152
- ==== How do I use filters?
153
-
154
- [source,bash]
155
- ----
156
- omnizip archive create binaries.7z app.exe --filters bcj_x86
157
- ----
158
-
159
- [source,ruby]
160
- ----
161
- writer = Omnizip::Formats::SevenZip::Writer.new('binaries.7z',
162
- filters: [:bcj_x86]
163
- )
164
- ----
165
-
166
- ==== How do I encrypt archives?
167
-
168
- [source,bash]
169
- ----
170
- omnizip archive create secure.7z data/ --password "PASSWORD"
171
- ----
172
-
173
- [source,ruby]
174
- ----
175
- writer = Omnizip::Formats::SevenZip::Writer.new('secure.7z',
176
- password: 'PASSWORD'
177
- )
178
- ----
179
-
180
- === See Also
181
-
182
- * link:../getting-started/[Getting Started]
183
- * link:../guides/[Usage Guides]
184
- * link:../troubleshooting/[Troubleshooting]
185
- * link:../resources/quick-reference[Quick Reference]
@@ -1,222 +0,0 @@
1
- ---
2
- title: Quick Reference
3
- nav_order: 70
4
- ---
5
-
6
- == Quick Reference
7
-
8
- Cheat sheet for common Omnizip operations.
9
-
10
- === Command-Line Quick Reference
11
-
12
- ==== File Compression
13
-
14
- [source,bash]
15
- ----
16
- # Basic compression
17
- omnizip compress INPUT OUTPUT
18
-
19
- # With algorithm and level
20
- omnizip compress INPUT OUTPUT --algorithm ALGORITHM --level N
21
-
22
- # Pipe mode
23
- cat INPUT | omnizip compress - OUTPUT
24
- ----
25
-
26
- ==== Archive Operations
27
-
28
- [source,bash]
29
- ----
30
- # Create archive
31
- omnizip archive create OUTPUT INPUT...
32
-
33
- # Extract archive
34
- omnizip archive extract ARCHIVE [OUTPUT_DIR]
35
-
36
- # List contents
37
- omnizip archive list ARCHIVE
38
- ----
39
-
40
- ==== Common Options
41
-
42
- `--algorithm`:: Compression algorithm (lzma, lzma2, bzip2, ppmd7, deflate, zstandard)
43
- `--level N`:: Compression level (1-9)
44
- `--verbose`, `-v`:: Verbose output
45
- `--help`, `-h`:: Show help
46
-
47
- === Ruby API Quick Reference
48
-
49
- ==== Convenience Methods
50
-
51
- [source,ruby]
52
- ----
53
- # Compress file
54
- Omnizip.compress_file('input.txt', 'output.lzma')
55
-
56
- # Decompress file
57
- Omnizip.decompress_file('output.lzma', 'restored.txt')
58
-
59
- # Extract archive
60
- Omnizip.extract_archive('archive.7z', 'output/')
61
-
62
- # List archive
63
- Omnizip.list_archive('archive.7z')
64
- ----
65
-
66
- ==== Registry Methods
67
-
68
- [source,ruby]
69
- ----
70
- # Get algorithm
71
- algorithm = Omnizip::AlgorithmRegistry.get(:lzma2).new(level: 9)
72
-
73
- # Get format writer
74
- writer = Omnizip::FormatRegistry.get(:seven_zip).new_writer('archive.7z')
75
- ----
76
-
77
- === Compression Algorithm Quick Reference
78
-
79
- [cols="1,1,2,2"]
80
- |===
81
- |Algorithm |Option |Speed |Best For
82
-
83
- |LZMA
84
- |--algorithm lzma
85
- |Slow
86
- |Maximum compression
87
-
88
- |LZMA2
89
- |--algorithm lzma2 (default)
90
- |Slow
91
- |Archives, backups
92
-
93
- |BZip2
94
- |--algorithm bzip2
95
- |Medium
96
- |Text files
97
-
98
- |PPMd7
99
- |--algorithm ppmd7
100
- |Medium
101
- |Text, documents
102
-
103
- |Deflate
104
- |--algorithm deflate
105
- |Fast
106
- |Compatibility
107
-
108
- |Zstandard
109
- |--algorithm zstandard
110
- |Very Fast
111
- |Speed-sensitive
112
- |===
113
-
114
- === Compression Level Quick Reference
115
-
116
- [cols="1,1,2"]
117
- |===
118
- |Level |Option |Use Case
119
-
120
- |1
121
- |--level 1
122
- |Fastest, temporary files
123
-
124
- |3
125
- |--level 3
126
- |Fast, frequent operations
127
-
128
- |5
129
- |--level 5 (default)
130
- |Balanced, general use
131
-
132
- |7
133
- |--level 7
134
- |High compression, storage
135
-
136
- |9
137
- |--level 9
138
- |Maximum compression
139
- |===
140
-
141
- === Archive Format Quick Reference
142
-
143
- [cols="1,2,2"]
144
- |===
145
- |Format |Extension |Best For
146
-
147
- |7z
148
- |.7z
149
- |Maximum compression, solid archives
150
-
151
- |ZIP
152
- |.zip
153
- |Cross-platform compatibility
154
-
155
- |RAR4/RAR5
156
- |.rar
157
- |Binary distribution, multi-volume
158
-
159
- |TAR
160
- |.tar
161
- |Unix backups
162
-
163
- |GZIP
164
- |.gz
165
- |Single file compression
166
-
167
- |XZ
168
- |.xz
169
- |System packages
170
- |===
171
-
172
- === Common Patterns
173
-
174
- ==== Backup Script
175
-
176
- [source,bash]
177
- ----
178
- #!/bin/bash
179
- DATE=$(date +%Y%m%d)
180
- omnizip archive create "backup_${DATE}.7z" \
181
- documents/ projects/ \
182
- --level 7 --solid
183
- ----
184
-
185
- ==== Batch Compression
186
-
187
- [source,bash]
188
- ----
189
- for file in *.txt; do
190
- omnizip compress "$file" "${file}.lzma" --level 5
191
- done
192
- ----
193
-
194
- ==== Ruby Backup Script
195
-
196
- [source,ruby]
197
- ----
198
- require 'omnizip'
199
- require 'time'
200
-
201
- timestamp = Time.now.strftime('%Y%m%d')
202
- archive_name = "backup_#{timestamp}.7z"
203
-
204
- writer = Omnizip::Formats::SevenZip::Writer.new(archive_name,
205
- level: 7,
206
- solid: true
207
- )
208
-
209
- %w[documents projects].each do |dir|
210
- writer.add_directory(dir) if Dir.exist?(dir)
211
- end
212
-
213
- writer.close
214
- puts "Created #{archive_name}"
215
- ----
216
-
217
- === See Also
218
-
219
- * link:../getting-started/quick-start[Quick Start Guide]
220
- * link:../guides/basic-usage/[Basic Usage Guides]
221
- * link:../reference/cli/[CLI Reference]
222
- * link:../reference/api/[API Reference]
@@ -1,207 +0,0 @@
1
- ---
2
- title: Troubleshooting
3
- nav_order: 80
4
- ---
5
-
6
- == Troubleshooting
7
-
8
- Common problems and solutions when using Omnizip.
9
-
10
- === Common Issues
11
-
12
- ==== "Algorithm not found" Error
13
-
14
- **Problem**: Compression fails with algorithm not found error.
15
-
16
- **Solution**: Check available algorithms:
17
-
18
- [source,bash]
19
- ----
20
- omnizip list
21
- ----
22
-
23
- [source,ruby]
24
- ----
25
- Omnizip::AlgorithmRegistry.registered.each do |name|
26
- puts name
27
- end
28
- ----
29
-
30
- **Causes**:
31
- * Typo in algorithm name
32
- * Algorithm not registered
33
-
34
- ==== "File not found" Error
35
-
36
- **Problem**: Cannot read input file.
37
-
38
- **Solution**: Verify file paths and permissions:
39
-
40
- [source,bash]
41
- ----
42
- # Check file exists
43
- ls -la input.txt
44
-
45
- # Check permissions
46
- chmod +r input.txt
47
- ----
48
-
49
- ==== "Out of memory" Error
50
-
51
- **Problem**: Large file compression fails.
52
-
53
- **Solutions**:
54
-
55
- 1. Use lower compression level:
56
- [source,bash]
57
- ----
58
- omnizip compress large.txt output.lzma --level 1
59
- ----
60
-
61
- 2. Use faster algorithm:
62
- [source,bash]
63
- ----
64
- omnizip compress large.txt output.zst --algorithm zstandard
65
- ----
66
-
67
- 3. Use chunked processing:
68
- [source,ruby]
69
- ----
70
- Omnizip.compress_file_chunked('large.txt', 'output.lzma',
71
- chunk_size: 10 * 1024 * 1024
72
- )
73
- ----
74
-
75
- ==== "Archive corrupted" Error
76
-
77
- **Problem**: Cannot extract archive.
78
-
79
- **Solutions**:
80
-
81
- 1. Verify archive integrity:
82
- [source,bash]
83
- ----
84
- omnizip archive list archive.7z
85
- ----
86
-
87
- 2. Try recovery mode:
88
- [source,ruby]
89
- ----
90
- reader = Omnizip::Formats::SevenZip::Reader.new('archive.7z',
91
- salvage_mode: true
92
- )
93
- reader.extract_all('output/')
94
- ----
95
-
96
- 3. Check CRC:
97
- [source,ruby]
98
- ----
99
- if Omnizip::Checksums.verify_file('archive.7z', :crc32)
100
- puts "Archive is valid"
101
- else
102
- puts "Archive is corrupted"
103
- end
104
- ----
105
-
106
- === Performance Issues
107
-
108
- ==== Slow Compression
109
-
110
- **Solutions**:
111
-
112
- 1. Use lower compression level:
113
- [source,bash]
114
- ----
115
- omnizip compress input.txt output.lzma --level 3
116
- ----
117
-
118
- 2. Use faster algorithm:
119
- [source,bash]
120
- ----
121
- omnizip compress input.txt output.zst --algorithm zstandard
122
- ----
123
-
124
- 3. Run independent archives in parallel processes (see the
125
- link:../guides/advanced-features/parallel-processing.html[Parallel Processing guide]):
126
- [source,ruby]
127
- ----
128
- dirs = %w[data_a data_b]
129
- pids = dirs.map do |dir|
130
- Process.fork { Omnizip.compress_directory(dir, "#{dir}.7z") }
131
- end
132
- pids.each { |pid| Process.wait(pid) }
133
- ----
134
-
135
- ==== Slow Decompression
136
-
137
- **Solutions**:
138
-
139
- 1. Use buffered reading:
140
- [source,ruby]
141
- ----
142
- reader = Omnizip::Formats::SevenZip::Reader.new('archive.7z',
143
- buffer_size: 1024 * 1024
144
- )
145
- reader.extract_all('output/')
146
- ----
147
-
148
- 2. Extract specific files only:
149
- [source,bash]
150
- ----
151
- omnizip archive extract archive.7z output/ \
152
- --pattern 'important.txt'
153
- ----
154
-
155
- === Format-Specific Issues
156
-
157
- ==== 7z Issues
158
-
159
- **Problem**: 7z archive not compatible with 7-Zip.
160
-
161
- **Solution**: Ensure standard options:
162
-
163
- [source,ruby]
164
- ----
165
- writer = Omnizip::Formats::SevenZip::Writer.new('archive.7z',
166
- algorithm: :lzma2,
167
- level: 5 # Standard level
168
- )
169
- ----
170
-
171
- ==== ZIP Issues
172
-
173
- **Problem**: ZIP not readable by other tools.
174
-
175
- **Solution**: Use Deflate algorithm:
176
-
177
- [source,bash]
178
- ----
179
- omnizip archive create archive.zip files/ \
180
- --algorithm deflate --level 5
181
- ----
182
-
183
- ==== RAR Issues
184
-
185
- **Problem**: RAR extraction fails.
186
-
187
- **Solution**: Verify RAR version:
188
-
189
- [source,ruby]
190
- ----
191
- # One reader covers both RAR4 and RAR5 (version auto-detected)
192
- reader = Omnizip::Formats::Rar::Reader.new('archive.rar')
193
- ----
194
-
195
- ### Getting Help
196
-
197
- If you continue to have issues:
198
-
199
- 1. Check link:../resources/faq[FAQ]
200
- 2. Review link:../guides/[usage guides]
201
- 3. Search link:https://github.com/metanorma/omnizip/issues[GitHub issues]
202
- 4. Create a new issue with:
203
- * Omnizip version
204
- * Ruby version
205
- * Operating system
206
- * Error message
207
- * Minimal reproduction code