omnizip 0.3.6 → 0.3.7
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_todo.yml +25 -134
- data/CHANGELOG.md +13 -0
- data/LICENSE +1 -1
- data/README.adoc +1 -1
- data/lib/omnizip/algorithm.rb +1 -1
- data/lib/omnizip/algorithms/bzip2/decoder.rb +0 -6
- data/lib/omnizip/algorithms/bzip2/encoder.rb +0 -6
- data/lib/omnizip/algorithms/bzip2.rb +11 -11
- data/lib/omnizip/algorithms/deflate/decoder.rb +0 -1
- data/lib/omnizip/algorithms/deflate/encoder.rb +0 -1
- data/lib/omnizip/algorithms/deflate.rb +5 -8
- data/lib/omnizip/algorithms/deflate64/decoder.rb +0 -2
- data/lib/omnizip/algorithms/deflate64/encoder.rb +0 -3
- data/lib/omnizip/algorithms/deflate64/huffman_coder.rb +0 -2
- data/lib/omnizip/algorithms/deflate64/lz77_encoder.rb +0 -2
- data/lib/omnizip/algorithms/deflate64.rb +7 -1
- data/lib/omnizip/algorithms/lzma/decoder.rb +1 -3
- data/lib/omnizip/algorithms/lzma/distance_coder.rb +0 -3
- data/lib/omnizip/algorithms/lzma/encoder.rb +0 -4
- data/lib/omnizip/algorithms/lzma/length_coder.rb +0 -3
- data/lib/omnizip/algorithms/lzma/literal_decoder.rb +0 -2
- data/lib/omnizip/algorithms/lzma/literal_encoder.rb +0 -2
- data/lib/omnizip/algorithms/lzma/lzip_decoder.rb +0 -2
- data/lib/omnizip/algorithms/lzma/lzma_alone_decoder.rb +0 -1
- data/lib/omnizip/algorithms/lzma/match_finder.rb +0 -2
- data/lib/omnizip/algorithms/lzma/match_finder_config.rb +1 -1
- data/lib/omnizip/algorithms/lzma/match_finder_factory.rb +1 -5
- data/lib/omnizip/algorithms/lzma/range_coder.rb +0 -3
- data/lib/omnizip/algorithms/lzma/range_decoder.rb +0 -2
- data/lib/omnizip/algorithms/lzma/range_encoder.rb +0 -2
- data/lib/omnizip/algorithms/lzma/xz_buffered_range_encoder.rb +0 -2
- data/lib/omnizip/algorithms/lzma/xz_encoder.rb +0 -6
- data/lib/omnizip/algorithms/lzma/xz_encoder_fast.rb +0 -6
- data/lib/omnizip/algorithms/lzma/xz_match_finder_adapter.rb +0 -3
- data/lib/omnizip/algorithms/lzma/xz_price_calculator.rb +0 -2
- data/lib/omnizip/algorithms/lzma/xz_probability_models.rb +0 -3
- data/lib/omnizip/algorithms/lzma/xz_range_encoder_exact.rb +0 -2
- data/lib/omnizip/algorithms/lzma/xz_utils_decoder.rb +9 -10
- data/lib/omnizip/algorithms/lzma.rb +46 -40
- data/lib/omnizip/algorithms/lzma2/chunk_manager.rb +0 -2
- data/lib/omnizip/algorithms/lzma2/constants.rb +0 -3
- data/lib/omnizip/algorithms/lzma2/encoder.rb +2 -4
- data/lib/omnizip/algorithms/lzma2/lzma2_chunk.rb +2 -0
- data/lib/omnizip/algorithms/lzma2/properties.rb +5 -3
- data/lib/omnizip/algorithms/lzma2/simple_lzma2_encoder.rb +1 -6
- data/lib/omnizip/algorithms/lzma2/xz_encoder_adapter.rb +0 -2
- data/lib/omnizip/algorithms/lzma2.rb +12 -14
- data/lib/omnizip/algorithms/ppmd7/context.rb +0 -3
- data/lib/omnizip/algorithms/ppmd7/decoder.rb +0 -3
- data/lib/omnizip/algorithms/ppmd7/encoder.rb +0 -3
- data/lib/omnizip/algorithms/ppmd7/model.rb +0 -3
- data/lib/omnizip/algorithms/ppmd7.rb +12 -8
- data/lib/omnizip/algorithms/ppmd8/context.rb +1 -1
- data/lib/omnizip/algorithms/ppmd8/decoder.rb +0 -3
- data/lib/omnizip/algorithms/ppmd8/encoder.rb +0 -3
- data/lib/omnizip/algorithms/ppmd8/model.rb +0 -4
- data/lib/omnizip/algorithms/ppmd8.rb +13 -7
- data/lib/omnizip/algorithms/ppmd_base.rb +1 -1
- data/lib/omnizip/algorithms/registration.rb +28 -0
- data/lib/omnizip/algorithms/sevenzip_lzma2.rb +4 -4
- data/lib/omnizip/algorithms/xz_lzma2.rb +4 -4
- data/lib/omnizip/algorithms/zstandard/decoder.rb +0 -6
- data/lib/omnizip/algorithms/zstandard/encoder.rb +0 -3
- data/lib/omnizip/algorithms/zstandard/frame/block.rb +0 -2
- data/lib/omnizip/algorithms/zstandard/frame/header.rb +0 -2
- data/lib/omnizip/algorithms/zstandard/frame.rb +33 -0
- data/lib/omnizip/algorithms/zstandard/fse/encoder.rb +0 -3
- data/lib/omnizip/algorithms/zstandard/fse/table.rb +0 -3
- data/lib/omnizip/algorithms/zstandard/fse.rb +34 -0
- data/lib/omnizip/algorithms/zstandard/huffman.rb +0 -3
- data/lib/omnizip/algorithms/zstandard/huffman_encoder.rb +0 -3
- data/lib/omnizip/algorithms/zstandard/literals.rb +0 -4
- data/lib/omnizip/algorithms/zstandard/literals_encoder.rb +0 -3
- data/lib/omnizip/algorithms/zstandard/sequences.rb +0 -4
- data/lib/omnizip/algorithms/zstandard.rb +22 -8
- data/lib/omnizip/algorithms.rb +21 -0
- data/lib/omnizip/buffer.rb +4 -2
- data/lib/omnizip/checksums/crc32.rb +3 -2
- data/lib/omnizip/checksums/crc64.rb +3 -2
- data/lib/omnizip/checksums/registration.rb +16 -0
- data/lib/omnizip/checksums/verifier.rb +0 -1
- data/lib/omnizip/checksums.rb +11 -0
- data/lib/omnizip/chunked.rb +5 -4
- data/lib/omnizip/cli.rb +13 -13
- data/lib/omnizip/commands/archive_create_command.rb +4 -4
- data/lib/omnizip/commands/archive_extract_command.rb +3 -3
- data/lib/omnizip/commands/archive_list_command.rb +3 -3
- data/lib/omnizip/commands/archive_repair_command.rb +1 -1
- data/lib/omnizip/commands/archive_verify_command.rb +1 -1
- data/lib/omnizip/commands/compress_command.rb +1 -1
- data/lib/omnizip/commands/decompress_command.rb +1 -1
- data/lib/omnizip/commands/list_command.rb +1 -1
- data/lib/omnizip/commands/metadata_command.rb +3 -3
- data/lib/omnizip/commands/parity_create_command.rb +1 -1
- data/lib/omnizip/commands/parity_repair_command.rb +1 -1
- data/lib/omnizip/commands/parity_verify_command.rb +1 -1
- data/lib/omnizip/commands/profile_list_command.rb +1 -1
- data/lib/omnizip/commands/profile_show_command.rb +1 -1
- data/lib/omnizip/commands.rb +21 -0
- data/lib/omnizip/converter/conversion_strategy.rb +0 -2
- data/lib/omnizip/converter/seven_zip_to_zip_strategy.rb +0 -5
- data/lib/omnizip/converter/zip_to_seven_zip_strategy.rb +0 -5
- data/lib/omnizip/converter.rb +8 -7
- data/lib/omnizip/eta/exponential_smoothing_estimator.rb +0 -3
- data/lib/omnizip/eta/moving_average_estimator.rb +0 -3
- data/lib/omnizip/eta.rb +11 -6
- data/lib/omnizip/extraction/filter_chain.rb +0 -2
- data/lib/omnizip/extraction/pattern_matcher.rb +0 -4
- data/lib/omnizip/extraction/selective_extractor.rb +0 -4
- data/lib/omnizip/extraction.rb +11 -7
- data/lib/omnizip/file_type.rb +1 -1
- data/lib/omnizip/filter_registry.rb +14 -47
- data/lib/omnizip/filters/bcj.rb +1 -3
- data/lib/omnizip/filters/bcj2/decoder.rb +0 -3
- data/lib/omnizip/filters/bcj2/encoder.rb +0 -3
- data/lib/omnizip/filters/bcj2/stream_data.rb +0 -2
- data/lib/omnizip/filters/bcj2.rb +1 -5
- data/lib/omnizip/filters/bcj_arm.rb +0 -2
- data/lib/omnizip/filters/bcj_arm64.rb +0 -2
- data/lib/omnizip/filters/bcj_ia64.rb +0 -2
- data/lib/omnizip/filters/bcj_ppc.rb +0 -2
- data/lib/omnizip/filters/bcj_sparc.rb +0 -2
- data/lib/omnizip/filters/bcj_x86.rb +1 -1
- data/lib/omnizip/filters/delta.rb +0 -2
- data/lib/omnizip/filters/registration.rb +22 -0
- data/lib/omnizip/filters/registry.rb +2 -12
- data/lib/omnizip/filters.rb +22 -0
- data/lib/omnizip/format_detector.rb +0 -5
- data/lib/omnizip/formats/bzip2_file.rb +2 -4
- data/lib/omnizip/formats/cpio/entry.rb +2 -2
- data/lib/omnizip/formats/cpio/reader.rb +2 -3
- data/lib/omnizip/formats/cpio/writer.rb +2 -3
- data/lib/omnizip/formats/cpio.rb +7 -6
- data/lib/omnizip/formats/format_spec_loader.rb +0 -2
- data/lib/omnizip/formats/gzip.rb +2 -2
- data/lib/omnizip/formats/iso/reader.rb +0 -3
- data/lib/omnizip/formats/iso/volume_builder.rb +0 -1
- data/lib/omnizip/formats/iso/writer.rb +0 -3
- data/lib/omnizip/formats/iso.rb +12 -14
- data/lib/omnizip/formats/lzip.rb +2 -4
- data/lib/omnizip/formats/lzma_alone.rb +2 -4
- data/lib/omnizip/formats/ole/allocation_table.rb +2 -2
- data/lib/omnizip/formats/ole/dirent.rb +2 -4
- data/lib/omnizip/formats/ole/header.rb +2 -3
- data/lib/omnizip/formats/ole/storage.rb +2 -6
- data/lib/omnizip/formats/ole.rb +18 -9
- data/lib/omnizip/formats/rar/archive_repairer.rb +0 -3
- data/lib/omnizip/formats/rar/archive_verifier.rb +0 -3
- data/lib/omnizip/formats/rar/block_parser.rb +2 -4
- data/lib/omnizip/formats/rar/compression/dispatcher.rb +0 -10
- data/lib/omnizip/formats/rar/compression/lz77_huffman/decoder.rb +0 -4
- data/lib/omnizip/formats/rar/compression/lz77_huffman/encoder.rb +0 -4
- data/lib/omnizip/formats/rar/compression/lz77_huffman.rb +25 -0
- data/lib/omnizip/formats/rar/compression/ppmd/context.rb +0 -2
- data/lib/omnizip/formats/rar/compression/ppmd/decoder.rb +0 -4
- data/lib/omnizip/formats/rar/compression/ppmd/encoder.rb +0 -5
- data/lib/omnizip/formats/rar/compression/ppmd.rb +16 -0
- data/lib/omnizip/formats/rar/compression.rb +17 -0
- data/lib/omnizip/formats/rar/external_writer.rb +0 -1
- data/lib/omnizip/formats/rar/header.rb +2 -3
- data/lib/omnizip/formats/rar/models.rb +14 -0
- data/lib/omnizip/formats/rar/rar5/compression/lzma.rb +1 -3
- data/lib/omnizip/formats/rar/rar5/encryption/aes256_cbc.rb +0 -1
- data/lib/omnizip/formats/rar/rar5/encryption/encryption_manager.rb +0 -4
- data/lib/omnizip/formats/rar/rar5/header.rb +0 -3
- data/lib/omnizip/formats/rar/rar5/multi_volume/volume_manager.rb +0 -4
- data/lib/omnizip/formats/rar/rar5/multi_volume/volume_writer.rb +0 -2
- data/lib/omnizip/formats/rar/rar5/solid/solid_encoder.rb +0 -1
- data/lib/omnizip/formats/rar/rar5/solid/solid_manager.rb +0 -3
- data/lib/omnizip/formats/rar/rar5/writer.rb +1 -14
- data/lib/omnizip/formats/rar/rar_format_base.rb +0 -2
- data/lib/omnizip/formats/rar/reader.rb +2 -10
- data/lib/omnizip/formats/rar/volume_manager.rb +0 -2
- data/lib/omnizip/formats/rar/writer.rb +2 -4
- data/lib/omnizip/formats/rar.rb +120 -152
- data/lib/omnizip/formats/rar3/compressor.rb +0 -2
- data/lib/omnizip/formats/rar3/decompressor.rb +0 -2
- data/lib/omnizip/formats/rar3/reader.rb +0 -3
- data/lib/omnizip/formats/rar3/writer.rb +0 -2
- data/lib/omnizip/formats/rar5/compressor.rb +0 -2
- data/lib/omnizip/formats/rar5/decompressor.rb +0 -2
- data/lib/omnizip/formats/rar5/reader.rb +0 -3
- data/lib/omnizip/formats/rar5/writer.rb +0 -2
- data/lib/omnizip/formats/rpm/entry.rb +2 -3
- data/lib/omnizip/formats/rpm/header.rb +2 -4
- data/lib/omnizip/formats/rpm/lead.rb +2 -3
- data/lib/omnizip/formats/rpm/tag.rb +2 -3
- data/lib/omnizip/formats/rpm/writer.rb +2 -9
- data/lib/omnizip/formats/rpm.rb +8 -8
- data/lib/omnizip/formats/seven_zip/bcj2_stream_decompressor.rb +2 -4
- data/lib/omnizip/formats/seven_zip/coder_chain.rb +2 -6
- data/lib/omnizip/formats/seven_zip/encoded_header.rb +2 -5
- data/lib/omnizip/formats/seven_zip/encrypted_header.rb +2 -4
- data/lib/omnizip/formats/seven_zip/file_collector.rb +0 -1
- data/lib/omnizip/formats/seven_zip/header.rb +2 -5
- data/lib/omnizip/formats/seven_zip/header_encryptor.rb +2 -3
- data/lib/omnizip/formats/seven_zip/header_writer.rb +2 -4
- data/lib/omnizip/formats/seven_zip/models/folder.rb +0 -2
- data/lib/omnizip/formats/seven_zip/models.rb +20 -0
- data/lib/omnizip/formats/seven_zip/parser.rb +5 -10
- data/lib/omnizip/formats/seven_zip/reader.rb +1 -11
- data/lib/omnizip/formats/seven_zip/split_archive_reader.rb +2 -8
- data/lib/omnizip/formats/seven_zip/split_archive_writer.rb +2 -8
- data/lib/omnizip/formats/seven_zip/stream_compressor.rb +1 -2
- data/lib/omnizip/formats/seven_zip/stream_decompressor.rb +2 -4
- data/lib/omnizip/formats/seven_zip/writer.rb +2 -11
- data/lib/omnizip/formats/seven_zip.rb +40 -18
- data/lib/omnizip/formats/tar/entry.rb +2 -2
- data/lib/omnizip/formats/tar/header.rb +2 -3
- data/lib/omnizip/formats/tar/reader.rb +2 -4
- data/lib/omnizip/formats/tar/writer.rb +2 -4
- data/lib/omnizip/formats/tar.rb +8 -7
- data/lib/omnizip/formats/xar/entry.rb +3 -4
- data/lib/omnizip/formats/xar/header.rb +2 -3
- data/lib/omnizip/formats/xar/reader.rb +2 -8
- data/lib/omnizip/formats/xar/toc.rb +2 -3
- data/lib/omnizip/formats/xar/writer.rb +2 -8
- data/lib/omnizip/formats/xar.rb +9 -8
- data/lib/omnizip/formats/xz/reader.rb +1 -2
- data/lib/omnizip/formats/{xz_impl → xz}/writer.rb +2 -7
- data/lib/omnizip/formats/xz.rb +10 -8
- data/lib/omnizip/formats/xz_impl/block_decoder.rb +12 -14
- data/lib/omnizip/formats/xz_impl/block_encoder.rb +3 -4
- data/lib/omnizip/formats/xz_impl/block_header.rb +1 -1
- data/lib/omnizip/formats/xz_impl/block_header_parser.rb +3 -5
- data/lib/omnizip/formats/xz_impl/index_decoder.rb +2 -3
- data/lib/omnizip/formats/xz_impl/index_encoder.rb +2 -3
- data/lib/omnizip/formats/xz_impl/stream_decoder.rb +1 -7
- data/lib/omnizip/formats/xz_impl/stream_encoder.rb +1 -7
- data/lib/omnizip/formats/xz_impl/stream_footer.rb +2 -3
- data/lib/omnizip/formats/xz_impl/stream_footer_parser.rb +2 -3
- data/lib/omnizip/formats/xz_impl/stream_header.rb +2 -3
- data/lib/omnizip/formats/xz_impl/stream_header_parser.rb +3 -4
- data/lib/omnizip/formats/xz_impl/vli.rb +1 -1
- data/lib/omnizip/formats/xz_impl.rb +52 -0
- data/lib/omnizip/formats/zip/central_directory_header.rb +2 -3
- data/lib/omnizip/formats/zip/end_of_central_directory.rb +2 -2
- data/lib/omnizip/formats/zip/local_file_header.rb +2 -2
- data/lib/omnizip/formats/zip/reader.rb +2 -7
- data/lib/omnizip/formats/zip/writer.rb +2 -7
- data/lib/omnizip/formats/zip/zip64_end_of_central_directory.rb +2 -2
- data/lib/omnizip/formats/zip/zip64_end_of_central_directory_locator.rb +2 -2
- data/lib/omnizip/formats/zip/zip64_extra_field.rb +2 -2
- data/lib/omnizip/formats/zip.rb +17 -8
- data/lib/omnizip/formats.rb +9 -0
- data/lib/omnizip/implementations/base.rb +19 -0
- data/lib/omnizip/implementations/seven_zip/lzma/decoder.rb +8 -9
- data/lib/omnizip/implementations/seven_zip/lzma/encoder.rb +0 -11
- data/lib/omnizip/implementations/seven_zip/lzma/match_finder.rb +0 -3
- data/lib/omnizip/implementations/seven_zip/lzma/range_decoder.rb +0 -3
- data/lib/omnizip/implementations/seven_zip/lzma/range_encoder.rb +0 -3
- data/lib/omnizip/implementations/seven_zip/lzma/state_machine.rb +0 -2
- data/lib/omnizip/implementations/seven_zip/lzma.rb +21 -0
- data/lib/omnizip/implementations/seven_zip/lzma2/encoder.rb +6 -9
- data/lib/omnizip/implementations/seven_zip/lzma2.rb +12 -0
- data/lib/omnizip/implementations/seven_zip.rb +11 -0
- data/lib/omnizip/implementations/xz_utils/lzma2/decoder.rb +1 -5
- data/lib/omnizip/implementations/xz_utils/lzma2/encoder.rb +1 -12
- data/lib/omnizip/implementations/xz_utils/lzma2.rb +13 -0
- data/lib/omnizip/implementations/xz_utils.rb +10 -0
- data/lib/omnizip/implementations.rb +11 -0
- data/lib/omnizip/link_handler.rb +2 -3
- data/lib/omnizip/metadata/metadata_editor.rb +0 -2
- data/lib/omnizip/metadata.rb +7 -6
- data/lib/omnizip/models/filter_chain.rb +0 -2
- data/lib/omnizip/models/filter_config.rb +5 -32
- data/lib/omnizip/parallel.rb +12 -7
- data/lib/omnizip/parity/chunked_block_processor.rb +0 -2
- data/lib/omnizip/parity/models/creator_packet.rb +0 -2
- data/lib/omnizip/parity/models/file_description_packet.rb +0 -2
- data/lib/omnizip/parity/models/ifsc_packet.rb +0 -12
- data/lib/omnizip/parity/models/main_packet.rb +0 -2
- data/lib/omnizip/parity/models/packet_registry.rb +0 -7
- data/lib/omnizip/parity/models/recovery_slice_packet.rb +0 -2
- data/lib/omnizip/parity/models.rb +27 -0
- data/lib/omnizip/parity/par2_creator.rb +0 -1
- data/lib/omnizip/parity/par2_repairer.rb +0 -3
- data/lib/omnizip/parity/par2_verifier.rb +0 -1
- data/lib/omnizip/parity/par2cmdline_algorithm.rb +0 -2
- data/lib/omnizip/parity/reed_solomon_decoder.rb +0 -3
- data/lib/omnizip/parity/reed_solomon_encoder.rb +0 -3
- data/lib/omnizip/parity/reed_solomon_matrix.rb +0 -3
- data/lib/omnizip/parity.rb +26 -5
- data/lib/omnizip/password/winzip_aes_strategy.rb +0 -2
- data/lib/omnizip/password/zip_crypto_strategy.rb +0 -3
- data/lib/omnizip/password.rb +7 -6
- data/lib/omnizip/pipe.rb +2 -3
- data/lib/omnizip/platform/ntfs_streams.rb +0 -1
- data/lib/omnizip/profile/archive_profile.rb +1 -2
- data/lib/omnizip/profile/balanced_profile.rb +0 -2
- data/lib/omnizip/profile/binary_profile.rb +1 -2
- data/lib/omnizip/profile/compression_profile.rb +1 -1
- data/lib/omnizip/profile/custom_profile.rb +0 -2
- data/lib/omnizip/profile/fast_profile.rb +0 -2
- data/lib/omnizip/profile/maximum_profile.rb +0 -2
- data/lib/omnizip/profile/profile_detector.rb +1 -1
- data/lib/omnizip/profile/text_profile.rb +1 -2
- data/lib/omnizip/profile.rb +13 -12
- data/lib/omnizip/profiler.rb +3 -4
- data/lib/omnizip/progress/callback_reporter.rb +0 -2
- data/lib/omnizip/progress/console_reporter.rb +0 -3
- data/lib/omnizip/progress/log_reporter.rb +0 -2
- data/lib/omnizip/progress/progress_tracker.rb +0 -3
- data/lib/omnizip/progress/silent_reporter.rb +0 -2
- data/lib/omnizip/progress.rb +13 -9
- data/lib/omnizip/rubyzip_compat.rb +1 -1
- data/lib/omnizip/temp/safe_extract.rb +0 -4
- data/lib/omnizip/temp.rb +5 -5
- data/lib/omnizip/version.rb +1 -1
- data/lib/omnizip/zip/entry.rb +0 -3
- data/lib/omnizip/zip/file.rb +0 -7
- data/lib/omnizip/zip/input_stream.rb +0 -4
- data/lib/omnizip/zip/output_stream.rb +0 -4
- data/lib/omnizip/zip.rb +9 -0
- data/lib/omnizip.rb +158 -91
- metadata +35 -13
- /data/lib/omnizip/formats/{xz_impl/constants.rb → xz_const.rb} +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 77e13c00351fadfa082ef58c3053379870550819c1f0b1ca8c51f6de35be21ad
|
|
4
|
+
data.tar.gz: b18a4614b01c6d0cd974103f7eb5aba464caf0ff467d4a108eacc5744dc44382
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 16b86cdedfe871db80695c62dad8fb63236aeb43662e0064ad76115986887ae5fe30bba1a827d5ef2f9f93ab6746c821f4a2fae2ea188dd1bb3425c3460f54e8
|
|
7
|
+
data.tar.gz: '088baddfb374607a12572d440662c9406aca7254e50a9ce3e8a2965135c56fbdde617b054ff2e0f7ccade0ba9916f71b594dce17e8add271f77487fdb9f4a185'
|
data/.rubocop_todo.yml
CHANGED
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on 2026-02-
|
|
3
|
+
# on 2026-02-23 11:56:10 UTC using RuboCop version 1.81.6.
|
|
4
4
|
# The point is for the user to remove these configuration records
|
|
5
5
|
# one by one as the offenses are removed from the code base.
|
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
|
8
8
|
|
|
9
|
-
# Offense count:
|
|
9
|
+
# Offense count: 69
|
|
10
10
|
# This cop supports safe autocorrection (--autocorrect).
|
|
11
11
|
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
|
12
12
|
# SupportedStyles: with_first_argument, with_fixed_indentation
|
|
13
13
|
Layout/ArgumentAlignment:
|
|
14
|
-
|
|
15
|
-
- 'lib/omnizip/formats/ole/dirent.rb'
|
|
16
|
-
- 'lib/omnizip/formats/ole/header.rb'
|
|
17
|
-
- 'lib/omnizip/formats/ole/storage.rb'
|
|
18
|
-
- 'lib/omnizip/formats/ole/types/variant.rb'
|
|
19
|
-
- 'lib/omnizip/formats/rpm/writer.rb'
|
|
20
|
-
- 'spec/omnizip/formats/integration_spec.rb'
|
|
14
|
+
Enabled: false
|
|
21
15
|
|
|
22
16
|
# Offense count: 1
|
|
23
17
|
# This cop supports safe autocorrection (--autocorrect).
|
|
@@ -25,106 +19,42 @@ Layout/ArgumentAlignment:
|
|
|
25
19
|
# SupportedStyles: with_first_element, with_fixed_indentation
|
|
26
20
|
Layout/ArrayAlignment:
|
|
27
21
|
Exclude:
|
|
28
|
-
- 'lib/omnizip/
|
|
22
|
+
- 'lib/omnizip/implementations/seven_zip/lzma/decoder.rb'
|
|
29
23
|
|
|
30
|
-
# Offense count:
|
|
31
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
32
|
-
# Configuration parameters: IndentationWidth.
|
|
33
|
-
Layout/AssignmentIndentation:
|
|
34
|
-
Exclude:
|
|
35
|
-
- 'lib/omnizip/formats/ole/allocation_table.rb'
|
|
36
|
-
|
|
37
|
-
# Offense count: 10
|
|
24
|
+
# Offense count: 2
|
|
38
25
|
# This cop supports safe autocorrection (--autocorrect).
|
|
39
26
|
# Configuration parameters: EnforcedStyleAlignWith.
|
|
40
27
|
# SupportedStylesAlignWith: either, start_of_block, start_of_line
|
|
41
28
|
Layout/BlockAlignment:
|
|
42
29
|
Exclude:
|
|
43
30
|
- 'lib/omnizip/algorithms/lzma/lzip_decoder.rb'
|
|
44
|
-
- 'lib/omnizip/formats/ole/allocation_table.rb'
|
|
45
|
-
- 'lib/omnizip/formats/ole/storage.rb'
|
|
46
31
|
- 'lib/omnizip/formats/xz_impl/block_decoder.rb'
|
|
47
|
-
- 'spec/omnizip/formats/ole_spec.rb'
|
|
48
|
-
- 'spec/omnizip/formats/rpm_spec.rb'
|
|
49
|
-
|
|
50
|
-
# Offense count: 8
|
|
51
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
52
|
-
Layout/BlockEndNewline:
|
|
53
|
-
Exclude:
|
|
54
|
-
- 'lib/omnizip/formats/ole/allocation_table.rb'
|
|
55
|
-
- 'lib/omnizip/formats/ole/storage.rb'
|
|
56
|
-
- 'spec/omnizip/formats/ole_spec.rb'
|
|
57
|
-
- 'spec/omnizip/formats/rpm_spec.rb'
|
|
58
|
-
|
|
59
|
-
# Offense count: 1
|
|
60
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
61
|
-
Layout/ClosingParenthesisIndentation:
|
|
62
|
-
Exclude:
|
|
63
|
-
- 'lib/omnizip/formats/rpm/writer.rb'
|
|
64
|
-
|
|
65
|
-
# Offense count: 2
|
|
66
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
67
|
-
# Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
|
|
68
|
-
Layout/ExtraSpacing:
|
|
69
|
-
Exclude:
|
|
70
|
-
- 'spec/omnizip/formats/integration_spec.rb'
|
|
71
|
-
|
|
72
|
-
# Offense count: 1
|
|
73
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
74
|
-
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
|
75
|
-
# SupportedStyles: consistent, consistent_relative_to_receiver, special_for_inner_method_call, special_for_inner_method_call_in_parentheses
|
|
76
|
-
Layout/FirstArgumentIndentation:
|
|
77
|
-
Exclude:
|
|
78
|
-
- 'lib/omnizip/formats/rpm/writer.rb'
|
|
79
32
|
|
|
80
|
-
# Offense count:
|
|
33
|
+
# Offense count: 10
|
|
81
34
|
# This cop supports safe autocorrection (--autocorrect).
|
|
82
|
-
# Configuration parameters:
|
|
83
|
-
|
|
84
|
-
Layout/FirstArrayElementIndentation:
|
|
35
|
+
# Configuration parameters: EmptyLineBetweenMethodDefs, EmptyLineBetweenClassDefs, EmptyLineBetweenModuleDefs, DefLikeMacros, AllowAdjacentOneLineDefs, NumberOfEmptyLines.
|
|
36
|
+
Layout/EmptyLineBetweenDefs:
|
|
85
37
|
Exclude:
|
|
86
|
-
- 'lib/omnizip
|
|
38
|
+
- 'lib/omnizip.rb'
|
|
39
|
+
- 'lib/omnizip/formats/rar.rb'
|
|
87
40
|
|
|
88
41
|
# Offense count: 17
|
|
89
42
|
# This cop supports safe autocorrection (--autocorrect).
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
# SupportedColonStyles: key, separator, table
|
|
93
|
-
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
|
|
94
|
-
Layout/HashAlignment:
|
|
95
|
-
Exclude:
|
|
96
|
-
- 'lib/omnizip/formats/rpm/writer.rb'
|
|
97
|
-
- 'spec/omnizip/formats/integration_spec.rb'
|
|
98
|
-
|
|
99
|
-
# Offense count: 16
|
|
100
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
101
|
-
# Configuration parameters: Width, AllowedPatterns.
|
|
102
|
-
Layout/IndentationWidth:
|
|
103
|
-
Exclude:
|
|
104
|
-
- 'lib/omnizip/formats/ole/allocation_table.rb'
|
|
105
|
-
- 'lib/omnizip/formats/ole/storage.rb'
|
|
106
|
-
- 'spec/omnizip/formats/ole_spec.rb'
|
|
107
|
-
- 'spec/omnizip/formats/rpm_spec.rb'
|
|
43
|
+
Layout/EmptyLines:
|
|
44
|
+
Enabled: false
|
|
108
45
|
|
|
109
|
-
# Offense count:
|
|
46
|
+
# Offense count: 1831
|
|
110
47
|
# This cop supports safe autocorrection (--autocorrect).
|
|
111
48
|
# Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
|
|
112
49
|
# URISchemes: http, https
|
|
113
50
|
Layout/LineLength:
|
|
114
51
|
Enabled: false
|
|
115
52
|
|
|
116
|
-
# Offense count:
|
|
53
|
+
# Offense count: 69
|
|
117
54
|
# This cop supports safe autocorrection (--autocorrect).
|
|
118
55
|
# Configuration parameters: AllowInHeredoc.
|
|
119
56
|
Layout/TrailingWhitespace:
|
|
120
|
-
|
|
121
|
-
- 'lib/omnizip/formats/ole/allocation_table.rb'
|
|
122
|
-
- 'lib/omnizip/formats/ole/dirent.rb'
|
|
123
|
-
- 'lib/omnizip/formats/ole/header.rb'
|
|
124
|
-
- 'lib/omnizip/formats/ole/storage.rb'
|
|
125
|
-
- 'lib/omnizip/formats/ole/types/variant.rb'
|
|
126
|
-
- 'lib/omnizip/formats/rpm/writer.rb'
|
|
127
|
-
- 'spec/omnizip/formats/integration_spec.rb'
|
|
57
|
+
Enabled: false
|
|
128
58
|
|
|
129
59
|
# Offense count: 13
|
|
130
60
|
# Configuration parameters: AllowedMethods.
|
|
@@ -156,11 +86,10 @@ Lint/DuplicateMethods:
|
|
|
156
86
|
- 'lib/omnizip/parity/par2_creator.rb'
|
|
157
87
|
- 'lib/omnizip/zip/file.rb'
|
|
158
88
|
|
|
159
|
-
# Offense count:
|
|
89
|
+
# Offense count: 3
|
|
160
90
|
# Configuration parameters: AllowComments, AllowEmptyLambdas.
|
|
161
91
|
Lint/EmptyBlock:
|
|
162
92
|
Exclude:
|
|
163
|
-
- 'lib/omnizip/parallel.rb'
|
|
164
93
|
- 'spec/omnizip/buffer_spec.rb'
|
|
165
94
|
- 'spec/omnizip/formats/rar/rar5/multi_volume/volume_writer_spec.rb'
|
|
166
95
|
|
|
@@ -171,8 +100,8 @@ Lint/IneffectiveAccessModifier:
|
|
|
171
100
|
- 'lib/omnizip/checksums/crc_base.rb'
|
|
172
101
|
- 'lib/omnizip/formats/cpio/entry.rb'
|
|
173
102
|
- 'lib/omnizip/formats/rar/external_writer.rb'
|
|
103
|
+
- 'lib/omnizip/formats/xz/writer.rb'
|
|
174
104
|
- 'lib/omnizip/formats/xz_impl/block_header.rb'
|
|
175
|
-
- 'lib/omnizip/formats/xz_impl/writer.rb'
|
|
176
105
|
|
|
177
106
|
# Offense count: 1
|
|
178
107
|
# Configuration parameters: MaximumRangeSize.
|
|
@@ -219,7 +148,7 @@ Lint/UselessConstantScoping:
|
|
|
219
148
|
Exclude:
|
|
220
149
|
- 'lib/omnizip/algorithms/lzma/optimal_encoder.rb'
|
|
221
150
|
|
|
222
|
-
# Offense count:
|
|
151
|
+
# Offense count: 552
|
|
223
152
|
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
|
|
224
153
|
Metrics/AbcSize:
|
|
225
154
|
Enabled: false
|
|
@@ -235,12 +164,12 @@ Metrics/BlockLength:
|
|
|
235
164
|
Metrics/BlockNesting:
|
|
236
165
|
Max: 6
|
|
237
166
|
|
|
238
|
-
# Offense count:
|
|
167
|
+
# Offense count: 266
|
|
239
168
|
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
|
|
240
169
|
Metrics/CyclomaticComplexity:
|
|
241
170
|
Enabled: false
|
|
242
171
|
|
|
243
|
-
# Offense count:
|
|
172
|
+
# Offense count: 948
|
|
244
173
|
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
|
245
174
|
Metrics/MethodLength:
|
|
246
175
|
Max: 434
|
|
@@ -250,7 +179,7 @@ Metrics/MethodLength:
|
|
|
250
179
|
Metrics/ParameterLists:
|
|
251
180
|
Max: 20
|
|
252
181
|
|
|
253
|
-
# Offense count:
|
|
182
|
+
# Offense count: 187
|
|
254
183
|
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
|
|
255
184
|
Metrics/PerceivedComplexity:
|
|
256
185
|
Enabled: false
|
|
@@ -306,41 +235,22 @@ Performance/MapMethodChain:
|
|
|
306
235
|
Exclude:
|
|
307
236
|
- 'lib/omnizip/commands/archive_create_command.rb'
|
|
308
237
|
|
|
309
|
-
# Offense count:
|
|
238
|
+
# Offense count: 7
|
|
310
239
|
Security/Open:
|
|
311
240
|
Exclude:
|
|
312
241
|
- 'lib/omnizip/formats/cpio.rb'
|
|
313
242
|
- 'lib/omnizip/formats/iso.rb'
|
|
314
|
-
- 'lib/omnizip/formats/rar.rb'
|
|
315
243
|
- 'lib/omnizip/zip/file.rb'
|
|
316
244
|
|
|
317
|
-
# Offense count:
|
|
318
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
319
|
-
# Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
|
|
320
|
-
# SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
|
|
321
|
-
# ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
|
|
322
|
-
# FunctionalMethods: let, let!, subject, watch
|
|
323
|
-
# AllowedMethods: lambda, proc, it
|
|
324
|
-
Style/BlockDelimiters:
|
|
325
|
-
Exclude:
|
|
326
|
-
- 'lib/omnizip/formats/ole/allocation_table.rb'
|
|
327
|
-
- 'lib/omnizip/formats/ole/storage.rb'
|
|
328
|
-
- 'spec/omnizip/formats/ole_spec.rb'
|
|
329
|
-
- 'spec/omnizip/formats/rpm_spec.rb'
|
|
330
|
-
|
|
331
|
-
# Offense count: 2
|
|
245
|
+
# Offense count: 6
|
|
332
246
|
# This cop supports safe autocorrection (--autocorrect).
|
|
333
247
|
Style/ComparableClamp:
|
|
334
248
|
Exclude:
|
|
335
249
|
- 'lib/omnizip/algorithms/bzip2.rb'
|
|
250
|
+
- 'lib/omnizip/algorithms/lzma/xz_utils_decoder.rb'
|
|
251
|
+
- 'lib/omnizip/implementations/seven_zip/lzma/decoder.rb'
|
|
336
252
|
- 'lib/omnizip/metadata/archive_metadata.rb'
|
|
337
253
|
|
|
338
|
-
# Offense count: 1
|
|
339
|
-
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
340
|
-
Style/ConcatArrayLiterals:
|
|
341
|
-
Exclude:
|
|
342
|
-
- 'lib/omnizip/formats/rpm/writer.rb'
|
|
343
|
-
|
|
344
254
|
# Offense count: 2
|
|
345
255
|
# This cop supports safe autocorrection (--autocorrect).
|
|
346
256
|
# Configuration parameters: EnforcedStyle, AllowComments.
|
|
@@ -363,17 +273,6 @@ Style/MixinUsage:
|
|
|
363
273
|
- 'spec/scripts/debug_7z_structure.rb'
|
|
364
274
|
- 'spec/scripts/debug_writer_output.rb'
|
|
365
275
|
|
|
366
|
-
# Offense count: 11
|
|
367
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
368
|
-
Style/MultilineIfModifier:
|
|
369
|
-
Exclude:
|
|
370
|
-
- 'lib/omnizip/formats/ole/allocation_table.rb'
|
|
371
|
-
- 'lib/omnizip/formats/ole/dirent.rb'
|
|
372
|
-
- 'lib/omnizip/formats/ole/header.rb'
|
|
373
|
-
- 'lib/omnizip/formats/ole/storage.rb'
|
|
374
|
-
- 'lib/omnizip/formats/ole/types/variant.rb'
|
|
375
|
-
- 'lib/omnizip/formats/rpm/writer.rb'
|
|
376
|
-
|
|
377
276
|
# Offense count: 3
|
|
378
277
|
# Configuration parameters: AllowedMethods.
|
|
379
278
|
# AllowedMethods: respond_to_missing?
|
|
@@ -389,11 +288,3 @@ Style/OptionalBooleanParameter:
|
|
|
389
288
|
Style/StringConcatenation:
|
|
390
289
|
Exclude:
|
|
391
290
|
- 'lib/omnizip/formats/iso/writer.rb'
|
|
392
|
-
|
|
393
|
-
# Offense count: 2
|
|
394
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
395
|
-
# Configuration parameters: EnforcedStyleForMultiline.
|
|
396
|
-
# SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
|
|
397
|
-
Style/TrailingCommaInArguments:
|
|
398
|
-
Exclude:
|
|
399
|
-
- 'spec/omnizip/formats/integration_spec.rb'
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.3.6] - 2026-02-23
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- Converted all `require_relative` statements to Ruby `autoload` for better memory management
|
|
12
|
+
- Updated dependency version bounds: `base64 ~> 0.2`, `rexml ~> 3.3`
|
|
13
|
+
- Removed deprecated backward compatibility code from internal APIs
|
|
14
|
+
- Cleaned up backward compatibility comments (kept format compatibility notes)
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
- Fixed syntax error in `lib/omnizip/parallel.rb` (duplicate module declaration)
|
|
18
|
+
- Fixed RAR format `verify` and `repair` convenience methods
|
|
19
|
+
- Fixed library loading to ensure convenience methods are available at startup
|
|
20
|
+
|
|
8
21
|
## [Unreleased]
|
|
9
22
|
|
|
10
23
|
### Added
|
data/LICENSE
CHANGED
|
@@ -6,7 +6,7 @@ This project is a pure Ruby port of 7-Zip compression algorithms.
|
|
|
6
6
|
The original 7-Zip source code is licensed under the GNU LGPL 2.1 license.
|
|
7
7
|
This Ruby implementation maintains compatibility with that license.
|
|
8
8
|
|
|
9
|
-
Copyright (C)
|
|
9
|
+
Copyright (C) 2026 Ribose Inc.
|
|
10
10
|
Copyright (C) 1999-2024 Igor Pavlov (7-Zip original implementation)
|
|
11
11
|
|
|
12
12
|
See the COPYING file for the complete text of the GNU LGPL 2.1 license.
|
data/README.adoc
CHANGED
|
@@ -1295,6 +1295,6 @@ IMPORTANT: Compression algorithms themselves are mathematical concepts and canno
|
|
|
1295
1295
|
|
|
1296
1296
|
== Copyright and License
|
|
1297
1297
|
|
|
1298
|
-
Copyright
|
|
1298
|
+
Copyright 2026 https://www.ribose.com[Ribose Inc.]
|
|
1299
1299
|
|
|
1300
1300
|
See the link:COPYING[COPYING] file and link:LICENSE[LICENSE] file for the complete text of the licenses.
|
data/lib/omnizip/algorithm.rb
CHANGED
|
@@ -20,12 +20,6 @@
|
|
|
20
20
|
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
21
21
|
# DEALINGS IN THE SOFTWARE.
|
|
22
22
|
|
|
23
|
-
require_relative "bwt"
|
|
24
|
-
require_relative "mtf"
|
|
25
|
-
require_relative "rle"
|
|
26
|
-
require_relative "huffman"
|
|
27
|
-
require_relative "../../checksums/crc32"
|
|
28
|
-
|
|
29
23
|
module Omnizip
|
|
30
24
|
module Algorithms
|
|
31
25
|
class BZip2 < Algorithm
|
|
@@ -20,12 +20,6 @@
|
|
|
20
20
|
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
21
21
|
# DEALINGS IN THE SOFTWARE.
|
|
22
22
|
|
|
23
|
-
require_relative "bwt"
|
|
24
|
-
require_relative "mtf"
|
|
25
|
-
require_relative "rle"
|
|
26
|
-
require_relative "huffman"
|
|
27
|
-
require_relative "../../checksums/crc32"
|
|
28
|
-
|
|
29
23
|
module Omnizip
|
|
30
24
|
module Algorithms
|
|
31
25
|
class BZip2 < Algorithm
|
|
@@ -20,9 +20,6 @@
|
|
|
20
20
|
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
21
21
|
# DEALINGS IN THE SOFTWARE.
|
|
22
22
|
|
|
23
|
-
require_relative "../algorithm"
|
|
24
|
-
require_relative "../models/algorithm_metadata"
|
|
25
|
-
|
|
26
23
|
module Omnizip
|
|
27
24
|
module Algorithms
|
|
28
25
|
# BZip2 block-sorting compression algorithm
|
|
@@ -42,6 +39,17 @@ module Omnizip
|
|
|
42
39
|
# Larger blocks (up to 900KB) generally provide better compression
|
|
43
40
|
# but require more memory.
|
|
44
41
|
class BZip2 < Algorithm
|
|
42
|
+
# Nested classes - autoloaded
|
|
43
|
+
autoload :Bwt, "omnizip/algorithms/bzip2/bwt"
|
|
44
|
+
autoload :Mtf, "omnizip/algorithms/bzip2/mtf"
|
|
45
|
+
autoload :Rle, "omnizip/algorithms/bzip2/rle"
|
|
46
|
+
autoload :Huffman, "omnizip/algorithms/bzip2/huffman"
|
|
47
|
+
autoload :Encoder, "omnizip/algorithms/bzip2/encoder"
|
|
48
|
+
autoload :Decoder, "omnizip/algorithms/bzip2/decoder"
|
|
49
|
+
|
|
50
|
+
# Cross-namespace dependencies - autoloaded
|
|
51
|
+
autoload :Crc32, "omnizip/checksums/crc32"
|
|
52
|
+
|
|
45
53
|
# Get algorithm metadata
|
|
46
54
|
#
|
|
47
55
|
# @return [AlgorithmMetadata] Algorithm information
|
|
@@ -118,13 +126,5 @@ module Omnizip
|
|
|
118
126
|
end
|
|
119
127
|
end
|
|
120
128
|
|
|
121
|
-
# Load nested classes after BZip2 class is defined
|
|
122
|
-
require_relative "bzip2/bwt"
|
|
123
|
-
require_relative "bzip2/mtf"
|
|
124
|
-
require_relative "bzip2/rle"
|
|
125
|
-
require_relative "bzip2/huffman"
|
|
126
|
-
require_relative "bzip2/encoder"
|
|
127
|
-
require_relative "bzip2/decoder"
|
|
128
|
-
|
|
129
129
|
# Register the BZip2 algorithm
|
|
130
130
|
Omnizip::AlgorithmRegistry.register(:bzip2, Omnizip::Algorithms::BZip2)
|
|
@@ -20,9 +20,6 @@
|
|
|
20
20
|
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
21
21
|
# DEALINGS IN THE SOFTWARE.
|
|
22
22
|
|
|
23
|
-
require_relative "../algorithm"
|
|
24
|
-
require_relative "../models/algorithm_metadata"
|
|
25
|
-
|
|
26
23
|
module Omnizip
|
|
27
24
|
module Algorithms
|
|
28
25
|
# Deflate compression algorithm (RFC 1951)
|
|
@@ -44,6 +41,11 @@ module Omnizip
|
|
|
44
41
|
# - Files with repeated patterns
|
|
45
42
|
# - General-purpose compression needs
|
|
46
43
|
class Deflate < Algorithm
|
|
44
|
+
# Nested classes - autoloaded
|
|
45
|
+
autoload :Constants, "omnizip/algorithms/deflate/constants"
|
|
46
|
+
autoload :Encoder, "omnizip/algorithms/deflate/encoder"
|
|
47
|
+
autoload :Decoder, "omnizip/algorithms/deflate/decoder"
|
|
48
|
+
|
|
47
49
|
# Get algorithm metadata
|
|
48
50
|
#
|
|
49
51
|
# @return [AlgorithmMetadata] Algorithm information
|
|
@@ -119,10 +121,5 @@ module Omnizip
|
|
|
119
121
|
end
|
|
120
122
|
end
|
|
121
123
|
|
|
122
|
-
# Load nested classes after Deflate class is defined
|
|
123
|
-
require_relative "deflate/constants"
|
|
124
|
-
require_relative "deflate/encoder"
|
|
125
|
-
require_relative "deflate/decoder"
|
|
126
|
-
|
|
127
124
|
# Register the Deflate algorithm
|
|
128
125
|
Omnizip::AlgorithmRegistry.register(:deflate, Omnizip::Algorithms::Deflate)
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require_relative "../algorithm"
|
|
4
3
|
require "zlib"
|
|
5
4
|
|
|
6
5
|
module Omnizip
|
|
@@ -17,6 +16,13 @@ module Omnizip
|
|
|
17
16
|
# bit-level manipulation that is better handled by libraries
|
|
18
17
|
# specifically designed for it.
|
|
19
18
|
class Deflate64 < Algorithm
|
|
19
|
+
# Nested classes - autoloaded
|
|
20
|
+
autoload :Constants, "omnizip/algorithms/deflate64/constants"
|
|
21
|
+
autoload :Decoder, "omnizip/algorithms/deflate64/decoder"
|
|
22
|
+
autoload :Encoder, "omnizip/algorithms/deflate64/encoder"
|
|
23
|
+
autoload :HuffmanCoder, "omnizip/algorithms/deflate64/huffman_coder"
|
|
24
|
+
autoload :Lz77Encoder, "omnizip/algorithms/deflate64/lz77_encoder"
|
|
25
|
+
|
|
20
26
|
# Constants
|
|
21
27
|
DICTIONARY_SIZE = 65_536 # 64KB window
|
|
22
28
|
|
|
@@ -20,8 +20,6 @@
|
|
|
20
20
|
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
21
21
|
# DEALINGS IN THE SOFTWARE.
|
|
22
22
|
|
|
23
|
-
require_relative "xz_utils_decoder"
|
|
24
|
-
|
|
25
23
|
module Omnizip
|
|
26
24
|
module Algorithms
|
|
27
25
|
class LZMA < Algorithm
|
|
@@ -48,7 +46,7 @@ module Omnizip
|
|
|
48
46
|
# Use XZ Utils LZMA decoder (full XZ Utils compatibility)
|
|
49
47
|
@impl = XzUtilsDecoder.new(input, options)
|
|
50
48
|
|
|
51
|
-
# Expose header info
|
|
49
|
+
# Expose header info as attributes
|
|
52
50
|
@lc = @impl.lc
|
|
53
51
|
@lp = @impl.lp
|
|
54
52
|
@pb = @impl.pb
|
|
@@ -20,10 +20,6 @@
|
|
|
20
20
|
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
21
21
|
# DEALINGS IN THE SOFTWARE.
|
|
22
22
|
|
|
23
|
-
require_relative "constants"
|
|
24
|
-
require_relative "xz_encoder"
|
|
25
|
-
require_relative "../../implementations/seven_zip/lzma/encoder"
|
|
26
|
-
|
|
27
23
|
module Omnizip
|
|
28
24
|
module Algorithms
|
|
29
25
|
class LZMA < Algorithm
|
|
@@ -121,7 +121,7 @@ module Omnizip
|
|
|
121
121
|
)
|
|
122
122
|
end
|
|
123
123
|
|
|
124
|
-
# Create simplified configuration
|
|
124
|
+
# Create simplified configuration with sensible defaults.
|
|
125
125
|
#
|
|
126
126
|
# @param dict_size [Integer] Dictionary size
|
|
127
127
|
# @return [MatchFinderConfig] Simplified configuration
|
|
@@ -20,10 +20,6 @@
|
|
|
20
20
|
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
21
21
|
# DEALINGS IN THE SOFTWARE.
|
|
22
22
|
|
|
23
|
-
require_relative "match_finder_config"
|
|
24
|
-
require_relative "match_finder"
|
|
25
|
-
require_relative "../../implementations/seven_zip/lzma/match_finder"
|
|
26
|
-
|
|
27
23
|
module Omnizip
|
|
28
24
|
module Algorithms
|
|
29
25
|
class LZMA < Algorithm
|
|
@@ -54,7 +50,7 @@ module Omnizip
|
|
|
54
50
|
when "sdk"
|
|
55
51
|
Implementations::SevenZip::LZMA::MatchFinder.new(config)
|
|
56
52
|
when "simplified"
|
|
57
|
-
# Use
|
|
53
|
+
# Use simplified MatchFinder implementation
|
|
58
54
|
MatchFinder.new(config.window_size, config.max_match_length)
|
|
59
55
|
else
|
|
60
56
|
raise ArgumentError, "Unknown match finder mode: #{config.mode}"
|