Skip to content

Commit

Permalink
Make IO::Path::AutoDecompress a dependency
Browse files Browse the repository at this point in the history
So that --auto-decompress is always available with App::Rak
  • Loading branch information
lizmat committed Oct 21, 2022
1 parent 01d1406 commit 5e3e67b
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 16 deletions.
2 changes: 2 additions & 0 deletions Changes
@@ -1,6 +1,8 @@
Revision history for App-Rak

{{$NEXT}}
- Add dependency on IO::Path::AutoDecompress to make --auto-decompress
option an option that is always available

0.1.11 2022-10-20T16:01:39+02:00
- Add support for --auto-decompress
Expand Down
1 change: 1 addition & 0 deletions META6.json
Expand Up @@ -10,6 +10,7 @@
"CLI::Version:ver<0.0.8>:auth<zef:lizmat>",
"has-word:ver<0.0.3>:auth<zef:lizmat>",
"highlighter:ver<0.0.15>:auth<zef:lizmat>",
"IO::Path::AutoDecompress:ver<0.0.2>:auth<zef:lizmat>",
"JSON::Fast::Hyper:ver<0.0.3>:auth<zef:lizmat>",
"META::constants:ver<0.0.3>:auth<zef:lizmat>",
"rak:ver<0.0.38>:auth<zef:lizmat>",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -298,7 +298,7 @@ Only applicable if `--csv-per-line` has been specified. Flag. If specified, indi
--auto-decompress
-----------------

Flag. If specified with a True value, will accept compressed files with the `.gz` (gzip) or `.bz2` (bzip2) extension, if the extension was otherwise acceptable. Will automatically decompress files for inspection. Requires that the `IO::Path::AutoDecompress` module is available.
Flag. If specified with a True value, will accept compressed files with the `.gz` (gzip) or `.bz2` (bzip2) extension, if the extension was otherwise acceptable. Will automatically decompress files for inspection.

--auto-diag
-----------
Expand Down
1 change: 0 additions & 1 deletion doc/App-Rak.rakudoc
Expand Up @@ -367,7 +367,6 @@ indicates that whitespace is allowed around separators.
Flag. If specified with a True value, will accept compressed files
with the C<.gz> (gzip) or C<.bz2> (bzip2) extension, if the extension was
otherwise acceptable. Will automatically decompress files for inspection.
Requires that the C<IO::Path::AutoDecompress> module is available.

=head2 --auto-diag

Expand Down
14 changes: 2 additions & 12 deletions lib/App/Rak.rakumod
Expand Up @@ -2,6 +2,7 @@
use as-cli-arguments:ver<0.0.7>:auth<zef:lizmat>; # as-cli-arguments
use has-word:ver<0.0.3>:auth<zef:lizmat>; # has-word
use highlighter:ver<0.0.15>:auth<zef:lizmat>; # columns highlighter matches
use IO::Path::AutoDecompress:ver<0.0.2>:auth<zef:lizmat>; # IOAD
use JSON::Fast::Hyper:ver<0.0.3>:auth<zef:lizmat>; # from-json to-json
use META::constants:ver<0.0.3>:auth<zef:lizmat> $?DISTRIBUTION;
use rak:ver<0.0.38>:auth<zef:lizmat>; # rak
Expand Down Expand Up @@ -161,7 +162,6 @@ elsif %*ENV<RAK_CONFIG>:!exists { # want to have the default config
# Links to optional classes
my $TextCSV;
my $GitBlameFile;
my $IO-Path-AutoDecompress;
my &edit-files;
my &backtrace-files;
my &sourcery;
Expand Down Expand Up @@ -1131,15 +1131,6 @@ my sub check-GitBlameFile(str $name) {
}
}
# check IO::Path::AutoDecompress availability
my sub check-IOPathAutoDecompress(str $name) {
unless $IO-Path-AutoDecompress {
CATCH { meh-not-installed 'IO::Path::AutoDecompress', $name }
require IO::Path::AutoDecompress;
$IO-Path-AutoDecompress := IO::Path::AutoDecompress;
}
}
# handle additional CSV parameters
my sub set-csv-flag(str $name, $value --> Nil) {
check-TextCSV($name);
Expand Down Expand Up @@ -1258,7 +1249,6 @@ my sub option-allow-whitespace($value --> Nil) {
}
my sub option-auto-decompress($value --> Nil) {
check-IOPathAutoDecompress('auto-decompress');
set-filesystem-flag('auto-decompress', $value);
}
Expand Down Expand Up @@ -2006,7 +1996,7 @@ my sub move-filesystem-options-to-rak(--> Nil) {
}
if %filesystem<auto-decompress>:delete {
%rak<ioify> := { $IO-Path-AutoDecompress.new($_) };
%rak<ioify> := &IOAD;
my &old-filter :=
%rak<file> // codify-extensions @known-extensions;
Expand Down
3 changes: 1 addition & 2 deletions resources/help/filesystem.txt
Expand Up @@ -16,8 +16,7 @@ extension is an extension of any of the predefined extension groups).
Flag. If specified with a True value, will accept compressed files
with the .gz (gzip) or .bz2 (bzip2) extension, if the extension was
otherwise acceptable. Will automatically decompress files for
inspection. Requires that the IO::Path::AutoDecompress module is
available.
inspection.

--dir=expression

Expand Down

0 comments on commit 5e3e67b

Please sign in to comment.