## dist_github-labster-IO-Path-More.md
# p6-IO-Path-More

IO::Path::More - Extends IO::Path to make it more like p5's Path::Class

## SYNOPSIS

```
#Create a path object
$path1 = path 'foo/bar/baz.txt';
$path2 = IO::Path::More.new('/usr/local/bin/perl6');

#We can do anything that IO::Path does
say "file exists" if $path2.e;
my @lines = $path1.open.lines;

# But wait, there's More!
    $path3 = path "/new/directory/tree";
    $path3.mkpath;              # makes /new, /new/directory, and /new/directory/tree
$path3.=append("erf", 'quux.txt');   # "/new/directory/tree/erf/quux.txt"
    $path3.touch;               # makes an empty "quux.txt" file
path("/new").rmtree         # removes everything under "/new"

# Not quite working yet: Foreign paths
# It should work correctly if you run Windows, though.
$WindowsPath = IO::Path::More.new('C:\\bar\\baz\\\\', OS => 'MSWin32');
#                                     ^ don't forget to escape your backslashes
say $WindowsPath;                       # "C:\bar\baz"
say $WindowsPath.volume;                # "C:"

```

## DESCRIPTION

IO::Path::More is intended to be a cross-platform replacement for the built-in IO::Path. Internally, we use File::Spec to deal with all of the issues on differing paths on different operating systems, so you don't have to.

Currently, only Win32 and Unix-type systems are finished (including Mac OS X) in P6 File::Spec, but support should get better as File::Spec gains more OSes.

## INTERFACE

There are two ways to create an IO::Path::More object. Either though the object interface, or via the path function.

```
IO::Path::More.new( $mypath );
path $mypath;

```

While you can create a path object with named arguments, you probably shouldn't, unless you don't want path cleanup to happen.

Note that the methods do not actually transform the object, but rather return a new IO::Path::More object. Therefore, if you want to change the path, use a mutating method, like `$path.=absolute`.

## METHODS

This module provides a class based interface to all sorts of filesystem related functions on paths:

#### append( \*@parts )

Concatenates anything passed onto the end of the path, and returns the result in a new object. For example, `path("/foo").append(<bar baz/zig>)` will return a path of `/foo/bar/baz/zig`.

#### find(:$name, :$type, Bool :$recursive = True)

Calls File::Find with the given options, which are explained in the File::Find documentation. Note that File::Find is not 100% cross-platform yet, so beware on systems where '/' is not a path separator.

#### remove

Deletes the current path. Calls unlink if the path is a file, or calls rmdir if the path is a directory. Fails if there are files in the directory, or if you do not have permission to delete the path.

To remove an entire directory with its contents, see `rmtree`.

#### rmtree

Deletes the path, and all of the contents of that directory. Equivalent
to `rm -rf` on unix boxen. Fails as remove above.

#### mkpath

Makes a directory path out of new directories, as necessary. Equivalent
to `mkdir -p` on the a linux machine.

### IO methods

Methods included in IO::Path (notably .open, .close, and .contents) are available here. See [S32/IO](http://perlcabal.org/syn/S32/IO.html) for details.

### NYI Methods

Not yet implemented due to missing features in Rakudo:

* touch (needs utime)
* resolve (needs readlink)
* stat (needs stat)

### Filetest methods

#### .e, .d, .l, etc...

Builtin methods are reproduced here. Because we inherit from IO::Path, IO::Path::More does IO::Filetestable. See [S32/IO](http://perlcabal.org/syn/S32/IO.html) for details.

#### inode

Returns the inode number of the current path as an Int. If you're not on a POSIX system, returns False. Inode numbers uniquely identify files on a given device, and all hard links point to the same inode.

#### device

Returns the device number of the current path from a stat call. This is not the same as `.volume`, though both identify the disk/drive/partition.

## TODO

* NYI above
* Foreign paths

## SEE ALSO

* [File::Spec](https://github.com/FROGGS/p6-File-Spec)
* [File::Tools](https://github.com/tadzik/perl6-File-Tools/) - the source of File::Find

## AUTHOR

Brent "Labster" Laabs, 2013.

Contact the author at [bslaabs@gmail.com](mailto:bslaabs@gmail.com) or as labster on #perl6. File [bug reports](https://github.com/labster/p6-IO-Path-More/issues) on github.

## COPYRIGHT

This code is free software, licensed under the same terms as Perl 6; see the LICENSE file for details.

Some methods are based on code originally written by Ken Williams for the Perl 5 module [Path::Class](http://search.cpan.org/~kwilliams/Path-Class/README.pod).


## dist_zef-tbrowder-Date-Names.md
[![Actions Status](https://github.com/tbrowder/Date-Names/workflows/linux/badge.svg)](https://github.com/tbrowder/Date-Names/actions) [![Actions Status](https://github.com/tbrowder/Date-Names/workflows/macos/badge.svg)](https://github.com/tbrowder/Date-Names/actions) [![Actions Status](https://github.com/tbrowder/Date-Names/workflows/win64/badge.svg)](https://github.com/tbrowder/Date-Names/actions)

# Date::Names

Module **Date::Names** - Provides month and weekday names for numbers (multilingual)

# SYNOPSIS

```
use Date::Names;
# choose the German language (English is the default)
my $d = Date::Names.new: :lang<de>;

# Default is to show full names
say $d.dow(3); # OUTPUT: «Mittwoch␤»
say $d.mon(3); # OUTPUT: «März␤»

# What abbreviations are available?
$d.sets; # OUTPUT: «name sets with values:␤  dow  dow2  mon  mon3␤»

# Choose the desired sets
$d = Date::Names.new: :lang<de>, :mset<mon3>, :dset<dow2>;
say $d.dow(4); # OUTPUT: «Do␤»
say $d.mon(4); # OUTPUT: «Apr␤»

# Arbitrarily truncate a word
say $d.mon(8,2); # OUTPUT: «Au␤»

# Given a name, return the number of month of year or day of week
say $d.mon2num('März');     # OUTPUT: «3␤»
say $d.dow2num('Mittwoch'); # OUTPUT: «3␤»

# How to say "The Year 2030"
say "{$d.the-year} 2030"; # OUTPUT: «Das Jahr 2030␤»

```

# DESCRIPTION

Module **Date::Names** provides the full name of months and days of the week for the numbers 1..12 and 1..7, respectively, primarily for use with **Raku**'s date functions.

Full names of the months and weekdays are currently available in the following thirteen languages:

### Table 1. Language ISO codes (lower-case) and '.the-year' values

| Language | ISO code | .the-year |
| --- | --- | --- |
| Dutch | nl | Het jaar |
| English | en | The Year |
| French | fr | L'année |
| German | de | Das Jahr |
| Indonesian | id | Tahun |
| Italian | it | L'anno |
| Norwegian (Bokmål) | nb | Год» да бокмал |
| Norwegian (Nynorsk) | nn | Год» на нюнорск |
| Polish | pl | Rok |
| Romanian | ro | Anul |
| Russian | ru | Год |
| Spanish | es | El año |
| Ukranian | uk | Рік |

The '.the-year' attribute was added for use with the Calendar module to use on a cover page. The attribute values were obtained using Google's translation capability, and they may not be correct. Please file an issue if you are a native language speaker and see an error.

# CAPITALIZATION and PUNCTUATION

All English month and weekday names are always capitalized. Other languages vary in capitalization depending on where the word or abbreviation is used or other factors. The names and abbreviations herein are in the most common form, but the user can always explicitly set the case by applying the Raku routines **tclc**, **uc**, or **lc** to the name or abbreviation.

Some of the abbreviations include an ending period since that is customary use in some languages (e.g., Spanish and Ukranian).

# LIMITATIONS

Not all languages have a complete set of two- and three-letter abbreviations, and some require up to four letters for the official abbreviations.

Table 2 shows the array names for the full names and abbreviations currently available. Array names with a 2 or 3 appended are complete abbreviation sets of that length only. Array names with an 'a' appended are sets of abbreviations of mixed length. A 'Y' in a cell indicates a language has a complete set of that type of abbreviation.

Note that in some countries the term "abbreviation" is distinctly different than "code" as it applies to date names. An asterisk in a cell marks those which are technically codes rather than abbreviations. Table 3 shows the meaning of other codes used in the Table 2 cells.

The array names in Table 2 (without a sigil) are the ones to be used for the day and month array names for the **Date::Names** class constructor.

### Table 2. Name array availability by language

| Language - ISO / Array | mon | dow | mon3 | dow3 | mon2 | dow2 | mona | dowa |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Dutch - nl | YL | YL | YL | YL |  | YL |  |  |
| English - en | Y | Y | Y | Y |  | Y |  |  |
| French - fr | YL | YL |  | YL | YU\* |  | YL | Y |
| German - de | Y | Y | Y | Y |  | Y |  |  |
| Indonesian - id | Y | Y | Y | Y |  |  |  |  |
| Italian - it | Y | YL |  |  |  |  |  |  |
| Norwegian (Bokmål) - nb | YL | YL | YL | YL |  |  |  | YL |
| Norwegian (Nynorsk) - nn | YL | YL | YL | YL |  |  |  | YL |
| Polish - pl | YL | YL | YL |  |  | YL |  |  |
| Romanian - ro | YL | YL | YL |  |  | YL | YL |  |
| Russian - ru | YL | YL | YL |  |  | YL |  |  |
| Spanish - es | YL | YL | YL\* | YL\* | YL | YL | LP | LP |
| Ukranian - uk | YL | YL | YL |  | YL | YL | LP | LP |

Table 3 defines the note codes used in Table 2.

Note all arrays are title-cased unless marked with a 'U' or an 'L'.

### Table 3. Name array cell codes and meaning

| Code | Meaning |
| --- | --- |
| \* | a code rather than an abbreviation |
| L | array values are lower-case |
| P | array values have a trailing period |
| U | array values are upper-case |
| Y | language has this array |

Some of the most-used names in calendar construction are the abbreviations for the days-of-the-week (dow), both two- and three-letter ones. One common example of using a two-letter dow abbreviation use is in the Linux system utility 'cal'. And very common, at least in the US, are the three-letter dow abbreviations on many printed calendars, especially ones printed by users on home printers. The five languages in Table 4 don't have a complete set of dow2 and dow3 abbreviations, so this module will automatically create one by truncating the full dow or month name to the desired length.

There are more languages that don't have a full set of two- and three-letter month abbreviations, as can be seen in Table 2. If they are required by the user, they will also be created automatically by truncation.

### Table 4. Name array for truncated dow2 and dow3 languages

| Language | ISO | dow3 | dow2 |
| --- | --- | --- | --- |
| French | fr | YL |  |
| Indonesian | id | Y |  |
| Italian | it |  |  |
| Norwegian (Bokmål) | nb | YL |  |
| Norwegian (Nynorsk) | nn | YL |  |

Note that when the **Date::Names** class is fully implemented in Version 3, the user will be able to specify desired array table attributes for his or her tastes (case, trailing period, truncation or padding).

### Methods to see what is available

(See [All-SETS](ALL-SETS.md) for the complete list for all languages.)

```
use Date::Names
my $dn = Date::Names.new: :lang<nl>;
# how many non-empty data sets?
say $dn.nsets; # OUTPUT: «5␤»
# show the sets:
$dn.sets; # OUTPUT: «name sets with values:␤  dow  dow2  dow3  mon  mon3␤»
# show all sets in all available languages
$dn.show-all; # OUTPUT: see ALL-SETS.md)

```

# Features:

1. English language default
2. Default month and weekday array choices
3. User chooses which month and weekday array to use
4. Methods for entering a valid abbreviation of weekday or month name and returning its number
5. When requesting an abbreviation that doesn't exist, the full name is automatically truncated to the desired length.

# Planned features:

1. User chooses case of the output names [API complete, needs tests]
2. User can choose to have a period or not for abbreviations [API complete, needs tests]

# Possible future features

1. Language-specific attributes to affect class behavior (e.g., allow raw truncation or not)
2. Add additional array names and types on a language basis automatically via a separate Common Locale Data Repository (CLDR) date module
3. Features desired by users

The basic class is working (see **New features** and **Planned features** above) and will be able to control casing, absence or presence of periods on abbreviations, and truncation or padding as desired.

# VERSION 3

* A CLDR module which can produce compatible language data for this module will be available.
* Additionally, the CLDR date data set names will be mapped to the current names where possible, and some short set names added if necessary.
* All CLDR data set names will also be available as aliases or native arrays.
* The **Date::Names** class API will be fixed and all currently planned features will be fully implemented and tested.

# PULL REQUESTS

Native language speakers please submit PRs to (1) complete the existing language abbreviations, (2), correct errors, and (3) provide more languages. See the [CONTRIBUTING](CONTRIBUTING.md) file for details.

# CORRECTIONS and SUGGESTIONS

The goal of this module is to be useful to non-English users as well as English users. The author welcomes suggestions for improvement and increased utility.

# ACKNOWLEDGEMENTS

The following persons contributed to this project via PRs and comments (@name is an alias on IRC #raku):

* Moritz Lenz (@moritz, Github: moritz) - German and Norwegian Bokmﾃ･l data
* @sena\_kun (Github: Altai-man) - Russian data
* Luc St-Louis (@lucs, Github: lucs) - French data
* Luis F. Uceta (Github: uzluisf) - Spanish data
* Elizabeth Mattijsen (@lizmat, Github: lizmat) - Dutch data
* Github: heince - Indonesian data
* Github: tzjan - Polish data
* Eskild Hustvedt (@Zero\_Dogg, Github: zerodogg) - Norwegian Nynorsk data
* Github: altblue - Romanian data
* Andrij Mizyk (Github: andmizyk) - Ukranian data

I am grateful for their help!

# REFERENCES

1. [FR] <http://bdl.oqlf.gouv.qc.ca/bdl/gabarit_bdl.asp?id=3617>
2. [ES] <http://www.wikilengua.org/index.php/Abreviaciones_en_fechas>
3. [ES] <http://lema.rae.es/dpd/srv/search?id=fKODyKTfZD6s0mX7bz>

# AUTHOR

Tom Browder, [tom.browder@acm.org](mailto:tom.browder@acm.org)

# COPYRIGHT and LICENSE

Copyright © 2019-2024 Tom Browder

This program is free software; you may redistribute or modify it under the same terms as Raku itself.


## dist_zef-masukomi-CLI-Graphing-BarChart.md
# CLI::Graphing::BarChart

CLI::Graphing::BarChart is a simple library to let you produce bar graphs on the command line.
It takes special care to give you good looking output.

![example graph](../readme_images/images/social_media_preview.png)

Currently limited to vertical bar charts. See the end of this document for future plans & contribution guidelines.

# SYNOPSIS

Note that the 0 x 0 point of this graph is the bottom left corner.
Data and labels start from there and move outwards.

Folks using Arabic & other Right-to-Left are encouraged to make a PR
to support reversed graphs.

## Required Attributes

When creating a graph there are two required keys. `graph_height` and `data`.

`graph_height` is how tall you wish the core graph to be in lines.
This does not include the additional lines for the x axis or its dividing line.

`data` is an array of numbers. Each is expected to be a percentage from 0 to 100.
100 create a vertical bar `graph_height` lines tall. 0 will create an empty bar.

Note, there *will* be rounding issues if your `graph_height` is anything other than
an even multiple of 100. This is ok.

Just to set expectations, if for example, you specify a `graph_height`
of 10 that means there are only 10 vertical elements to each bar. If
one of your data points is 7 you'll end up with an empty bar because that's
less than the number needed to activate the 1st element (10).

## Optional Attributes

`x_axis_labels` This is an array of labels that must be equal in length
to the number of data points. If you want some of your bars to be unlabeled
then specify a space for that "label".

`y_axis_labels` This is an array of labels that must be equal in length
to the `graph_height` (one label per row). Again, if you want some of
the points to be unlabeled, you should use a space character.

Note that the 0 x 0 point of this graph is the bottom left. So your list
of `y_axis_labels` will go from bottom up. This corresponds to how the
`data` and `x_axis_labels` go from left to right.

`space_between_columns` This is a `Bool` which defaults to `True`. If you
set it to `False` the system will *not* introduce a space between each column.
This works fine, and may be a good choice if you have a large number of data points,
but for short graphs it's almost always worse looking.

### Advice

From a purely visual perspective it is not recommended that you use
full words for your `x_axis_labels`. In order to not introduce a false sense
of time compression or similar meaning, every bar gets spread out by the
length of the longest label.

`y_axis_labels` should be fine regardless of length. They are right-aligned, and
just shove the graph farther to the right.

I would not recommend generating a graph that's more than 10 characters high.

See `tester.raku` for examples.

## Legend

This library does not support generating a legend for your graph.
My advice is to use single letter `x_axis_labels` and then use
[Prettier::Table](https://github.com/masukomi/Prettier-Table/)
to generate a legend that explains your x axis.

```
use CLI::Graphing::BarChart::Vertical;

my $x_and_y_axis_graph = CLI::Graphing::BarChart::Vertical.new(
    data => [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100],
    graph_height => 10,
    x_axis_labels => <a b c d e f g h i j k>,
    y_axis_labels => <0 1 2 3 4 5 6 7 8 9>
);

# to get the string version of the graph
$x_and_y_axis_graph.generate();

# to print the graph to Standard Out
$x_and_y_axis_graph.print();

```

# Future + Contributing

## Future Plans

This actually starts out by generating a horizontal graph and then rotates it, and adds the X axis and divider lines (see inline comments).

The plan is to add `CLI::Graphing::BarChart::Horizontal` to this library, by extracting the initial bit of `Vertical` into a common module and then building `Horizontal` around that.

This will happen as soon as I need it, or *you* need it enough to make a Pull Request.

## Contributing

Please do. All I ask is that you include unit tests that cover whatever changes or additions you make, and that you're fine with your contributions being distributed under the AGPL.

What kind of contributions? New Features, refactored code, more tests, etc.

For best results, please ping me on mastodon (see below) to make sure I see your PR right away.

# AUTHOR

web: [masukomi](https://masukomi.org)
mastodon: [@masukomi@connectified.com](https://connectified.com/@masukomi)

# COPYRIGHT AND LICENSE

Copyright 2023 Kay Rhodes (a.k.a. masukomi)

This library is free software; you can redistribute it and/or modify it under the AGPL 3.0 or later. See LICENSE.md for details.


## introduction.md
Raku language documentation

Introductory material, tutorials and migration guides for users familiar with other languages.

Getting started

[About the docs](language/about)

How to contribute to Raku and to the documents, how to generate the docs locally

[Announcements page](announcements)

A date-stamped list of notes relevant to the Raku documentation site.

[Brief introduction](language/intro)

Using Raku official documentation

[Filename extensions](language/filename-extensions)

The extensions recommended for files with Raku content.

[Raku by example 101](language/101-basics)

A basic introductory example of a Raku program

Migration guides

[Haskell to Raku - nutshell](language/haskell-to-p6)

Learning Raku from Haskell, in a nutshell

[JavaScript (Node.js) to Raku - nutshell](language/js-nutshell)

Learning Raku from Node.js, in a nutshell

[Perl to Raku guide - functions](language/5to6-perlfunc)

Builtin functions in Perl to Raku

[Perl to Raku guide - in a nutshell](language/5to6-nutshell)

How do I do what I used to do? (Raku in a nutshell)

[Perl to Raku guide - operators](language/5to6-perlop)

Operators in Perl to Raku: equivalencies and variations

[Perl to Raku guide - overview](language/5to6-overview)

How do I do what I used to do?

[Perl to Raku guide - special variables](language/5to6-perlvar)

A comparison of special variables in Perl and Raku

[Perl to Raku guide - syntax](language/5to6-perlsyn)

Syntactic differences between Perl and Raku

[Python to Raku - nutshell](language/py-nutshell)

Learning Raku from Python, in a nutshell

[Ruby to Raku - nutshell](language/rb-nutshell)

Learning Raku from Ruby, in a nutshell: what do I already know?

Tutorials

[Classes and objects](language/classtut)

A tutorial about creating and using classes in Raku

[Command line interface](language/create-cli)

Creating your own CLI in Raku

[CompUnits and where to find them](language/compilation)

How and when Raku modules are compiled, where they are stored, and how to access them in compiled form.

[Concurrency](language/concurrency)

Concurrency and asynchronous programming

[Core modules](language/modules-core)

Core modules that may be useful to module authors

[Creating operators](language/optut)

A short tutorial on how to declare operators and create new ones.

[Doing math with Raku](language/math)

Different mathematical paradigms and how they are implemented in this language

[Entering unicode characters](language/unicode_entry)

Input methods for unicode characters in terminals, the shell, and editors

[Grammar tutorial](language/grammar_tutorial)

An introduction to grammars

[Input/Output](language/io)

File-related operations

[Inter-process communication](language/ipc)

Programs running other programs and communicating with them

[Iterating](language/iterating)

Functionalities available for visiting all items in a complex data structure

[Module development utilities](language/modules-extra)

What can help you write/test/improve your module(s)

[Module packages](language/module-packages)

Creating module packages for code reuse

[Modules](language/modules)

How to create, use, and distribute Raku modules

[REPL](language/REPL)

Read-eval-print loop

[Regexes: best practices and gotchas](language/regexes-best-practices)

Some tips on regexes and grammars

[Slangs](language/slangs)

Slangs in Raku


## dist_cpan-UFOBAT-Time-Crontab.md
[![Build Status](https://travis-ci.org/ufobat/p6-time-crontab.svg?branch=master)](https://travis-ci.org/ufobat/p6-time-crontab)

# NAME

Time::Crontab for raku

# SYNOPSIS

```
use Time::Crontab;
my $crontab = "* * * * *";
my $tc = Time::Crontab.new(:$crontab);
if $tc.match(DateTime.now, :truncate(True)) { ..... }

```

# METHODS

* `new(Str :$crontab!, Int :$timezone = 0) returns DateTime:D`
* `match(DateTime $datetime, Bool :$truncate = False) returns Bool:D`

Matches the $datetime against the crontab specification. Since the crontab's smallest granulation is minute wise there is a option to $truncate the $datetime to minutes when it comes to consideration if the $datetime matches the $crontab.

* `next-datetime(DateTime $datetie) returns DateTime:D`

Calculates the next execution right after $datetime.

# SYNTAX OF THE CRONTAB

```
Field name   Allowed values  Allowed special characters
Minutes      0-59            * / , - !
Hours        0-23            * / , - !
Day of month 1-31            * / , - !
Month        1-12 or JAN-DEC * / , - !
Day of week  0-6 or SUN-SAT  * / , - !

```

* `*` means anything. The actual values depends on the field.
* `/` is a stepping. This special character must be followed bit a number, which decribes the step size.
* `,` can be used to list different values, or ranges.
* `-` indicates a range.
* `!` excludes a value.

The names of the month or day of the week are the first 3 characters of their english names. They are case insensetive.

# DAY OF MONTH VS DAY OF WEEK

The Handling of the Day of Week and Day of Month is quite delicate. In the case that the Day of Week field is set to any (\*) you basically dont care for it.

This is borrowd from the crontab 5 manpage

```
 Note: The day of a command's execution can be specified by two fields — day of month, and day of week.  If both fields are restricted (i.e., aren't *), the command  will  be
 run when either field matches the current time.  For example,
 ``30  4  1,15 * 5'' would cause a command to be run at 4:30 am on the 1st and 15th of each month, plus every Friday. One can, however, achieve the desired result by adding a
 test to the command (see the last example in EXAMPLE CRON FILE below).

 # run five minutes after midnight, every day
 5 0 * * *       $HOME/bin/daily.job >> $HOME/tmp/out 2>&1
 # run at 2:15pm on the first of every month -- output mailed to paul
 15 14 1 * *     $HOME/bin/monthly
 # run at 10 pm on weekdays, annoy Joe
 0 22 * * 1-5    mail -s "It's 10pm" joe%Joe,%%Where are your kids?%
 23 0-23/2 * * * echo "run 23 minutes after midn, 2am, 4am ..., everyday"
 5 4 * * sun     echo "run at 5 after 4 every sunday"
 # Run on every second Saturday of the month
 0 4 8-14 * *    test $(date +\%u) -eq 6 && echo "2nd Saturday"

```


## dist_zef-jonathanstowe-IO-Path-Mode.md
# IO::Path::Mode

Augment Raku's IO::Path with a .mode() method to get the file mode

![Build Status](https://github.com/jonathanstowe/IO-Path-Mode/workflows/CI/badge.svg)

## Synopsis

```

use IO::Path::Mode;

my $mode = "some-file".IO.mode;

say $mode.set-user-id ?? 'setuid' !! 'not setuid';

say $mode.user.execute ?? 'executable' !! 'not executable';

say $mode.file-type == IO::Path::Mode::File ?? 'file' !! 'something other than a normal file';

...

```

## Description

This augments the type `IO::Path` to provide a `.mode` method
that allows you to get at the file permissions (or mode.) It follows
the POSIX model pf user, group and other permissions and consequently
may not make a meaningful result on e.g. Windows (although the underlying
calls appear to return something approximating the correct answer.)

If you have a more recent rakudo that provides a `mode` method, it
will replace that method with one that returns an `IO::Path::Mode`
object rather than an `IntStr`, this is a transitional arrangement
and will be deprecated in a future release in favour of a different
method name.

It relies on some non-specified functionality in the VM so may probably
only work with Rakudo on MoarVM.

This is mostly provided as some relief for not having the functionality
directly exposed in Rakudo and as a discussion board for the best way
of implementing the functionality going forward.

## Installation

Assuming you have a working Rakudo installation you should be able to install this with *zef* :

```
# From the source directory

zef install .

# Remote installation

zef install IO::Path::Mode

```

## Support

I welcome suggestions, patches and bug reports at <https://github.com/jonathanstowe/IO-Path-Mode/issues>

I'd be particularly interested in suggestions relating to making
the mode mutable and adding a multi candidate for 'chmod' that
can take an `IO::Path::Mode` object.

## Licence

This is free software.

Please see the <LICENCE> file in the distribution

© Jonathan Stowe 2016 - 2021


## dist_zef-tony-o-Bench.md
# Bench[mark]

Benchmark tool for benchmarking how long a block of code runs for X iterations *or* how many times it can run in a given period.

Bench now uses Telemetry if you have it to show you the USR/SYS/CPU times, so your output below may look slightly different.

# Usage

```
use Bench;

my $b = Bench.new;

$b.timethese(1000, {
  first  => sub { sleep .05; },
  second => sub { sleep .005; },
});
'---------------------------------------------------------'.say;
$b.cmpthese(1000, {
  first  => sub { sleep .05; },
  second => sub { sleep .005; },
});

```

Output

```
Benchmark:
Timing 1000 iterations of first, second...
     first: 51.5808 wallclock secs @ 19.3871/s (n=1000)
    second: 6.4035 wallclock secs @ 156.1656/s (n=1000)
---------------------------------------------------------
Benchmark:
Timing 1000 iterations of first, second...
     first: 51.5511 wallclock secs @ 19.3982/s (n=1000)
    second: 6.4145 wallclock secs @ 155.8971/s (n=1000)
O--------O--------O-------O--------O
|        | Rate   | first | second |
O========O========O=======O========O
| first  | 19.4/s | --    | -88%   |
| second | 156/s  | 704%  | --     |
------------------------------------

```

# Methods

## .timestr(Array) returns Str

Takes an array returned from any of the following methods and returns a formatted string with the data filled in. The string is similar to below: `6.4145 wallclock secs @ 155.8971/s (n=1000)`

## .timeit(Int $iterations, Sub) returns Array

Times a single sub over X iterations. Doesn't output anything by default, just returns an array of time spent and iterations. Use in conjunction with `.timestr`

## .countit(Rat $time, Sub) returns Array

Returns how many iterations of the Sub it can run in the specified time. Use in conjunction with `.timestr`

## .timethis(Int $iterations, Sub, Str :$title) returns Array

Runs the specified sub for $iterations and automatically prints out the `.timestr`. If $iterations is negative or 0 then it runs `.countit` instead of `.timeit`

## .timethese(Int $iterations, Hash $Subs) returns Array

Similar to `.timethis` but the key in the hash becomes the title for the test. An example of the output can be

## .cmpthese(Int $iterations, Hash $Subs) returns Array

Similar to `.timethese` but it produces a cute little table comparing the results.

# License

Do whatever you want with it.

# Authors

[@tony-o](https://www.gittip.com/tony-o/)


## dist_zef-lizmat-P5reverse.md
[![Actions Status](https://github.com/lizmat/P5reverse/workflows/test/badge.svg)](https://github.com/lizmat/P5reverse/actions)

# NAME

Raku port of Perl's reverse() built-in

# SYNOPSIS

```
use P5reverse;

say reverse "Foo";  # ooF

with "Zippo" {
    say reverse();  # oppiZ, may need parens to avoid compilation error
}

say reverse 1,2,3;  # (3 2 1)

with 1,2,3 {
    say reverse();  # (3 2 1), may need parens to avoid compilation error
}

```

# DESCRIPTION

This module tries to mimic the behaviour of Perl's `reverse` built-in as closely as possible in the Raku Programming Language.

# ORIGINAL PERL 5 DOCUMENTATION

```
reverse LIST
        In list context, returns a list value consisting of the elements
        of LIST in the opposite order. In scalar context, concatenates the
        elements of LIST and returns a string value with all characters in
        the opposite order.

            print join(", ", reverse "world", "Hello"); # Hello, world

            print scalar reverse "dlrow ,", "olleH";    # Hello, world

        Used without arguments in scalar context, reverse() reverses $_.

            $_ = "dlrow ,olleH";
            print reverse;                         # No output, list context
            print scalar reverse;                  # Hello, world

        Note that reversing an array to itself (as in "@a = reverse @a")
        will preserve non-existent elements whenever possible; i.e., for
        non-magical arrays or for tied arrays with "EXISTS" and "DELETE"
        methods.

        This operator is also handy for inverting a hash, although there
        are some caveats. If a value is duplicated in the original hash,
        only one of those can be represented as a key in the inverted
        hash. Also, this has to unwind one hash and build a whole new one,
        which may take some time on a large hash, such as from a DBM file.

            %by_name = reverse %by_address;  # Invert the hash

```

# PORTING CAVEATS

## Context does not define behaviour

Whereas in Perl the type of context determines how `reverse` operates, in this implementation it's the type of parameter that determines the semantics. When given a `List`, it will revert the order of the elements. When given something that can coerce to a `Str`, it will return a string with the characters reversed in order.

## $\_ no longer accessible from caller's scope

In future language versions of Raku, it will become impossible to access the `$_` variable of the caller's scope, because it will not have been marked as a dynamic variable. So please consider changing:

```
reverse;

```

to either:

```
reverse($_);

```

or, using the subroutine as a method syntax, with the prefix `.` shortcut to use that scope's `$_` as the invocant:

```
.&reverse;

```

# AUTHOR

Elizabeth Mattijsen [liz@raku.rocks](mailto:liz@raku.rocks)

If you like this module, or what I’m doing more generally, committing to a [small sponsorship](https://github.com/sponsors/lizmat/) would mean a great deal to me!

Source can be located at: <https://github.com/lizmat/P5reverse> . Comments and Pull Requests are wereverseome.

# COPYRIGHT AND LICENSE

Copyright 2018, 2019, 2020, 2021, 2023 Elizabeth Mattijsen

Re-imagined from Perl as part of the CPAN Butterfly Plan.

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.


## done.md
class CX::Done

Done control exception

```raku
class CX::Done does X::Control { }
```

A [control exception](/language/exceptions#Control_exceptions) to be used to indicate a supply block is finished by calling `done`.

# [Methods](#class_CX::Done "go to top of document")[§](#Methods "direct link")

## [method message](#class_CX::Done "go to top of document")[§](#method_message "direct link")

```raku
method message()
```

Returns `'<done control exception>'`.


## intstr.md
class IntStr

Dual value integer and string

```raku
class IntStr is Allomorph is Int { }
```

`IntStr` is a dual value type, a subclass of both [`Allomorph`](/type/Allomorph), hence [`Str`](/type/Str), and [`Int`](/type/Int).

See [`Allomorph`](/type/Allomorph) for further details.

```raku
my $int-str = <42>;
say $int-str.^name;     # OUTPUT: «IntStr␤»

my Int $int = $int-str; # OK!
my Str $str = $int-str; # OK!

# ∈ operator cares about object identity
say 42 ∈ <42  55  1>;   # OUTPUT: «False␤»

```

# [Methods](#class_IntStr "go to top of document")[§](#Methods "direct link")

## [method new](#class_IntStr "go to top of document")[§](#method_new "direct link")

```raku
method new(Int $i, Str $s)
```

The constructor requires both the [`Int`](/type/Int) and the [`Str`](/type/Str) value, when constructing one directly the values can be whatever is required:

```raku
my $f = IntStr.new(42, "forty two");
say +$f; # OUTPUT: «42␤»
say ~$f; # OUTPUT: «"forty two"␤»
```

## [method Int](#class_IntStr "go to top of document")[§](#method_Int "direct link")

```raku
method Int
```

Returns the integer value of the `IntStr`.

## [method Numeric](#class_IntStr "go to top of document")[§](#method_Numeric "direct link")

```raku
multi method Numeric(IntStr:D: --> Int:D)
multi method Numeric(IntStr:U: --> Int:D)
```

The `:D` variant returns the numeric portion of the invocant. The `:U` variant issues a warning about using an uninitialized value in numeric context and then returns value `0`.

## [method Real](#class_IntStr "go to top of document")[§](#method_Real "direct link")

```raku
multi method Real(IntStr:D: --> Int:D)
multi method Real(IntStr:U: --> Int:D)
```

The `:D` variant returns the numeric portion of the invocant. The `:U` variant issues a warning about using an uninitialized value in numeric context and then returns value `0`.

# [Operators](#class_IntStr "go to top of document")[§](#Operators "direct link")

## [infix `===`](#class_IntStr "go to top of document")[§](#infix_=== "direct link")

```raku
multi infix:<===>(IntStr:D $a, IntStr:D $b)
```

`IntStr` Value identity operator. Returns `True` if the [`Int`](/type/Int) values of `$a` and `$b` are [identical](/routine/===) and their [`Str`](/type/Str) values are also [identical](/routine/===). Returns `False` otherwise.

# [Typegraph](# "go to top of document")[§](#typegraphrelations "direct link")

Type relations for `IntStr`

raku-type-graph

IntStr
IntStr

Allomorph
Allomorph

IntStr->Allomorph

Int
Int

IntStr->Int

Mu
Mu

Any
Any

Any->Mu

Cool
Cool

Cool->Any

Stringy
Stringy

Str
Str

Str->Cool

Str->Stringy

Allomorph->Str

Numeric
Numeric

Real
Real

Real->Numeric

Int->Cool

Int->Real

[Expand chart above](/assets/typegraphs/IntStr.svg)


## dist_zef-tbrowder-Holidays-US-Federal.md
[![Actions Status](https://github.com/tbrowder/Holidays-US-Federal/actions/workflows/linux.yml/badge.svg)](https://github.com/tbrowder/Holidays-US-Federal/actions) [![Actions Status](https://github.com/tbrowder/Holidays-US-Federal/actions/workflows/macos.yml/badge.svg)](https://github.com/tbrowder/Holidays-US-Federal/actions) [![Actions Status](https://github.com/tbrowder/Holidays-US-Federal/actions/workflows/windows.yml/badge.svg)](https://github.com/tbrowder/Holidays-US-Federal/actions)

# NAME

**Holidays::US::Federal** - Provides names, dates, and dates observed for US Federal holidays

# SYNOPSIS

```
use Holidays::US::Federal;
use UUID::V4;

my $year = 2025;
my $set-id = uuid-v4; # A unique ID for the set of holidays so they can be
                      # merged with other C<Date::Event> sets for calendar
                      # generation;
my %us = get-fedholidays :$year, :$set-id;
# Keys of the '%us' hash are the C<$year>'s dates with holidays
my @d = %us.keys.sort({$^a cmp $^b}); # Get array in date order
for @d -> $D {
    my Date $date .= new: $D; # Get the Date
    my %h = %us{$date};       # All the events on that date, should always be 1 for
                              # this set of US holidays
    # The value of %h is another hash keyed by: ($set-id ~ '|' ~ $id)
    # but we only break that key down for testing.
    #    %h{$h.date}{$key} = $holiday;
    my $holiday;
    for %h.keys -> $key {
        $holiday = %h{$key}; # The C<FedHoliday> class object (a C<Date::Event>)
        # use the data for a calendar day cell
        my $d  = $holiday.date;
        my $do = $holiday.date-observed;
        my $n  = $holiday.name;
        my $ns = $holiday.short-name;
    }
}

```

# DESCRIPTION

**Holidays::US::Federal** is a module that provides information on the eleven official U.S. federal holidays as of 2023-03-08 according to data available online at <https://www.opm.gov/policy-data-oversight/pay-leave/federal-holidays/>. A description of the rules for traditional dates and when holidays are actually observed as paid holidays off for federal employees is also found on the site. All the data reflect current laws in Title 5 US Code Section 6103.

This module provides a routine which provides a hash of the holidays for a given year keyed by each holiday's traditional date. Each key is a Raku `Date`, and the key's value is a `class FedHoliday is Date::Event` object. The data are perpetual for any given year as long as Title 5 US Code Section 6103 stays unchanged.

For this collection there should be no overlapping holidays. Each instance is one with two different date attributes: (1) the traditional `date` and (2) the `date-observed` which is the paid day-off for most federal government employees (as well as for many other employees in the US labor force). If the dates are identical, then that date is the only one to use on a calendar. If they are different, then both should be used.

Note the holidays also have a `short-name` attribute which is not official but has the value used by the author for his calendars in order to fit nicely in a day cell on Letter paper using the author's `Calendar` module. With that style, day cells should be a bit wider (but shorter) when using A4 paper, so the official name may fit satisfactorily in that case. Please file an issue if you have a suggested 'short-name' for those currently without a value.

* NOTE: During the devlopment of this module, functions for finding dates relative to other dates were found to be necessary and were coded and published as a new Raku module: **Date:Utils**. Those routines are expected to be useful for various calendar creation projects. They are:

  * `nth-day-of-week-in-month`
  * `nth-day-of-week-after-date`

  For convenience, the routines have alternative names requiring fewer key strokes. They are:

  * `nth-dow-in-month`
  * `nth-dow-after-date`

# SEE ALSO

Related Raku modules by the author:

* **Date::Christian::Advent**
* **Date::Easter**
* **Holidays::Miscellaneous**
* **Calendar**
* **Date::Event**
* **Date::Utils**

# AUTHOR

Tom Browder [tbrowder@acm.org](mailto:tbrowder@acm.org)

# COPYRIGHT AND LICENSE

© 2024 Tom Browder

This library is free software; you may redistribute it or modify it under the Artistic License 2.0.


## dist_zef-lizmat-P5localtime.md
[![Actions Status](https://github.com/lizmat/P5localtime/workflows/test/badge.svg)](https://github.com/lizmat/P5localtime/actions)

# NAME

Raku port of Perl's localtime / gmtime built-ins

# SYNOPSIS

```
use P5localtime;

#     0    1    2     3     4    5     6     7     8
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
say localtime(Scalar, time);

my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday) = gmtime(time);
say gmtime(Scalar, time);

```

# DESCRIPTION

This module tries to mimic the behaviour of Perl's `localtime` and `gmtime` built-ins as closely as possible in the Raku Programmming Language.

# ORIGINAL PERL 5 DOCUMENTATION

```
localtime EXPR
localtime
        Converts a time as returned by the time function to a 9-element
        list with the time analyzed for the local time zone. Typically
        used as follows:

            #  0    1    2     3     4    5     6     7     8
            ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
                                                        localtime(time);

        All list elements are numeric and come straight out of the C
        `struct tm'. $sec, $min, and $hour are the seconds, minutes, and
        hours of the specified time.

        $mday is the day of the month and $mon the month in the range
        0..11, with 0 indicating January and 11 indicating December. This
        makes it easy to get a month name from a list:

            my @abbr = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
            print "$abbr[$mon] $mday";
            # $mon=9, $mday=18 gives "Oct 18"

        $year contains the number of years since 1900. To get a 4-digit
        year write:

            $year += 1900;

        To get the last two digits of the year (e.g., "01" in 2001) do:

            $year = sprintf("%02d", $year % 100);

        $wday is the day of the week, with 0 indicating Sunday and 3
        indicating Wednesday. $yday is the day of the year, in the range
        0..364 (or 0..365 in leap years.)

        $isdst is true if the specified time occurs during Daylight Saving
        Time, false otherwise.

        If EXPR is omitted, "localtime()" uses the current time (as
        returned by time(3)).

        In scalar context, "localtime()" returns the ctime(3) value:

            $now_string = localtime;  # e.g., "Thu Oct 13 04:54:34 1994"

        The format of this scalar value is not locale-dependent but built
        into Perl. For GMT instead of local time use the "gmtime" builtin.
        See also the "Time::Local" module (for converting seconds,
        minutes, hours, and such back to the integer value returned by
        time()), and the POSIX module's strftime(3) and mktime(3)
        functions.

        To get somewhat similar but locale-dependent date strings, set up
        your locale environment variables appropriately (please see
        perllocale) and try for example:

            use POSIX qw(strftime);
            $now_string = strftime "%a %b %e %H:%M:%S %Y", localtime;
            # or for GMT formatted appropriately for your locale:
            $now_string = strftime "%a %b %e %H:%M:%S %Y", gmtime;

        Note that the %a and %b, the short forms of the day of the week
        and the month of the year, may not necessarily be three characters
        wide.

        The Time::gmtime and Time::localtime modules provide a convenient,
        by-name access mechanism to the gmtime() and localtime()
        functions, respectively.

        For a comprehensive date and time representation look at the
        DateTime module on CPAN.

        Portability issues: "localtime" in perlport.

gmtime EXPR
gmtime  Works just like "localtime" but the returned values are localized
        for the standard Greenwich time zone.

        Note: When called in list context, $isdst, the last value returned
        by gmtime, is always 0. There is no Daylight Saving Time in GMT.

        Portability issues: "gmtime" in perlport.

```

# PORTING CAVEATS

## Mimicking scalar context

Since Raku does not have a concept of scalar context, this must be mimiced by passing the `Scalar` type as the first positional parameter.

The implementation actually also returns the offset in GMT in seconds as element number 9, and the name of the timezone as element number 10, if supported by the OS.

## Depends on POSIX semantics

This module depends on the availability of POSIX semantics. This is generally not available on Windows, so this module will probably not work on Windows.

# AUTHOR

Elizabeth Mattijsen [liz@raku.rocks](mailto:liz@raku.rocks)

If you like this module, or what I’m doing more generally, committing to a [small sponsorship](https://github.com/sponsors/lizmat/) would mean a great deal to me!

Source can be located at: <https://github.com/lizmat/P5localtime> . Comments and Pull Requests are welcome.

If you like this module, or what I’m doing more generally, committing to a [small sponsorship](https://github.com/sponsors/lizmat/) would mean a great deal to me!

# ACKNOWLEDGEMENTS

JJ Merelo, Jan-Olof Hendig, Tobias Leich, Timo Paulssen and Christoph (on StackOverflow) for support in getting this to work.

# COPYRIGHT AND LICENSE

Copyright 2018, 2019, 2020, 2021, 2023, 2024 Elizabeth Mattijsen

Re-imagined from Perl as part of the CPAN Butterfly Plan.

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.


## supplier.md
class Supplier

Live Supply factory

```raku
class Supplier { }
```

This is a factory for *live* [`Supply`](/type/Supply) objects, which provides the mechanism for emitting new values onto the supplies:

```raku
my $supplier = Supplier.new;
my $supply_1 = $supplier.Supply;
$supply_1.tap(-> $v { say "One $v" });
my $supply_2 = $supplier.Supply;
$supply_2.tap(-> $v { say "Two $v" });
$supplier.emit(42);
```

Will output:

｢text｣ without highlighting

```

```

One 42
Two 42

```

```

*on demand* supplies are created by the factory methods of the [`Supply`](/type/Supply) class or by the `supply` keyword. A mixture of a live and on-demand [`Supply`](/type/Supply) can be created with a [`Supplier::Preserving`](/type/Supplier/Preserving).

# [Methods](#class_Supplier "go to top of document")[§](#Methods "direct link")

## [method new](#class_Supplier "go to top of document")[§](#method_new "direct link")

```raku
method new()
```

The `Supplier` constructor.

## [method Supply](#class_Supplier "go to top of document")[§](#method_Supply "direct link")

```raku
method Supply(Supplier:D: --> Supply)
```

This creates a new [`Supply`](/type/Supply) object to which any values which are emitted on this supplier are passed. This is the factory for all `live` supplies.

## [method emit](#class_Supplier "go to top of document")[§](#method_emit "direct link")

```raku
method emit(Supplier:D: Mu \value)
```

Sends the given value to all of the taps on all of the supplies created by [`Supply`](/type/Supply) on this `Supplier`.

## [method done](#class_Supplier "go to top of document")[§](#method_done "direct link")

```raku
method done(Supplier:D:)
```

Calls the `done` callback on all the taps that have one.

```raku
my $supplier = Supplier.new;
my $supply   = $supplier.Supply;
$supply.tap(-> $v { say $v }, done => { say "no more answers" });
$supplier.emit(42);
$supplier.done;
```

Will output:

｢text｣ without highlighting

```

```

42
no more answers

```

```

## [method quit](#class_Supplier "go to top of document")[§](#method_quit "direct link")

```raku
multi method quit(Supplier:D: Exception $ex)
multi method quit(Supplier:D: Str() $message)
```

Calls the `quit` callback on all the taps that have one, passing the exception to them. If called with a [`Str`](/type/Str) the exception will be an [`X::AdHoc`](/type/X/AdHoc) with the supplied message.

This is meant for shutting down a supply with an error.

# [Typegraph](# "go to top of document")[§](#typegraphrelations "direct link")

Type relations for `Supplier`

raku-type-graph

Supplier
Supplier

Any
Any

Supplier->Any

Mu
Mu

Any->Mu

Supplier::Preserving
Supplier::Preserving

Supplier::Preserving->Supplier

[Expand chart above](/assets/typegraphs/Supplier.svg)


## dist_zef-raku-community-modules-ECMA262Regex.md
[![Actions Status](https://github.com/raku-community-modules/ECMA262Regex/actions/workflows/linux.yml/badge.svg)](https://github.com/raku-community-modules/ECMA262Regex/actions) [![Actions Status](https://github.com/raku-community-modules/ECMA262Regex/actions/workflows/macos.yml/badge.svg)](https://github.com/raku-community-modules/ECMA262Regex/actions) [![Actions Status](https://github.com/raku-community-modules/ECMA262Regex/actions/workflows/windows.yml/badge.svg)](https://github.com/raku-community-modules/ECMA262Regex/actions)

# NAME

ECMA262Regex - provide support for ECMA262 regex notation

# SYNOPSIS

```
use ECMA262Regex;

say ECMA262Regex.validate('\e');     # False;
say ECMA262Regex.validate('^fo+\n'); # True

# Translate regex into a Raku one (string form)
say ECMA262Regex.as-raku('^fo+\n');  # '^fo+\n'
say ECMA262Regex.as-raku('[^ab-d]'); # '<-[ab..d]>'

# Compile textual ECMA262 regex into a Raku Regex object
my $regex = ECMA262Regex.compile('^fo+\n');

say "foo\n"  ~~ $regex; # Success
say " foo\n" ~~ $regex; # Failure

```

# DESCRIPTION

This module parses [ECMA262 regex syntax](https://262.ecma-international.org) and can also translate it to a Raku regexes, and compile it to a `Regex` object.

# AUTHORS

* Jonathan Worthington
* Alexander Kiryuhin

Source can be located at: <https://github.com/raku-community-modules/ECMA262Regex> . Comments and Pull Requests are welcome.

# COPYRIGHT AND LICENSE

Copyright 2018 - 2023 Edument AB

Copyright 2024 The Raku Community

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.


## dist_zef-FRITH-Desktop-Notify.md
[![Actions Status](https://github.com/frithnanth/perl6-Desktop-Notify/workflows/test/badge.svg)](https://github.com/frithnanth/perl6-Desktop-Notify/actions)

# NAME

Desktop::Notify - A simple interface to libnotify

# SYNOPSIS

```
use Desktop::Notify::Simple;

my $n = Desktop::Notify::Simple.new(
  :app-name('test'),
  :summary('Attention!'),
  :body('What just happened?'),
  :icon('stop')
).show;

sleep 2;

$n.update(:summary('Oh well!'), :body('Not quite a disaster!'), :icon('stop')).show;

```

```
use Desktop::Notify :constants;

my $notify = Desktop::Notify.new(app-name => 'myapp');
my $n = $notify.new-notification('Attention!', 'What just happened?', 'stop');

$notify.set-timeout($n, NOTIFY_EXPIRES_NEVER);

$notify.show($n);
sleep 2;

$notify.update($n, 'Oh well!', 'Not quite a disaster!', 'stop');

$notify.show($n);

```

# DESCRIPTION

## **Desktop::Notify::Simple** is a set of very simple bindings to libnotify using NativeCall.

### new(Str :$app-name!, Str :$summary!, Str :$body!, Str :$icon!, Int :$timeout?, Str :$category?, NotifyUrgency :$urgency?)

Constructs a new **Desktop::Notify::Simple** object. It takes four mandatory arguments:

* $app-name the name of the app that will be registered with the notify dæmon.
* $summary appears in bold on the top side of the notification
* $body notification body
* $icon icon name

and three optional arguments:

* $timeout expressed in seconds (while Desktop::Notify uses milliseconds)
* $category can be used by the notification server to filter or display the data in a certain way
* $urgency urgency level of this notification

An **enum NotifyUrgency** is available.

### show(GError $err?)

Shows the notification on screen. It takes one optional argument, the GError object. (The default Desktop::Notify error handling is not thread safe. See *Threading safety* for more info)

### update(Str :$summary, Str :$body, Str :$icon)

Modifies the messages of a notification which is already on screen.

### close(GError $err?)

Closes the notification. It takes one optional argument, the GError object. (The default Desktop::Notify error handling is not thread safe. See *Threading safety* for more info) Note that usually there's no need to explicitly 'close' a notification, since the default is to automatically expire after a while.

## **Desktop::Notify** is a set of simple bindings to libnotify using NativeCall. Some function calls are not currently implemented (see the *TODO* section).

### new(Str $appname)

Constructs a new **Desktop::Notify** object. It takes one mandatory argument: **app-name**, the name of the app that will be registered with the notify dæmon.

### is-initted(--> Bool)

Returns True if the object has been successfully initialized.

### app-name(--> Str)

### app-name(Str $appname)

Queries or sets the app name.

### new-notification(Str $summary!, Str $body!, Str $icon! --> NotifyNotification)

### new-notification(Str :$summary!, Str :$body!, Str :$icon!, Int :$timeout?, Str :$category?, NotifyUrgency :$urgency? --> NotifyNotification)

Creates a new notification. The first form takes three positional arguments: the summary string, the notification string and the icon to display (See the libnotify documentation for the available icons). The second form takes a number of named argument. **summary**, **body**, and **icon** are *mandatory*, the others are optional. If **timeout** (expressed in milliseconds), **category**, and **urgency** are defined, this method will call the corresponding "set" methods documented below.

### show(NotifyNotification $notification!, GError $err? --> Bool)

Shows the notification on screen. It takes one mandatory argument, the NotifyNotification object, and one optional argument, the GError object. (The default Desktop::Notify error handling is not thread safe. See *Threading safety* for more info)

### close(NotifyNotification $notification!, GError $err? --> Bool)

Closes the notification. It takes one mandatory argument, the NotifyNotification object, and one optional argument, the GError object. (The default Desktop::Notify error handling is not thread safe. See *Threading safety* for more info) Note that usually there's no need to explicitly 'close' a notification, since the default is to automatically expire after a while.

### why-closed(NotifyNotification $notification! --> Int)

Returns the the closed reason code for the notification. It takes one argument, the NotifyNotification object. (See the libnotify documentation for the meaning of this code)

### get-type(--> Int)

Returns the notification type.

### update(NotifyNotification $notification!, Str $summary, Str $body, Str $icon --> Bool)

Modifies the messages of a notification which is already on screen.

### set-timeout(NotifyNotification $notification!, Int $timeout!)

Sets the notification timeout. There are two available constants, **NOTIFY\_EXPIRES\_DEFAULT** and **NOTIFY\_EXPIRES\_NEVER**, when explicitly imported with **use Desktop::Notify :constants;**.

### set-category(NotifyNotification $notification, Str $category!)

Sets the notification category (See the libnotify documentation).

### set-urgency(NotifyNotification $notification, NotifyUrgency $urgency!)

Sets the notification urgency. An **enum NotifyUrgency** is available when explicitly imported with **use Desktop::Notify :constants;**.

### server-caps(--> Seq)

Reads server capabilities and returns a sequence.

### server-info(--> Hash)

Reads the server info and returns an hash. The return value of the C function call is returned as the value of the **return** key of the hash.

# Threading safety

Desktop::Notify offers a simple interface which provides an **error** class member, which is automatically used by the functions which need it. Since 'error' is a shared class member, if a program makes use of threading, its value might be written by another thread before it's been read. In this case one can declare their own GError variables:

```
my $err = Desktop::Notify::GError.new;

```

and pass it as an optional argument to the .show() and .close() methods; it will be used instead of the object-wide one.

# Prerequisites

This module requires the libnotify library to be installed. Please follow the instructions below based on your platform:

## Debian and Ubuntu

```
sudo apt install libnotify4

```

# Installation

```
$ zef install Desktop::Notify

```

# Testing

To run the tests:

```
$ prove -e "raku -Ilib"

```

# Note

With version 0.2.0 I modified the **enum NotifyUrgency** to avoid polluting (too much) the namespace. Now instead of e.g. **low**, one has to use **NotifyUrgencyLow**.

# Author

Fernando Santagata

# License

The Artistic License 2.0


## dist_github-Mouq-HTML-Entity.md
# HTML::Entity

Generated from the official list of valid HTML entities and can decode
entity-laden text via `&decode-entities` (or `&decode` if `use … :ALL` is given)

Can also encode basic entities via `&encode-entities`/`&encode`.

## Synopsis

```
use HTML::Entity;

say encode-entities "This <em>needs</em> to be escaped & encoded!";
    # This <em>needs</em> to be escaped & encoded!
say decode-entities "4.99 ≈ 5"; # 4.99 ≈ 5
say HTML::Entity<≂̸>              # ≂̸

use HTML::Entity :ALL;

say decode "fj&aumlril"; # fjäril
say encode "A & B < C";  # A & B < C

```


## dist_zef-lizmat-P5quotemeta.md
[![Actions Status](https://github.com/lizmat/P5quotemeta/workflows/test/badge.svg)](https://github.com/lizmat/P5quotemeta/actions)

# NAME

Raku port of Perl's quotemeta() built-in

# SYNOPSIS

```
use P5quotemeta; # exports quotemeta()

my $a = "abc";
say quotemeta $a;

$_ = "abc";
say quotemeta;

```

# DESCRIPTION

This module tries to mimic the behaviour of Perl's `quotemeta` function in Raku as closely as possible.

# ORIGINAL PERL 5 DOCUMENTATION

```
quotemeta EXPR
quotemeta
        Returns the value of EXPR with all the ASCII non-"word" characters
        backslashed. (That is, all ASCII characters not matching
        "/[A-Za-z_0-9]/" will be preceded by a backslash in the returned
        string, regardless of any locale settings.) This is the internal
        function implementing the "\Q" escape in double-quoted strings.
        (See below for the behavior on non-ASCII code points.)

        If EXPR is omitted, uses $_.

        quotemeta (and "\Q" ... "\E") are useful when interpolating
        strings into regular expressions, because by default an
        interpolated variable will be considered a mini-regular
        expression. For example:

            my $sentence = 'The quick brown fox jumped over the lazy dog';
            my $substring = 'quick.*?fox';
            $sentence =~ s{$substring}{big bad wolf};

        Will cause $sentence to become 'The big bad wolf jumped over...'.

        On the other hand:

            my $sentence = 'The quick brown fox jumped over the lazy dog';
            my $substring = 'quick.*?fox';
            $sentence =~ s{\Q$substring\E}{big bad wolf};

        Or:

            my $sentence = 'The quick brown fox jumped over the lazy dog';
            my $substring = 'quick.*?fox';
            my $quoted_substring = quotemeta($substring);
            $sentence =~ s{$quoted_substring}{big bad wolf};

        Will both leave the sentence as is. Normally, when accepting
        literal string input from the user, quotemeta() or "\Q" must be
        used.

        In Perl v5.14, all non-ASCII characters are quoted in
        non-UTF-8-encoded strings, but not quoted in UTF-8 strings.

        Starting in Perl v5.16, Perl adopted a Unicode-defined strategy
        for quoting non-ASCII characters; the quoting of ASCII characters
        is unchanged.

        Also unchanged is the quoting of non-UTF-8 strings when outside
        the scope of a "use feature 'unicode_strings'", which is to quote
        all characters in the upper Latin1 range. This provides complete
        backwards compatibility for old programs which do not use Unicode.
        (Note that "unicode_strings" is automatically enabled within the
        scope of a "use v5.12" or greater.)

        Within the scope of "use locale", all non-ASCII Latin1 code points
        are quoted whether the string is encoded as UTF-8 or not. As
        mentioned above, locale does not affect the quoting of ASCII-range
        characters. This protects against those locales where characters
        such as "|" are considered to be word characters.

        Otherwise, Perl quotes non-ASCII characters using an adaptation
        from Unicode (see <http://www.unicode.org/reports/tr31/>). The
        only code points that are quoted are those that have any of the
        Unicode properties: Pattern_Syntax, Pattern_White_Space,
        White_Space, Default_Ignorable_Code_Point, or
        General_Category=Control.

        Of these properties, the two important ones are Pattern_Syntax and
        Pattern_White_Space. They have been set up by Unicode for exactly
        this purpose of deciding which characters in a regular expression
        pattern should be quoted. No character that can be in an
        identifier has these properties.

        Perl promises, that if we ever add regular expression pattern
        metacharacters to the dozen already defined ("\ | ( ) [ { ^ $ * +
        ? ."), that we will only use ones that have the Pattern_Syntax
        property. Perl also promises, that if we ever add characters that
        are considered to be white space in regular expressions (currently
        mostly affected by "/x"), they will all have the
        Pattern_White_Space property.

        Unicode promises that the set of code points that have these two
        properties will never change, so something that is not quoted in
        v5.16 will never need to be quoted in any future Perl release.
        (Not all the code points that match Pattern_Syntax have actually
        had characters assigned to them; so there is room to grow, but
        they are quoted whether assigned or not. Perl, of course, would
        never use an unassigned code point as an actual metacharacter.)

        Quoting characters that have the other 3 properties is done to
        enhance the readability of the regular expression and not because
        they actually need to be quoted for regular expression purposes
        (characters with the White_Space property are likely to be
        indistinguishable on the page or screen from those with the
        Pattern_White_Space property; and the other two properties contain
        non-printing characters).

```

# AUTHOR

Elizabeth Mattijsen [liz@raku.rocks](mailto:liz@raku.rocks)

If you like this module, or what I’m doing more generally, committing to a [small sponsorship](https://github.com/sponsors/lizmat/) would mean a great deal to me!

Source can be located at: <https://github.com/lizmat/P5quotemeta> . Comments and Pull Requests are welcome.

# COPYRIGHT AND LICENSE

Copyright 2018, 2019, 2020, 2021, 2023 Elizabeth Mattijsen

Stolen from Zoffix Znet's unpublished String::Quotemeta, as found at:

```
https://github.com/zoffixznet/perl6-String-Quotemeta

```

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.


## dist_zef-lizmat-Rake.md
[![Actions Status](https://github.com/lizmat/Rake/actions/workflows/linux.yml/badge.svg)](https://github.com/lizmat/Rake/actions) [![Actions Status](https://github.com/lizmat/Rake/actions/workflows/macos.yml/badge.svg)](https://github.com/lizmat/Rake/actions) [![Actions Status](https://github.com/lizmat/Rake/actions/workflows/windows.yml/badge.svg)](https://github.com/lizmat/Rake/actions)

# NAME

Rake - raking typed values together in a list

# SYNOPSIS

```
use Rake;

my $foo = Rake[Int,Str,IO].new(42,"bar","filename".IO);
say $foo[0];  # id: 42
say $foo[1];  # name: bar
say $foo[2];  # path: "filename".IO

.say for $foo;  # 42␤bar␤"filename".IO␤

say $foo.^name;  # Rake[Int,Str,IO]

my @bar := Rake[Int,Int].new(42,666);

constant RIS = Rake[Int,Str];        # Rakudo < v2020.06
my @baz is RIS = 42,"foo";

my @baz is Rake[Int,Str] = 42,"foo"; # Rakudo >= v2020.06

class CIS does Rake[Int,Str] { }
my @caz is CIS = 42,"foo";

sub take-rake(Rake[Int,Str] $raked) {
  say "got: $raked";
}

sub answers(*@answers) {
  Rake[Int xx @answers, :value-type].new(@answers)
}
say (answers(42,666), answers(42,666)).Set.elems;  #1

```

# DESCRIPTION

The `Rake` class (actually, a punned role) allows one to create an ad-hoc collection of typed objects without the need to use a hash, list or class. It only accepts values that smartmatch the given types on creation of the collection and provides immutable positional values from the result.

It can be iterated over and be passed around as a single object. It can also be used as a constraint in dispatch.

Optionally, it can force objects of the Rake class to act like value types so they can be used with `Set` semantics: this can be achieved by specifying the `:value-type` named argument with a `True` value.

# WHEN NOT TO USE THIS FUNCTIONALITY

This functionality is really intended for **ad-hoc** data structures, as a way to easily prototype or enforce type-checking on some trial code. For production, it is recommended to change each of the `Rake` cases into an actual class with typed attributes: this will help in performance **and** future maintainability.

Taking from the example code:

```
my $foo = Rake[Int,Str,IO].new(42,"bar","filename".IO);
say $foo[0];  # id: 42
say $foo[1];  # name: bar
say $foo[2];  # path: "filename".IO

```

for production could be written as:

```
class Foo {
  has Int      $.id;
  has Str      $.name;
  has IO::Path $.path;
}

my $foo = Foo.new(:id(42), :name<bar>, :path("filename".IO));
say $foo.id;    # 42
say $foo.name;  # bar
say $foo.path;  # "filename".IO

```

You will thank yourself in the future!

# AUTHOR

Elizabeth Mattijsen [liz@raku.rocks](mailto:liz@raku.rocks)

Source can be located at: <https://github.com/lizmat/Rake> . Comments and Pull Requests are welcome.

If you like this module, or what I'm doing more generally, committing to a [small sponsorship](https://github.com/sponsors/lizmat/) would mean a great deal to me!

# COPYRIGHT AND LICENSE

Copyright 2020, 2021, 2024, 2025 Elizabeth Mattijsen

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.


## dist_zef-raku-community-modules-Test-Mock.md
[![Actions Status](https://github.com/raku-community-modules/Test-Mock/actions/workflows/linux.yml/badge.svg)](https://github.com/raku-community-modules/Test-Mock/actions) [![Actions Status](https://github.com/raku-community-modules/Test-Mock/actions/workflows/macos.yml/badge.svg)](https://github.com/raku-community-modules/Test-Mock/actions) [![Actions Status](https://github.com/raku-community-modules/Test-Mock/actions/workflows/windows.yml/badge.svg)](https://github.com/raku-community-modules/Test-Mock/actions)

# NAME

Test::Mock - Creation of stub objects using the Arrange, Act, Assert pattern

# SYNOPSIS

```
use Test;
use Test::Mock;

plan 2;

class Foo {
    method lol() { 'rofl' }
    method wtf() { 'oh ffs' }
}

my $x = mocked(Foo);

$x.lol();
$x.lol();

check-mock($x,
    *.called('lol', times => 2),
    *.never-called('wtf'),
);

```

# DESCRIPTION

Test::Mock is a module that works alongside the standard Test module to help you write tests when you want to verify what methods are called on an object, while still having calls to undefined methods die.

You get started just as normal with the test file, but also add a use statement for Test::Mock.

```
use Test;
use Test::Mock;

plan 2;

```

Imagine we have some class Foo:

```
class Foo {
    method lol() { 'rofl' }
    method wtf() { 'oh ffs' }
}

```

We then arrange to have a mocked instance of this class. This means that instead of calls to lol and wtf actually resulting in the methods being invoked, it simply logs the invocations.

```
my $x = mocked(Foo);

```

We can then take the actions that should result in some method calls. Here we just make them directly, but you'd probably pass the mock to other bits of code that will make calls on it.

```
$x.lol();
$x.lol();

```

When you're done, you assert that the things you expected to happen actually happened.

```
check-mock($x,
    *.called('lol', times => 2),
    *.never-called('wtf'),
);

```

And it's as easy as that. Of course, you may also be interested to check that the arguments passed to the mocked method were as expected. For our second example, here's a class representing one of my favorite places.

```
class Pub {
    method order_beer($pints) { }
    method throw($what) { }
}

```

We'll also declare a couple of other classes:

```
class Glass { }
class Party { }

```

Our test file would have started with the same boilerplate - use Test and Test::Mock, and set a plan. We then produce a mock instance of Pub:

```
my $p = mocked(Pub);

```

And do our stuff:

```
$p.throw(Party.new);
$p.order_beer(2);
$p.order_beer(1);

```

After our excruciatingly low on beer party, we can now do some checks. Of course, we ordered beer twice, so we can check this as before:

```
check-mock($p,
  *.called('order_beer', times => 2),

```

But what if we wanted to check the arguments passed to the method? In that case, you can simply pass along the parameter "with". We may pass a `Capture` here, which contains the exact arguments we expected to be passed; this will be tested against the actual passed `Capture` for equivalance.

```
  *.called('order_beer', times => 1, with => \(1)),
  *.called('order_beer', times => 1, with => \(2)),
  *.never-called('order_beer', with => \(10)),

```

That's going to cover some cases, but what if we wanted to check if things of the correct type were passed? In that case, write a `Signature` literal, and the args `Capture` will be smart-matched against it, which conveniently happens to check if the `Capture` could have bound to this `Signature`.

```
  *.called('throw', with => :(Party)),
  *.never-called('throw', with => :(Glass)),

```

Of course, now the gloves are off: if you have a `Signature` you can do all kinds of matching, with constraints and sub-signatures. Here's an easy but not so creative example (I need at least 3 pints to be creative...)

```
  *.called('order_beer', times => 2, with => :($ where { $^n < 10 })),
  *.never-called('order_beer', with => :($ where { $^n >= 10 })),

```

And if all that isn't enough, since we just smart-match against anything else you may pass as the with argument, you may also pass a block that takes a `Capture` as a parameter and implement whatever fancier checks you may wish to.

In some cases, just logging method calls on your mock may not be enough; you may wish them to return some fake data from the method call. For example, we may have a yak shaving class that we dependency-inject with a yak provider and a yak shaver.

```
class Yak {
    has $.shaved;
}

class Shaver {
    method shave($yak) {
        ...
    }
}

class YakStore {
    method get-all-yaks() {
        ...
    }
}

class YakShaving {
    has $.yak-store;
    has $.yak-shaver;

    method proccess() {
        for $!yak-store.get-all-yaks() -> $yak {
            unless $yak.shaved {
                $!yak-shaver.shave($yak);
            }
        }
    }
}

```

We want to check that our the shave method from the `Shaver` class is only invoked for yaks that need shaving. We set up our mock of the `Shaver` class just as normal:

```
my $shaver = mocked(Shaver);

```

However, for the `Yak` store we want to provide some fake yaks in various states of shavenness.

```
my $store = mocked(YakStore, returning => {
    get-all-yaks => (Yak.new(:!shaved), Yak.new(:shaved), Yak.new(:!shaved))
});

```

Now we can inject our mocks to the `YakShaving` class and and get it to do its thing.

```
my $yaktivity = YakShaving.new(
  yak-store  => $store,
  yak-shaver => $shaver
);
$yaktivity.proccess();

```

And finally, it's time to write our tests. We expect just one call on the store:

```
check-mock($store,
  *.called('get-all-yaks', times => 1)
);

```

On the shaver, we expect two calls in total to the shave method with yaks that are unshaven, and no calls at all with shaven yaks.

```
check-mock($shaver,
  *.called('shave', times => 2, with => :($ where { !$^y.shaved })),
  *.never-called('shave', with => :($ where { $^y.shaved }))
);

```

This is the first example where we're really made good use of mock testing; if absolutely every object involved in the test is mocked, then you'd not be testing any of the actual real code. Of course, being able to do this easily somewhat depends on good de-coupled code design, where objects are given instances of other objects to work on rather than directly instantiating objects of other classes.

Sometimes, it would be nice to fake an exception or do some other computation rather than return a literal value. For that, use `computing` instead of using `returning`. Our previous example would look like this:

```
my $store = mocked(YakStore, computing => {
  get-all-yaks => { Yak.new(:!shaved), Yak.new(:shaved), Yak.new(:!shaved) }
});

```

However, unlike with `returning`, it's possible to instead do:

```
my $store = mocked(YakStore, computing => {
  get-all-yaks => { die "Could not connect to yak-db" }
});

```

Occasionally, it is also desirable to have access to the arguments passed to method. In this case, use `overriding`:

```
my $shaver = mocked(Shaver, overriding => {
  shave => -> $yak { die 'Already shaven' if $yak.shaved }
});

```

Of course, you can use `returning`, `computing` and `overriding` in a call to `mocked` to get different behaviours for different methods, as long as each method name only occurs once.

Feature requests, bug reports and patches on this module are welcome; use the GitHub issues tracker.

# AUTHOR

Jonathan Worthington

# COPYRIGHT AND LICENSE

Copyright 2010 - 2022 Jonathan Worthington

Copyright 2024, 2025 Raku Community

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.


## dist_zef-jjatria-Pop.md
# NAME

Pop

# SYNOPSIS

```
use Pop;
use Pop::Inputs;
use Pop::Graphics;

# Create your entities, maybe with Pop::Entities

Pop.new: title => 'Revenge of the Avengers';

Pop.update: -> $delta-in-seconds {
    # Run update systems

    # Inputs are automatically read at the beginning
    # of the main loop and exposed through Pop::Inputs
    Pop.stop if Pop::Inputs.keyboard: 'ESCAPE';
}

Pop.render: {
    # Run rendering systems.

    # Screen buffers will be automatically swapped after this block

    given Pop::Graphics {
        .point: ( (^.width).pick, (^.height).pick ), (^256).pick xx 3;
    }
}

# Run the main loop
Pop.run;

```

# DESCRIPTION

Pop is an experimental 2D game development framework for Raku. It has been inspired by frameworks like LÖVE2D and Pico-8, and by others of a similar nature. It runs on SDL2 using custom bindings.

This project is still in its infancy, and the interface might change without warning. Any changes (breaking or otherwise) will still be reported in the change log, so that is the first place to check before updating.

## External Dependencies

Since most of the heavy lifting is done using SDL2, Pop requires some external libraries in order to work. In particular, it requires the following libraries to be available in your system:

* SDL2
* SDL2\_image
* SDL2\_gfx

Please refer to your system's documentation for details on how to obtain these.

# CONCEPTS

## Singletons

Most core classes (including the main Pop game class as well as helpers like Pop::Graphics and Pop::inputs) are implemented as globally available singletons. This means that, unless specific parameters need to be set during initialisation, there is no need to manually construct them and pass references to them, which should help simplify game code.

The caveat to this is that, since they will be constructed automatically if needed, any manual initialisation needs to be done as early as possible.

## Configuration

Most default values used throughout Pop can be specified via the global Pop::Config singleton (see the documentation of that module for more details).

The values in Pop::Config will be read from a file named `config.toml` in the same directory as the mainline entrypoint. To read the global configuration from a different path, pass that path to `Pop::Config.new` as early as possible.

# METHODS

## new

```
method new (|c) returns Pop

```

Initialises a new global game object.

This function will be called automatically when any method is called on `Pop`, so it should be called as early as possible unless the default values are appropriate.

The parameters passed in will be forwarded to the initialisation of the global Pop::Graphics singleton. See that module for more details about acceptable parameters and their meanings.

Default values are those specified by Pop::Config. See that module for more details.

## run

```
method new (
    :$fps = 60,
    :$dt,
) returns Nil

```

Starts the execution a game's main loop. The main loop will continue to execute until `stop` is called, either directly or through `handle-input`.

The default main loop has roughly the following stages:

* `handle-input` is called, to process input events.
* The `update` block is executed as many times as needed.

  If the `$dt` parameter was set, then the block will be called as long as that amount of time has accumulated since the last time it was called. Otherwise, the block will be called once with however much time has elapsed since the last frame.
* The `render` block gets called, as long as the time spent on the frame is not already longer than the time needed to maintain the framerate specified in the `$fps` parameter (which defaults to 60).

  If the `$fps` parameter was explicitly disabled (eg. with `:!fps`) then the `render` block will be called once per frame.

## stop

```
method stop () returns Nil

```

Stop execution of a game, which started the last time `run` was called.

## handle-input

```
method handle-input () returns Nil

```

Process input events and update the state of Pop::Inputs. See the documentation for Pop::Inputs.update for more details.

Calling `handle-input` will automatically call `stop` when a QUIT event is received (ie. when the game window is closed).

## delta

```
method delta () returns Duration

```

Returns a Duration object representing the time elapsed since the last frame started.

## wait

```
method wait (
    Int :$dt,
) returns Nil

```

Stop execution for at least the specified number of seconds.

## destroy

```
method destroy () returns Nil

```

Frees any resources that have been loaded and cached by the game.

# MAIN CALLBACKS

## update

```
method update (
    &update,
) returns Nil

```

Set a code block to be run to update the game state on every game frame. The code will be called with the delta time in seconds as the only parameter.

The `update` block runs before the `render` block (see below), possibly multiple times per frame, depending on the values passed to `run`. See the entry for that method for details on the structure of the default main loop.

## render

```
method render (
    &render,
) returns Nil

```

Set a code block to be run to render the game state. This block will be called up to once per frame, with no arguments.

For details on the aspects of the main loop that control whether the `render` block gets called or not, see the entry for the `run` method above.

# INPUT CALLBACKS

The callbacks listed below are shortcuts for the callbacks of the same name in Pop::Inputs. For more details, see that module's documentation.

## key-pressed

```
method key-pressed ( &cb ) returns Nil

```

## key-released

```
method key-released ( &cb ) returns Nil

```

## mouse-moved

```
method mouse-moved ( &cb ) returns Nil

```

## wheel-moved

```
method wheel-moved ( &cb ) returns Nil

```

## mouse-pressed

```
method mouse-pressed ( &cb ) returns Nil

```

## mouse-released

```
method mouse-released ( &cb ) returns Nil

```

## controller-moved

```
method controller-moved ( &cb ) returns Nil

```

## controller-pressed

```
method controller-pressed ( &cb ) returns Nil

```

## controller-released

```
method controller-released ( &cb ) returns Nil

```

## file-dropped

```
method file-dropped ( &cb ) returns Nil

```

## text-dropped

```
method text-dropped ( &cb ) returns Nil

```

## text-input

```
method text-input ( &cb ) returns Nil

```

## text-edited

```
method text-edited ( &cb ) returns Nil

```

# WINDOW CALLBACKS

The callbacks listed below are shortcuts for the callbacks of the same name in Pop::Inputs. For more details, see that module's documentation.

## focused

```
method focused ( &cb ) returns Nil

```

## mouse-focused

```
method mouse-focused ( &cb ) returns Nil

```

## window-exposed

```
method window-exposed ( &cb ) returns Nil

```

## window-moved

```
method window-moved ( &cb ) returns Nil

```

## window-resized

```
method window-resized ( &cb ) returns Nil

```

## window-visible

```
method window-visible ( &cb ) returns Nil

```

# ACKNOWLEDGEMENTS

The core ECS logic in Pop::Entities has been heavily influenced, both in its interface and its implementation, by [EnTT](https://github.com/skypjack/entt).

Some of the slicing of the singleton classes is based on that seen in popular game development frameworks, but were most directly influenced by [LÖVE2D](https://love2d.org).

The singleton role used in this distribution is also a greatly simplified version of [Staticish](https://github.com/jonathanstowe/Staticish), while the code in Pop::Point derives from a modified version of [Point](https://github.com/0racle/raku-Point).

# COPYRIGHT AND LICENSE

Copyright 2021 José Joaquín Atria

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.


## dist_github-gfldex-Proc-Async-Timeout.md
# Proc::Async::Timeout

Run a command asynchronos with a timeout. When the timeout is hit
`X::Proc::Async::Timeout` is thrown and the command is killed.

[![Build Status](https://travis-ci.org/gfldex/raku-proc-async-timeout.svg?branch=master)](https://travis-ci.org/gfldex/raku-proc-async-timeout)

## SYNOPSIS

```
use v6.c;

use Proc::Async::Timeout;

my $s = Proc::Async::Timeout.new('find', '/home', :enc<latin-1>);

$s.stdout.lines.tap: { .say if .lc.contains(any <gfldex peppmeyer>) }
$s.stderr.tap: { Nil }

await $s.start: timeout => 2;

CATCH {
    when X::Proc::Async::Timeout {
        say "cought: ", .^name;
        say "reporting: ", .Str;
    }
    when X::Promise::Broken ^ X::Proc::Async::Timeout {
        say "something else when wrong";
    }
}

# OUTPUT:
# cought: X::Proc::Async::Timeout+{X::Promise::Broken}
# reporting: ⟨sleep⟩ timed out after 2 seconds.

```

## Methods

Proc::Async::Timeout.start(:$timeout = Inf, |c --> Promise:D)

Executes the stored command and sets a timeout. All additional arguments are
forwarded to `Proc::Async.start`. If the timeout is hit before the command
finished `X::Proc::Async::Timeout` is thrown. Setting `:timeout` to `Inf` will
never throw.

## LICENSE

All files (unless noted otherwise) can be used, modified and redistributed
under the terms of the Artistic License Version 2. Examples (in the
documentation, in tests or distributed as separate files) can be considered
public domain.

ⓒ2017 Wenzel P. P. Peppmeyer


## dist_github-yowcow-Algorithm-BloomFilter.md
[![Build Status](https://travis-ci.org/yowcow/p6-Algorithm-BloomFilter.svg?branch=master)](https://travis-ci.org/yowcow/p6-Algorithm-BloomFilter)

# NAME

Algorithm::BloomFilter - A bloom filter implementation in Perl 6

# SYNOPSIS

```
use Algorithm::BloomFilter;

my $filter = Algorithm::BloomFilter.new(
  capacity   => 100,
  error-rate => 0.01,
);

$filter.add("foo-bar");

$filter.check("foo-bar"); # True

$filter.check("bar-foo"); # False with possible false-positive

```

# DESCRIPTION

Algorithm::BloomFilter is a pure Perl 6 implementation of [Bloom Filter](https://en.wikipedia.org/wiki/Bloom_filter), mostly based on [Bloom::Filter](https://metacpan.org/pod/Bloom::Filter) from Perl 5.

Digest::MurmurHash3 is used for hashing from version 0.1.0.

# METHODS

### new(Rat:D :$error-rate, Int:D :$capacity)

Creates a Bloom::Filter instance.

### add(Cool:D $key)

Adds a given key to filter instance.

### check(Cool:D $key) returns Bool

Checks if a given key is in filter instance.

# INTERNAL METHODS

### calculate-shortest-filter-length(Int:D :$num-keys, Rat:D $error-rate) returns Hash[Int]

Calculates and returns filter's length and a number of hash functions.

### create-salts(Int:D :$count) returns Seq[Int]

Creates and returns `$count` unique and random uint32 salts.

### get-cells(Cool:D $key, Int:D :$filter-length, Int:D :$blankvec, Int:D :@salts) returns List

Calculates and returns positions to check in a bit vector.

# SEE ALSO

[Bloom Filter](https://en.wikipedia.org/wiki/Bloom_filter)

[Bloom::Filter](https://metacpan.org/pod/Bloom::Filter)

# AUTHOR

yowcow [yowcow@cpan.org](mailto:yowcow@cpan.org)

# COPYRIGHT AND LICENSE

Copyright 2016 yowcow

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.


## dist_github-moznion-Router-Boost.md
[![Build Status](https://travis-ci.org/moznion/p6-Router-Boost.svg?branch=master)](https://travis-ci.org/moznion/p6-Router-Boost)

# NAME

Router::Boost - Routing engine for perl6

# SYNOPSIS

```
use Router::Boost;

my $router = Router::Boost.new();
$router.add('/',                             'dispatch_root');
$router.add('/entrylist',                    'dispatch_entrylist');
$router.add('/:user',                        'dispatch_user');
$router.add('/:user/{year}',                 'dispatch_year');
$router.add('/:user/{year}/{month:\d ** 2}', 'dispatch_month');
$router.add('/download/*',                   'dispatch_download');

my $dest = $router.match('/john/2015/10');
# => {:captured(${:month("10"), :user("john"), :year("2015")}), :stuff("dispatch_month")}

my $dest = $router.match('/access/to/not/existed/path');
# => {}

```

# DESCRIPTION

Router::Boost is a routing engine for perl6. This router pre-compiles a regex for each routes thus fast.

This library is a perl6 port of [Router::Boom of perl5](https://metacpan.org/pod/Router::Boom).

# METHODS

## `add(Router::Boost:D: Str $path, Any $stuff)`

Add a new route.

`$path` is the path string.

`$stuff` is the destination path data. Any data is OK.

## `match(Router::Boost:D: Str $path)`

Match the route. If matching is succeeded, this method returns hash like so;

```
{
    stuff    => 'stuff', # matched stuff
    captured => {},      # captured values
}

```

And if matching is failed, this method returns empty hash;

# HOW TO WRITE A ROUTING RULE

## plain string

```
$router.add('/foo', { controller => 'Root', action => 'foo' });
...
$router.match('/foo');
# => {:captured(${}), :stuff(${:action("foo"), :controller("Root")})}

```

## :name notation

```
$router.add('/wiki/:page', { controller => 'WikiPage', action => 'show' });
...
$router.match('/wiki/john');
# => {:captured(${:page("john")}), :stuff(${:action("show"), :controller("WikiPage")})}

```

':name' notation matches `rx{(<-[/]>+)}`. You will get captured arguments by `name` key.

## '\*' notation

```
$router.add('/download/*', { controller => 'Download', action => 'file' });
...
$router.match('/download/path/to/file.xml');
# => {:captured(${"*" => "path/to/file.xml"}), :stuff(${:action("file"), :controller("Download")})}

```

'\*' notation matches `rx{(<-[/]>+)}`. You will get the captured argument as the special key: `*`.

## '{...}' notation

```
$router.add('/blog/{year}', { controller => 'Blog', action => 'yearly' });
...
$router.match('/blog/2010');
# => {:captured(${:year("2010")}), :stuff(${:action("yearly"), :controller("Blog")})}

```

'{...}' notation matches `rx{(<-[/]>+)}`, and it will be captured.

## '{...:<[0..9]>+}' notation

```
$router.add('/blog/{year:<[0..9]>+}/{month:<[0..9]> ** 2}', { controller => 'Blog', action => 'monthly' });
...
$router.match('/blog/2010/04');
# => {:captured(${:month("04"), :year("2010")}), :stuff(${:action("monthly"), :controller("Blog")})}

```

You can specify perl6 regular expressions in named captures.

Note. You can't include normal capture in custom regular expression. i.e. You can't use `{year:(\d+)}` . But you can use `{year:[\d+]}` .

# SEE ALSO

[Router::Boom of perl5](https://metacpan.org/pod/Router::Boom)

# COPYRIGHT AND LICENSE

```
Copyright 2015 moznion <moznion@gmail.com>

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.

```

And original perl5's Router::Boom is

```
Copyright (C) tokuhirom.

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

```

# AUTHOR

moznion [moznion@gmail.com](mailto:moznion@gmail.com)


## dist_github-moznion-Log-Minimal.md
[![Build Status](https://travis-ci.org/moznion/p6-Log-Minimal.svg?branch=master)](https://travis-ci.org/moznion/p6-Log-Minimal)

# NAME

Log::Minimal - Minimal and customizable logger for perl6

# SYNOPSIS

```
use Log::Minimal;
my $log = Log::Minimal.new;

$log.critf('foo'); # 2010-10-20T00:25:17Z [CRITICAL] foo at example.p6 line 12;
$log.warnf("%d %s %s", 1, "foo", $uri);
$log.infof('foo');
$log.debugf("foo"); # print if %*ENV<LM_DEBUG> is true value

# with full stack trace
$log.critff("%s","foo"); # 2010-10-20T00:25:17Z [CRITICAL] foo at lib/Example.pm6 line 10, example.p6 line 12
$log.warnff("%d %s %s", 1, "foo", $uri);
$log.infoff('foo');
$log.debugff("foo"); # print if %*ENV<LM_DEBUG> is true value

# die with formatted message
$log.errorf('foo');
$log.errorff('%s %s', $code, $message);

```

# DESCRIPTION

Log::Minimal is a minimal and customizable logger for perl6. This logger provides logging functions according to logging level with line (or stack) trace.

This package is perl6 port of Log::Minimal of perl5.

# METHODS

## critf(Log::Minimal:D: ($message:Str|$format:Str, \*@list));

```
$log.critf("could't connect to example.com");
$log.critf("Connection timeout timeout:%d, host:%s", 2, "example.com");

```

Display CRITICAL messages. When two or more arguments are passed to the method, the first argument is treated as a format of sprintf.

## warnf(Log::Minimal:D: ($message:Str|$format:Str, \*@list));

Display WARN messages.

## infof(Log::Minimal:D: ($message:Str|$format:Str, \*@list));

Display INFO messages.

## debugf(Log::Minimal:D: ($message:Str|$format:Str, \*@list));

Display DEBUG messages, if %\*ENLM\_DEBUG is true value.

## critff(Log::Minimal:D: ($message:Str|$format:Str, \*@list));

```
$log.critff("could't connect to example.com");
$log.critff("Connection timeout timeout:%d, host:%s", 2, "example.com");

```

Display CRITICAL messages with stack trace.

## warnff(Log::Minimal:D: ($message:Str|$format:Str, \*@list));

Display WARN messages with stack trace.

## infoff(Log::Minimal:D: ($message:Str|$format:Str, \*@list));

Display INFO messages with stack trace.

## debugff(Log::Minimal:D: ($message:Str|$format:Str, \*@list));

Display DEBUG messages with stack trace, if %\*ENLM\_DEBUG is true value.

## errorf(Log::Minimal:D: ($message:Str|$format:Str, \*@list));

die with formatted $message

```
$log.errorf("critical error");

```

## errorff(Log::Minimal:D: ($message:Str|$format:Str, \*@list));

die with formatted $message with stack trace

# CUSTOMIZATION

## `%*ENV<LM_DEBUG>` and `$.env-debug`

%\*ENLM\_DEBUG must be true if you want to print debugf and debugff messages.

You can change variable name from LM\_DEBUG to arbitrary string which is specified by `$.env-debug` in use instance.

```
use Log::Minimal;

my $log = Log::Minimal.new(:env-debug('FOO_DEBUG'));

%*ENV<LM_DEBUG>  = True;
%*ENV<FOO_DEBUG> = False;
$log.debugf("hello"); # no output

%*ENV<FOO_DEBUG> = True;
$log.debugf("world"); # print message

```

## `%*ENV<LM_COLOR>` and `$.color`

`%*ENV<LM_COLOR>` is used as default value of `$.color`. If you want to colorize logging message, you specify true value into `%*ENV<LM_COLOR>` or `$.color` of instance.

```
use Log::Minimal;

my $log = Log::Minimal.new;
%*ENV<LM_COLOR>  = True;
$log.infof("hello"); # output colorized message

```

or

```
use Log::Minimal;

my $log = Log::Minimal.new;
$log.color = True;
$log.infof("hello"); # output colorized message

```

## `$.print`

To change the method of outputting the log, set `$.print` of instance.

```
my $log = Log::Minimal.new;
$log.print = sub (:$time, :$log-level, :$messages, :$trace) {
    note "[$log-level] $messages $trace"; # without time stamp
}
$log.critf('foo'); # [CRITICAL] foo at example.p6 line 12;

```

default is

```
sub (:$time, :$log-level, :$messages, :$trace) {
    note "$time [$log-level] $messages $trace";
}

```

## `$.die`

To change the format of die message, set `$.die` of instance.

```
my $log = Log::Minimal.new;
$log.print = sub (:$time, :$log-level, :$messages, :$trace) {
    die "[$log-level] $messages"; # without time stamp and trace
}
$log.errorf('foo');

```

default is

```
sub (:$time, :$log-level, :$messages, :$trace) {
    Log::Minimal::Error.new(message => "$time [$log-level] $messages $trace").die;
}

```

## `$.default-log-level`

Level for output log.

```
my $log = Log::Minimal.new;
$log.default-log-level = Log::Minimal::WARN;
$log.infof("foo"); # print nothing
$log.warnf("foo"); # print

```

Support levels are DEBUG, INFO, WARN, CRITICAL, Error and MUTE. These levels are exposed by enum (e.g. Log::Minimal::DEBUG). If MUTE is set, no output except `errorf` and `errorff`. Default log level is DEBUG.

## `$.autodump`

Serialize message with `.perl`.

```
my $log = Log::Minimal.new;
$log.warnf("%s", {foo => 'bar'}); # foo\tbar

temp $log.autodump = True;
warnf("dump is %s", {foo=>'bar'}); # :foo("bar")

```

## `$.default-trace-level`

This variable determines how many additional call frames are to be skipped. Defaults to 0.

## `$.escape-whitespace`

If this value is true, whitespace other than space will be represented as [\n\t\r]. Defaults to True.

## `$.timezone`

Default, this value is Nil means Log::Minimal determines timezone automatically from your environment.

If you specify this value, Log::Minimal uses that timezone.

```
my $timezone = DateTime.new('2015-12-24T12:23:00+0900').timezone; # <= 32400
my $log = Log::Minimal.new(:$timezone);
$log.critff("%s","foo"); # 2010-10-20T00:25:17+09:00 [CRITICAL] foo at lib/Example.pm6 line 10, example.p6 line 12

```

# SEE ALSO

[Log::Minimal of perl5](https://metacpan.org/pod/Log::Minimal)

# COPYRIGHT AND LICENSE

```
Copyright 2015 moznion <moznion@gmail.com>

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.

```

And original perl5's Log::Minimal is

```
This software is copyright (c) 2013 by Masahiro Nagano <kazeburo@gmail.com>.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

```