Skip to content

Commit

Permalink
0.0.49
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed May 8, 2024
1 parent fa2eb4e commit 736d962
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 4 deletions.
4 changes: 4 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ Revision history for rak

{{$NEXT}}

0.0.49 2024-05-08T11:59:39+02:00
- Bump dependency on path-utils
- Add support for :is-pdf argument

0.0.48 2024-04-29T20:38:00+02:00
- Bump dependency on path-utils
- Add support for :is-moarvm argument
Expand Down
4 changes: 2 additions & 2 deletions META6.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"Git::Files:ver<0.0.6>:auth<zef:lizmat>",
"hyperize:ver<0.0.2>:auth<zef:lizmat>",
"paths:ver<10.0.9>:auth<zef:lizmat>",
"path-utils:ver<0.0.14>:auth<zef:lizmat>",
"path-utils:ver<0.0.15>:auth<zef:lizmat>",
"Trap:ver<0.0.1>:auth<zef:lizmat>"
],
"description": "Plumbing to be able to look for stuff",
Expand All @@ -29,5 +29,5 @@
],
"test-depends": [
],
"version": "0.0.48"
"version": "0.0.49"
}
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Filter down the list of sources from step 1 on any additional filesystem related
<th>argument</th> <th>meaning</th>
</tr></thead>
<tbody>
<tr> <td>:accept</td> <td>given an IO::Path, is path acceptable</td> </tr> <tr> <td>:accessed</td> <td>when was path last accessed</td> </tr> <tr> <td>:blocks</td> <td>number of filesystem blocks</td> </tr> <tr> <td>:created</td> <td>when was path created</td> </tr> <tr> <td>:deny</td> <td>given an IO::Path, is path NOT acceptable</td> </tr> <tr> <td>:device-number</td> <td>device number on which path is located</td> </tr> <tr> <td>:exec</td> <td>run program, include if successful</td> </tr> <tr> <td>:filesize</td> <td>size of the path in bytes</td> </tr> <tr> <td>:gid</td> <td>numeric gid of the path</td> </tr> <tr> <td>:hard-links</td> <td>number of hard-links to path on filesystem</td> </tr> <tr> <td>:has-setgid</td> <td>has SETGID bit set in attributes</td> </tr> <tr> <td>:has-setuid</td> <td>has SETUID bit set in attributes</td> </tr> <tr> <td>:inode</td> <td>inode of path on filesystem</td> </tr> <tr> <td>:is-empty</td> <td>is path empty (filesize == 0)</td> </tr> <tr> <td>:is-executable</td> <td>is path executable by current user</td> </tr> <tr> <td>:is-group-executable</td> <td>is path executable by group</td> </tr> <tr> <td>:is-group-readable</td> <td>is path readable by group</td> </tr> <tr> <td>:is-group-writable</td> <td>is path writable by group</td> </tr> <tr> <td>:is-moarvm</td> <td>is path a MoarVM bytecode file</td> </tr> <tr> <td>:is-owned-by-group</td> <td>is path owned by group of current user</td> </tr> <tr> <td>:is-owned-by-user</td> <td>is path owned by current user</td> </tr> <tr> <td>:is-owner-executable</td> <td>is path executable by owner</td> </tr> <tr> <td>:is-owner-readable</td> <td>is path readable by owner</td> </tr> <tr> <td>:is-owner-writable</td> <td>is path writable by owner</td> </tr> <tr> <td>:is-readable</td> <td>is path readable by current user</td> </tr> <tr> <td>:is-sticky</td> <td>has STICKY bit set in attributes</td> </tr> <tr> <td>:is-symbolic-link</td> <td>is path a symbolic link</td> </tr> <tr> <td>:is-text</td> <td>does path contains text?</td> </tr> <tr> <td>:is-world-executable</td> <td>is path executable by any user</td> </tr> <tr> <td>:is-world-readable</td> <td>is path readable by any user</td> </tr> <tr> <td>:is-world-writable</td> <td>is path writable by any user</td> </tr> <tr> <td>:is-writable</td> <td>is path writable by current user</td> </tr> <tr> <td>:meta-modified</td> <td>when meta information of path was modified</td> </tr> <tr> <td>:mode</td> <td>the mode of the path</td> </tr> <tr> <td>:modified</td> <td>when path was last modified</td> </tr> <tr> <td>:shell</td> <td>run shell command, include if successful</td> </tr> <tr> <td>:uid</td> <td>numeric uid of path</td> </tr>
<tr> <td>:accept</td> <td>given an IO::Path, is path acceptable</td> </tr> <tr> <td>:accessed</td> <td>when was path last accessed</td> </tr> <tr> <td>:blocks</td> <td>number of filesystem blocks</td> </tr> <tr> <td>:created</td> <td>when was path created</td> </tr> <tr> <td>:deny</td> <td>given an IO::Path, is path NOT acceptable</td> </tr> <tr> <td>:device-number</td> <td>device number on which path is located</td> </tr> <tr> <td>:exec</td> <td>run program, include if successful</td> </tr> <tr> <td>:filesize</td> <td>size of the path in bytes</td> </tr> <tr> <td>:gid</td> <td>numeric gid of the path</td> </tr> <tr> <td>:hard-links</td> <td>number of hard-links to path on filesystem</td> </tr> <tr> <td>:has-setgid</td> <td>has SETGID bit set in attributes</td> </tr> <tr> <td>:has-setuid</td> <td>has SETUID bit set in attributes</td> </tr> <tr> <td>:inode</td> <td>inode of path on filesystem</td> </tr> <tr> <td>:is-empty</td> <td>is path empty (filesize == 0)</td> </tr> <tr> <td>:is-executable</td> <td>is path executable by current user</td> </tr> <tr> <td>:is-group-executable</td> <td>is path executable by group</td> </tr> <tr> <td>:is-group-readable</td> <td>is path readable by group</td> </tr> <tr> <td>:is-group-writable</td> <td>is path writable by group</td> </tr> <tr> <td>:is-moarvm</td> <td>is path a MoarVM bytecode file</td> </tr> <tr> <td>:is-owned-by-group</td> <td>is path owned by group of current user</td> </tr> <tr> <td>:is-owned-by-user</td> <td>is path owned by current user</td> </tr> <tr> <td>:is-owner-executable</td> <td>is path executable by owner</td> </tr> <tr> <td>:is-owner-readable</td> <td>is path readable by owner</td> </tr> <tr> <td>:is-owner-writable</td> <td>is path writable by owner</td> </tr> <tr> <td>:is-pdf</td> <td>is path a PDF file</td> </tr> <tr> <td>:is-readable</td> <td>is path readable by current user</td> </tr> <tr> <td>:is-sticky</td> <td>has STICKY bit set in attributes</td> </tr> <tr> <td>:is-symbolic-link</td> <td>is path a symbolic link</td> </tr> <tr> <td>:is-text</td> <td>does path contains text?</td> </tr> <tr> <td>:is-world-executable</td> <td>is path executable by any user</td> </tr> <tr> <td>:is-world-readable</td> <td>is path readable by any user</td> </tr> <tr> <td>:is-world-writable</td> <td>is path writable by any user</td> </tr> <tr> <td>:is-writable</td> <td>is path writable by current user</td> </tr> <tr> <td>:meta-modified</td> <td>when meta information of path was modified</td> </tr> <tr> <td>:mode</td> <td>the mode of the path</td> </tr> <tr> <td>:modified</td> <td>when path was last modified</td> </tr> <tr> <td>:shell</td> <td>run shell command, include if successful</td> </tr> <tr> <td>:uid</td> <td>numeric uid of path</td> </tr>
</tbody>
</table>

Expand Down Expand Up @@ -390,6 +390,10 @@ Flag. If specified, indicates paths, that are **readable** by the owner, are (no

Flag. If specified, indicates paths, that are **writable** by the owner, are (not) acceptable for further selection.

#### :is-pdf

Flag. If specified, indicates only paths that are `PDF` files are (not) acceptable for further selection.

#### :is-readable

Flag. If specified, indicates paths, that are **readable** by the current **user**, are (not) acceptable for further selection.
Expand Down
6 changes: 6 additions & 0 deletions doc/rak.rakudoc
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ strings of absolute paths to be checked (except where otherwise indicated).
:is-owner-executable is path executable by owner
:is-owner-readable is path readable by owner
:is-owner-writable is path writable by owner
:is-pdf is path a PDF file
:is-readable is path readable by current user
:is-sticky has STICKY bit set in attributes
:is-symbolic-link is path a symbolic link
Expand Down Expand Up @@ -583,6 +584,11 @@ are (not) acceptable for further selection.
Flag. If specified, indicates paths, that are B<writable> by the owner,
are (not) acceptable for further selection.

=head4 :is-pdf

Flag. If specified, indicates only paths that are C<PDF> files are
(not) acceptable for further selection.

=head4 :is-readable

Flag. If specified, indicates paths, that are B<readable> by the current
Expand Down
9 changes: 8 additions & 1 deletion lib/rak.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use Git::Files:ver<0.0.6>:auth<zef:lizmat>; # git-files
use hyperize:ver<0.0.2>:auth<zef:lizmat>; # hyperize raceize
use paths:ver<10.0.9>:auth<zef:lizmat> 'paths'; # paths
use path-utils:ver<0.0.14>:auth<zef:lizmat>; # path-*
use path-utils:ver<0.0.15>:auth<zef:lizmat>; # path-*
use Trap:ver<0.0.1>:auth<zef:lizmat>; # Trap

# code to convert a path into an object that can do .lines and .slurp
Expand Down Expand Up @@ -316,6 +316,13 @@ my sub make-property-filter($seq is copy, %_) {
!! -> $path { path-is-moarvm($path) ?? Empty !! $path }
}

if %_<is-pdf>:exists {
$seq = $seq.map:
(%_<is-pdf>:delete)
?? -> $path { path-is-pdf($path) ?? $path !! Empty }
!! -> $path { path-is-pdf($path) ?? Empty !! $path }
}

$seq.map: &ioify
}

Expand Down

0 comments on commit 736d962

Please sign in to comment.