Skip to content

Commit

Permalink
0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
2colours committed Oct 31, 2023
1 parent 8e82faa commit ceb3c19
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 17 deletions.
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ Revision history for File-Find

{{$NEXT}}

0.2.1 2023-10-31T11:31:35+01:00
- fix docs (Seq instead of "list" and usual implications)

0.2.0 2023-09-10T03:24:15+02:00
- support for junctions for `name` and `exclude` parameters

Expand Down
4 changes: 2 additions & 2 deletions META6.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
],
"depends": [
],
"description": "Get a lazy list of a directory tree",
"description": "Get a lazy sequence of a directory tree",
"license": "MIT",
"name": "File::Find",
"perl": "6.*",
Expand All @@ -32,5 +32,5 @@
],
"test-depends": [
],
"version": "0.2.0"
"version": "0.2.1"
}
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,26 @@
NAME
====

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

SYNOPSIS
========

use File::Find;

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

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

my @list = find(dir => 'foo'); # Drop laziness
say @list[0..3];

DESCRIPTION
===========

`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.
`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.

name
----
Expand Down Expand Up @@ -56,5 +59,5 @@ Please note, that this module is not trying to be the verbatim port of Perl's Fi
CAVEATS
=======

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).
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).

4 changes: 3 additions & 1 deletion dist.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ filename = lib/File/Find.rakumod
; match = ^ 'xt/'

[Badges]
provider = github-actions/test.yml
provider = github-actions/linux.yml
provider = github-actions/macos.yml
provider = github-actions/windows-spec.yml
20 changes: 11 additions & 9 deletions lib/File/Find.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,27 @@ sub find (:$dir!, Mu :$name, :$type, Mu :$exclude = False, Bool :$recursive = Tr
=head1 NAME
File::Find - Get a lazy list of a directory tree
File::Find - Get a lazy sequence of a directory tree
=head1 SYNOPSIS
use File::Find;
my @list := find(dir => 'foo');
my @list = lazy find(dir => 'foo'); # Keep laziness
say @list[0..3];
my $list = find(dir => 'foo');
my $list = find(dir => 'foo'); # Keep laziness
say $list[0..3];
my @list = find(dir => 'foo'); # Drop laziness
say @list[0..3];
=head1 DESCRIPTION
C<File::Find> allows you to get the contents of the given directory,
recursively, depth first.
The only exported function, C<find()>, generates a lazy
list of files in given directory. Every element of the list is an
The only exported function, C<find()>, generates a C<Seq>
of files in given directory. Every element of the C<Seq> is an
C<IO::Path> object, described below.
C<find()> takes one (or more) named arguments. The C<dir> argument
is mandatory, and sets the directory C<find()> will traverse.
Expand Down Expand Up @@ -117,10 +120,9 @@ File::Find::Rule, and its features are planned to be similar one day.
=head1 CAVEATS
List assignment is eager in Raku, so if You assign C<find()> result
to an array, the elements will be copied and the laziness will be
spoiled. For a proper lazy list, use either binding (C<:=>) or assign
a result to a scalar value (see SYNOPSIS).
List assignment is eager by default in Raku, so if you assign a C<find()>
result to an array, the laziness will be dropped by default. To keep the
laziness either insert C<lazy> or assign to a scalar value (see SYNOPSIS).
=end pod

Expand Down

0 comments on commit ceb3c19

Please sign in to comment.