Skip to content

Commit

Permalink
0.0.30
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Oct 2, 2022
1 parent d625848 commit 4cebe0b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Changes
Expand Up @@ -2,6 +2,10 @@ Revision history for rak

{{$NEXT}}

0.0.30 2022-10-02T17:49:27+02:00
- Make sure reading from STDIN does not eagerize to allow
tail -f sources to work

0.0.29 2022-09-29T01:20:05+02:00
- Make sure that not specifying :dir or :file will actually use
the defaults that "paths" assume for :dir and :file
Expand Down
2 changes: 1 addition & 1 deletion META6.json
Expand Up @@ -29,5 +29,5 @@
],
"test-depends": [
],
"version": "0.0.29"
"version": "0.0.30"
}
11 changes: 10 additions & 1 deletion lib/rak.rakumod
Expand Up @@ -836,12 +836,13 @@ multi sub rak(&pattern, %n) {
my $batch := %n<batch>:delete;
my $degree := %n<degree>:delete;
my $enc := %n<encoding>:delete // 'utf8-c8';
my $reading-from-stdin := !($*IN.t);

# Step 1: sources sequence
my $sources-seq = do if %n<sources>:delete -> $sources {
$sources
}
elsif !($*IN.t) {
elsif $reading-from-stdin {
$*IN
}
elsif %n<paths>:exists && %n<paths> eq '-' {
Expand Down Expand Up @@ -1200,6 +1201,14 @@ multi sub rak(&pattern, %n) {
}
}

# reading from STDIN should not eagerize
elsif $reading-from-stdin {
$sources-seq.map: -> $*SOURCE {
++$nr-sources;
Pair.new: $*SOURCE, producer($*SOURCE).map: runner
}
}

# Nothing special to do for each source
else {
$sources-seq.map: -> $*SOURCE {
Expand Down

0 comments on commit 4cebe0b

Please sign in to comment.