Skip to content

Commit

Permalink
0.0.44
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Nov 18, 2022
1 parent d48e684 commit 5f33c91
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 20 deletions.
4 changes: 4 additions & 0 deletions Changes
Expand Up @@ -2,6 +2,10 @@ Revision history for rak

{{$NEXT}}

0.0.44 2022-11-18T17:31:34+01:00
- Fix issue with --files-from=- and --paths-from=-, spotted by
Márton Polgár.

0.0.43 2022-11-17T18:54:54+01:00
- Make sure that data fetched from URLs produce strings for the
file filter property checks to be performed without issues.
Expand Down
2 changes: 1 addition & 1 deletion META6.json
Expand Up @@ -29,5 +29,5 @@
],
"test-depends": [
],
"version": "0.0.43"
"version": "0.0.44"
}
2 changes: 0 additions & 2 deletions README.md
Expand Up @@ -569,8 +569,6 @@ If specified, indicates the name of the file from which a list of paths to be us

If specified, indicates a list of paths that should be used as the base of the production of filename with a `paths` search. If there is no other sources specification (from either the `:files-from`, `:paths-from` or `:sources`) then the current directory (aka ".") will be assumed. If that directory appears to be the top directory in a git repository, then `:under-version-control` will be assumed, only producing files that are under version control under that directory.

If a single hyphen is specified as the path, then STDIN will be assumed as the source.

#### :produce-many(&producer)

If specified, indicates a `Callable` that will be called given a source, and is expected to produce zero or more items to be inspected. Defaults to a producer that calles the `lines` method on a given source, with the `:encoding` and `:with-line-ending` arguments.
Expand Down
3 changes: 0 additions & 3 deletions doc/rak.rakudoc
Expand Up @@ -690,9 +690,6 @@ appears to be the top directory in a git repository, then
C<:under-version-control> will be assumed, only producing files
that are under version control under that directory.

If a single hyphen is specified as the path, then STDIN will be
assumed as the source.

=head4 :produce-many(&producer)

If specified, indicates a C<Callable> that will be called given
Expand Down
22 changes: 8 additions & 14 deletions lib/rak.rakumod
Expand Up @@ -895,20 +895,7 @@ multi sub rak(&pattern, %n) {
my $enc := %n<encoding>:delete // 'utf8-c8';
my $eagerSlip := True;

# Step 1: sources sequence
my $sources-seq = do if !($*IN.t) {
$eagerSlip := False;
$*IN
}
elsif %n<sources>:delete -> $sources {
$sources
}
elsif %n<paths>:exists && %n<paths> eq '-' {
%n<paths>:delete;
warn-if-human-on-stdin;
$*IN
}
else {
my sub get-sources-seq() {
my $seq := do if %n<files-from>:delete -> $files-from {
paths-from-file($files-from).map: {
path-exists($_) ?? $_ !! fetch-if-url($_)
Expand All @@ -928,6 +915,10 @@ multi sub rak(&pattern, %n) {
elsif %n<under-version-control>:delete -> $uvc {
uvc-paths($uvc)
}
elsif !($*IN.t) {
$eagerSlip := False;
return $*IN
}
else {
paths(".", |paths-arguments(%n)).&hyperize($batch, $degree)
}
Expand All @@ -936,6 +927,9 @@ multi sub rak(&pattern, %n) {
make-property-filter($seq, %n);
}

# Step 1: sources sequence
my $sources-seq = %n<sources>:delete // get-sources-seq;

# sort sources if we want them sorted
if %n<sort>:delete -> $sort {
$sources-seq = Bool.ACCEPTS($sort)
Expand Down

0 comments on commit 5f33c91

Please sign in to comment.