Skip to content

Commit ceb3c19

Browse files
author
2colours
committed
0.2.1
1 parent 8e82faa commit ceb3c19

File tree

5 files changed

+27
-17
lines changed

5 files changed

+27
-17
lines changed

Changes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ Revision history for File-Find
22

33
{{$NEXT}}
44

5+
0.2.1 2023-10-31T11:31:35+01:00
6+
- fix docs (Seq instead of "list" and usual implications)
7+
58
0.2.0 2023-09-10T03:24:15+02:00
69
- support for junctions for `name` and `exclude` parameters
710

META6.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
],
1919
"depends": [
2020
],
21-
"description": "Get a lazy list of a directory tree",
21+
"description": "Get a lazy sequence of a directory tree",
2222
"license": "MIT",
2323
"name": "File::Find",
2424
"perl": "6.*",
@@ -32,5 +32,5 @@
3232
],
3333
"test-depends": [
3434
],
35-
"version": "0.2.0"
35+
"version": "0.2.1"
3636
}

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,26 @@
33
NAME
44
====
55

6-
File::Find - Get a lazy list of a directory tree
6+
File::Find - Get a lazy sequence of a directory tree
77

88
SYNOPSIS
99
========
1010

1111
use File::Find;
1212

13-
my @list := find(dir => 'foo');
13+
my @list = lazy find(dir => 'foo'); # Keep laziness
1414
say @list[0..3];
1515

16-
my $list = find(dir => 'foo');
16+
my $list = find(dir => 'foo'); # Keep laziness
1717
say $list[0..3];
1818

19+
my @list = find(dir => 'foo'); # Drop laziness
20+
say @list[0..3];
21+
1922
DESCRIPTION
2023
===========
2124

22-
`File::Find` allows you to get the contents of the given directory, recursively, depth first. The only exported function, `find()`, generates a lazy list of files in given directory. Every element of the list is an `IO::Path` object, described below. `find()` takes one (or more) named arguments. The `dir` argument is mandatory, and sets the directory `find()` will traverse. There are also few optional arguments. If more than one is passed, all of them must match for a file to be returned.
25+
`File::Find` allows you to get the contents of the given directory, recursively, depth first. The only exported function, `find()`, generates a `Seq` of files in given directory. Every element of the `Seq` is an `IO::Path` object, described below. `find()` takes one (or more) named arguments. The `dir` argument is mandatory, and sets the directory `find()` will traverse. There are also few optional arguments. If more than one is passed, all of them must match for a file to be returned.
2326

2427
name
2528
----
@@ -56,5 +59,5 @@ Please note, that this module is not trying to be the verbatim port of Perl's Fi
5659
CAVEATS
5760
=======
5861

59-
List assignment is eager in Raku, so if You assign `find()` result to an array, the elements will be copied and the laziness will be spoiled. For a proper lazy list, use either binding (`:=`) or assign a result to a scalar value (see SYNOPSIS).
62+
List assignment is eager by default in Raku, so if you assign a `find()` result to an array, the laziness will be dropped by default. To keep the laziness either insert `lazy` or assign to a scalar value (see SYNOPSIS).
6063

dist.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ filename = lib/File/Find.rakumod
1010
; match = ^ 'xt/'
1111

1212
[Badges]
13-
provider = github-actions/test.yml
13+
provider = github-actions/linux.yml
14+
provider = github-actions/macos.yml
15+
provider = github-actions/windows-spec.yml

lib/File/Find.rakumod

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,24 +47,27 @@ sub find (:$dir!, Mu :$name, :$type, Mu :$exclude = False, Bool :$recursive = Tr
4747
4848
=head1 NAME
4949
50-
File::Find - Get a lazy list of a directory tree
50+
File::Find - Get a lazy sequence of a directory tree
5151
5252
=head1 SYNOPSIS
5353
5454
use File::Find;
5555
56-
my @list := find(dir => 'foo');
56+
my @list = lazy find(dir => 'foo'); # Keep laziness
5757
say @list[0..3];
5858
59-
my $list = find(dir => 'foo');
59+
my $list = find(dir => 'foo'); # Keep laziness
6060
say $list[0..3];
6161
62+
my @list = find(dir => 'foo'); # Drop laziness
63+
say @list[0..3];
64+
6265
=head1 DESCRIPTION
6366
6467
C<File::Find> allows you to get the contents of the given directory,
6568
recursively, depth first.
66-
The only exported function, C<find()>, generates a lazy
67-
list of files in given directory. Every element of the list is an
69+
The only exported function, C<find()>, generates a C<Seq>
70+
of files in given directory. Every element of the C<Seq> is an
6871
C<IO::Path> object, described below.
6972
C<find()> takes one (or more) named arguments. The C<dir> argument
7073
is mandatory, and sets the directory C<find()> will traverse.
@@ -117,10 +120,9 @@ File::Find::Rule, and its features are planned to be similar one day.
117120
118121
=head1 CAVEATS
119122
120-
List assignment is eager in Raku, so if You assign C<find()> result
121-
to an array, the elements will be copied and the laziness will be
122-
spoiled. For a proper lazy list, use either binding (C<:=>) or assign
123-
a result to a scalar value (see SYNOPSIS).
123+
List assignment is eager by default in Raku, so if you assign a C<find()>
124+
result to an array, the laziness will be dropped by default. To keep the
125+
laziness either insert C<lazy> or assign to a scalar value (see SYNOPSIS).
124126
125127
=end pod
126128

0 commit comments

Comments
 (0)