omnizip 0.3.31 → 0.3.32
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/CHANGELOG.md +16 -0
- data/lib/omnizip/cli.rb +32 -3
- data/lib/omnizip/version.rb +1 -1
- data/lib/omnizip.rb +1 -0
- metadata +1 -2
- data/lib/omnizip/cli/shared.rb +0 -31
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a20cd2785f3068dabfe29b7cb3e9b88503b151839ea076fd4d4c727708e5a440
|
|
4
|
+
data.tar.gz: 7db78180133b7b7d3e62dff82588036c73dabc80c1957d892ffbff96fd83e657
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 601948e2be2303a5c82573728118fe4fdb6bd123ce983f6f92776373e3215e96c1b29ab02217356353a8978335af54233093ede1aeb9aa8665a57f1f189a9525
|
|
7
|
+
data.tar.gz: ac68a261028b8a92a948bb0f93caed9997e5e3d13c885962d1857104c65f16d2da2eba38996aac90fb0a17da57d9fa8b7e1c806956e22d65d36765ebcf9f84c7
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
### Fixed
|
|
11
|
+
- The `omnizip` executable crashed on every invocation
|
|
12
|
+
(`uninitialized constant Omnizip::Cli`): the `Cli` autoload was
|
|
13
|
+
missing and the Thor command classes referenced
|
|
14
|
+
`Omnizip::Cli::Shared` mid-load, re-triggering the in-progress
|
|
15
|
+
autoload. The autoload exists now and Shared is defined ahead of
|
|
16
|
+
the command classes in `lib/omnizip/cli.rb` (its separate file is
|
|
17
|
+
gone). Verified: `omnizip version`, the documented
|
|
18
|
+
`compress/decompress output.lzma` round-trip (which also
|
|
19
|
+
interops with `xz --format=lzma` in both directions), and
|
|
20
|
+
`archive create backup.7z` producing an archive `7zz` validates.
|
|
21
|
+
|
|
22
|
+
## [0.3.31] - 2026-08-27
|
|
23
|
+
|
|
10
24
|
### Fixed
|
|
11
25
|
- `Omnizip.compress_file` now routes single-file compression by
|
|
12
26
|
output extension: `.gz`, `.bz2`, `.xz`, `.lzma` and `.lz` produce
|
|
@@ -15,6 +29,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
15
29
|
`compress_file('input.txt', 'output.lzma', algorithm: :lzma)`
|
|
16
30
|
example previously emitted `PK`-magic data). Unknown extensions
|
|
17
31
|
and explicit archive formats keep the previous behavior.
|
|
32
|
+
- CI: the Windows matrix no longer fails when choco's winrar
|
|
33
|
+
download 404s (RAR specs skip when it is absent).
|
|
18
34
|
|
|
19
35
|
## [0.3.30] - 2026-08-27
|
|
20
36
|
|
data/lib/omnizip/cli.rb
CHANGED
|
@@ -19,9 +19,38 @@
|
|
|
19
19
|
require "thor"
|
|
20
20
|
|
|
21
21
|
module Omnizip
|
|
22
|
+
# Shared helpers used by the Thor command groups defined below
|
|
23
|
+
# (ProfileCommands, ArchiveCommands, Cli). Defined here because the
|
|
24
|
+
# command classes include it at class-body time; a separate file
|
|
25
|
+
# under Omnizip::Cli would re-trigger this file's autoload
|
|
26
|
+
# mid-load.
|
|
27
|
+
module Shared
|
|
28
|
+
# Print a formatted error message and exit nonzero.
|
|
29
|
+
#
|
|
30
|
+
# @param error [StandardError] the error to display
|
|
31
|
+
def handle_error(error)
|
|
32
|
+
warn Omnizip::CliOutputFormatter.format_error(error)
|
|
33
|
+
exit 1
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Format a byte count with a binary-unit suffix.
|
|
37
|
+
#
|
|
38
|
+
# @param bytes [Integer] the byte count
|
|
39
|
+
# @return [String] human-readable size (e.g. "1.5 MB")
|
|
40
|
+
def format_bytes(bytes)
|
|
41
|
+
return "0 B" if bytes.zero?
|
|
42
|
+
|
|
43
|
+
units = %w[B KB MB GB TB]
|
|
44
|
+
exp = (Math.log(bytes) / Math.log(1024)).to_i
|
|
45
|
+
exp = [exp, units.size - 1].min
|
|
46
|
+
|
|
47
|
+
"%.1f %s" % [bytes.to_f / (1024**exp), units[exp]]
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
22
51
|
# Profile commands subcommand group
|
|
23
52
|
class ProfileCommands < Thor
|
|
24
|
-
include
|
|
53
|
+
include Shared
|
|
25
54
|
|
|
26
55
|
class << self
|
|
27
56
|
def exit_on_failure?
|
|
@@ -69,7 +98,7 @@ module Omnizip
|
|
|
69
98
|
|
|
70
99
|
# Archive commands subcommand group
|
|
71
100
|
class ArchiveCommands < Thor
|
|
72
|
-
include
|
|
101
|
+
include Shared
|
|
73
102
|
|
|
74
103
|
class << self
|
|
75
104
|
def exit_on_failure?
|
|
@@ -298,7 +327,7 @@ module Omnizip
|
|
|
298
327
|
# Provides Thor-based CLI commands for compressing and decompressing
|
|
299
328
|
# files using various compression algorithms.
|
|
300
329
|
class Cli < Thor
|
|
301
|
-
include
|
|
330
|
+
include Shared
|
|
302
331
|
|
|
303
332
|
class << self
|
|
304
333
|
def exit_on_failure?
|
data/lib/omnizip/version.rb
CHANGED
data/lib/omnizip.rb
CHANGED
|
@@ -67,6 +67,7 @@ module Omnizip
|
|
|
67
67
|
autoload :Profiler, "omnizip/profiler"
|
|
68
68
|
autoload :Commands, "omnizip/commands"
|
|
69
69
|
autoload :CliOutputFormatter, "omnizip/cli/output_formatter"
|
|
70
|
+
autoload :Cli, "omnizip/cli"
|
|
70
71
|
|
|
71
72
|
# Implementation namespaces. Each namespace file declares autoloads
|
|
72
73
|
# for its concrete classes. The classes self-register with their
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: omnizip
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.32
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
@@ -339,7 +339,6 @@ files:
|
|
|
339
339
|
- lib/omnizip/chunked/writer.rb
|
|
340
340
|
- lib/omnizip/cli.rb
|
|
341
341
|
- lib/omnizip/cli/output_formatter.rb
|
|
342
|
-
- lib/omnizip/cli/shared.rb
|
|
343
342
|
- lib/omnizip/commands.rb
|
|
344
343
|
- lib/omnizip/commands/.keep
|
|
345
344
|
- lib/omnizip/commands/archive_create_command.rb
|
data/lib/omnizip/cli/shared.rb
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Omnizip
|
|
4
|
-
class Cli
|
|
5
|
-
# Shared helpers used by the Thor command groups defined in
|
|
6
|
-
# lib/omnizip/cli.rb (ProfileCommands, ArchiveCommands, Cli).
|
|
7
|
-
module Shared
|
|
8
|
-
# Print a formatted error message and exit nonzero.
|
|
9
|
-
#
|
|
10
|
-
# @param error [StandardError] the error to display
|
|
11
|
-
def handle_error(error)
|
|
12
|
-
warn Omnizip::CliOutputFormatter.format_error(error)
|
|
13
|
-
exit 1
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
# Format a byte count with a binary-unit suffix.
|
|
17
|
-
#
|
|
18
|
-
# @param bytes [Integer] the byte count
|
|
19
|
-
# @return [String] human-readable size (e.g. "1.5 MB")
|
|
20
|
-
def format_bytes(bytes)
|
|
21
|
-
return "0 B" if bytes.zero?
|
|
22
|
-
|
|
23
|
-
units = %w[B KB MB GB TB]
|
|
24
|
-
exp = (Math.log(bytes) / Math.log(1024)).to_i
|
|
25
|
-
exp = [exp, units.size - 1].min
|
|
26
|
-
|
|
27
|
-
"%.1f %s" % [bytes.to_f / (1024**exp), units[exp]]
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
end
|