-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Pod to all Local::Rx modules in xt/lib
- Loading branch information
Showing
7 changed files
with
499 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,69 @@ | ||
=head1 NAME | ||
Local::Rx - a convenient way to load Data::Rx with all the local types | ||
=head1 SYNOPSIS | ||
This is a user-defined type for L<Data::Rx>: | ||
use FindBin qw($RealBin); | ||
use lib "$RealBin/lib"; | ||
my $rx = Local::Rx->new; | ||
... use $rx as you would in Data::Rx ... | ||
=head1 DESCRIPTION | ||
This loads all the local types so you don't have to. These modules | ||
are all in F<xt/lib> so far. | ||
=head2 Types | ||
=over 4 | ||
=item * Local::Rx::Type::CommitID | ||
=item * Local::Rx::Type::CVE | ||
=item * Local::Rx::Type::GHSA | ||
=item * Local::Rx::Type::URL | ||
=item * Local::Rx::Type::VCS_URL | ||
=item * Local::Rx::Type::YYYYMMDD | ||
=back | ||
=head1 SEE ALSO | ||
=over 4 | ||
=item * L<Data::Rx> | ||
=cut | ||
|
||
=head1 SOURCE AVAILABILITY | ||
Although this module may come with your L<CPANSA::DB> distribution, | ||
it is not indexed by PAUSE. | ||
This module is on Github: | ||
https://github.com/briandfoy/cpan-security-advisories | ||
=head1 AUTHOR | ||
brian d foy, C<< <[email protected]> >> | ||
=head1 COPYRIGHT AND LICENSE | ||
Copyright © 2024, brian d foy C<< <[email protected]> >>. All rights reserved. | ||
This software is available under the Artistic License 2.0. | ||
=cut | ||
|
||
package # hide from PAUSE | ||
Local::Rx; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,77 @@ | ||
=head1 NAME | ||
Local::Rx::Type::CVE - a value looks like a CVE report number | ||
=head1 SYNOPSIS | ||
This is a user-defined type for L<Data::Rx>: | ||
use Data::Rx; | ||
use Local::Rx::Type::CVE; | ||
Data::Rx->new({ | ||
type_plugins => [qw( | ||
Local::Rx::Type::CVE | ||
)], | ||
}); | ||
This is automatically loaded in C<Local::Rx>: | ||
use FindBin qw($RealBin); | ||
use lib "$RealBin/lib"; | ||
my $rx = Local::Rx->new; | ||
In your Rx specification, use the tag C<tag:example.com,EXAMPLE:rx/cve>: | ||
my $rx = { | ||
type => '//rec', | ||
required => { | ||
cve => { type => 'tag:example.com,EXAMPLE:rx/cve', }, | ||
}, | ||
... | ||
}; | ||
=head1 DESCRIPTION | ||
This is a user-defined type for L<Data::Rx> that checks that a value | ||
looks like a Common Vulnerabilities and Exposures (CVE) report number. | ||
That's typically the year followed by a dash then a decimal number. | ||
=head1 SEE ALSO | ||
=over 4 | ||
=item * L<Data::Rx::CommonType::EasyNew> | ||
=item * L<Data::Rx> | ||
=item * L<https://rx.codesimply.com/> | ||
=item * L<https://www.cve.org> | ||
=cut | ||
|
||
=head1 SOURCE AVAILABILITY | ||
Although this module may come with your L<CPANSA::DB> distribution, | ||
it is not indexed by PAUSE. | ||
This module is on Github: | ||
https://github.com/briandfoy/cpan-security-advisories | ||
=head1 AUTHOR | ||
brian d foy, C<< <[email protected]> >> | ||
=head1 COPYRIGHT AND LICENSE | ||
Copyright © 2024, brian d foy C<< <[email protected]> >>. All rights reserved. | ||
This software is available under the Artistic License 2.0. | ||
=cut | ||
|
||
package # hide from PAUSE | ||
Local::Rx::Type::CVE; | ||
use parent 'Data::Rx::CommonType::EasyNew'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,74 @@ | ||
=head1 NAME | ||
Local::Rx::Type::CommitID - a value looks like a git commit ID | ||
=head1 SYNOPSIS | ||
This is a user-defined type for L<Data::Rx>: | ||
use Data::Rx; | ||
use Local::Rx::Type::CommitID; | ||
Data::Rx->new({ | ||
type_plugins => [qw( | ||
Local::Rx::Type::CommitID | ||
)], | ||
}); | ||
This is automatically loaded in C<Local::Rx>: | ||
use FindBin qw($RealBin); | ||
use lib "$RealBin/lib"; | ||
my $rx = Local::Rx->new; | ||
In your Rx specification, use the tag C<tag:example.com,EXAMPLE:rx/commit-id>: | ||
my $rx = { | ||
type => '//rec', | ||
required => { | ||
commit => { type => 'tag:example.com,EXAMPLE:rx/commit-id', }, | ||
}, | ||
... | ||
}; | ||
=head1 DESCRIPTION | ||
This is a user-defined type for L<Data::Rx> that checks that a value | ||
looks like a git commit ID. So far, that's just 40 case-insensitive hex digits. | ||
=head1 SEE ALSO | ||
=over 4 | ||
=item * L<Data::Rx::CommonType::EasyNew> | ||
=item * L<Data::Rx> | ||
=item * L<https://rx.codesimply.com/> | ||
=cut | ||
|
||
=head1 SOURCE AVAILABILITY | ||
Although this module may come with your L<CPANSA::DB> distribution, | ||
it is not indexed by PAUSE. | ||
This module is on Github: | ||
https://github.com/briandfoy/cpan-security-advisories | ||
=head1 AUTHOR | ||
brian d foy, C<< <[email protected]> >> | ||
=head1 COPYRIGHT AND LICENSE | ||
Copyright © 2024, brian d foy C<< <[email protected]> >>. All rights reserved. | ||
This software is available under the Artistic License 2.0. | ||
=cut | ||
|
||
package # hide from PAUSE | ||
Local::Rx::Type::CommitID; | ||
use parent 'Data::Rx::CommonType::EasyNew'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,76 @@ | ||
=head1 NAME | ||
Local::Rx::Type::GHSA - a value looks like a GitHub Advisory Database ID | ||
=head1 SYNOPSIS | ||
This is a user-defined type for L<Data::Rx>: | ||
use Data::Rx; | ||
use Local::Rx::Type::GHSA; | ||
Data::Rx->new({ | ||
type_plugins => [qw( | ||
Local::Rx::Type::GHSA | ||
)], | ||
}); | ||
This is automatically loaded in C<Local::Rx>: | ||
use FindBin qw($RealBin); | ||
use lib "$RealBin/lib"; | ||
my $rx = Local::Rx->new; | ||
In your Rx specification, use the tag C<tag:example.com,EXAMPLE:rx/ghsa>: | ||
my $rx = { | ||
type => '//rec', | ||
required => { | ||
commit => { type => 'tag:example.com,EXAMPLE:rx/ghsa', }, | ||
}, | ||
... | ||
}; | ||
=head1 DESCRIPTION | ||
This is a user-defined type for L<Data::Rx> that checks that a value | ||
looks like a GitHub Advisory Database ID, such as C<GHSA-hm5v-6984-hfqp>. | ||
=head1 SEE ALSO | ||
=over 4 | ||
=item * L<Data::Rx::CommonType::EasyNew> | ||
=item * L<Data::Rx> | ||
=item * L<https://rx.codesimply.com/> | ||
=item * L<https://github.com/advisories> | ||
=cut | ||
|
||
=head1 SOURCE AVAILABILITY | ||
Although this module may come with your L<CPANSA::DB> distribution, | ||
it is not indexed by PAUSE. | ||
This module is on Github: | ||
https://github.com/briandfoy/cpan-security-advisories | ||
=head1 AUTHOR | ||
brian d foy, C<< <[email protected]> >> | ||
=head1 COPYRIGHT AND LICENSE | ||
Copyright © 2024, brian d foy C<< <[email protected]> >>. All rights reserved. | ||
This software is available under the Artistic License 2.0. | ||
=cut | ||
|
||
package # hide from PAUSE | ||
Local::Rx::Type::GHSA; | ||
use parent 'Data::Rx::CommonType::EasyNew'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,75 @@ | ||
=head1 NAME | ||
Local::Rx::Type::URL - a value looks like a URL | ||
=head1 SYNOPSIS | ||
This is a user-defined type for L<Data::Rx>: | ||
use Data::Rx; | ||
use Local::Rx::Type::URL; | ||
Data::Rx->new({ | ||
type_plugins => [qw( | ||
Local::Rx::Type::URL | ||
)], | ||
}); | ||
This is automatically loaded in C<Local::Rx>: | ||
use FindBin qw($RealBin); | ||
use lib "$RealBin/lib"; | ||
my $rx = Local::Rx->new; | ||
In your Rx specification, use the tag C<tag:example.com,EXAMPLE:rx/url>: | ||
my $rx = { | ||
type => '//rec', | ||
required => { | ||
commit => { type => 'tag:example.com,EXAMPLE:rx/url', }, | ||
}, | ||
... | ||
}; | ||
=head1 DESCRIPTION | ||
This is a user-defined type for L<Data::Rx> that checks that a value | ||
looks like a URL. So far, this is not that sophisticated: it checks | ||
that it starts with a http, https, or ftp scheme. | ||
=head1 SEE ALSO | ||
=over 4 | ||
=item * L<Data::Rx::CommonType::EasyNew> | ||
=item * L<Data::Rx> | ||
=item * L<https://rx.codesimply.com/> | ||
=cut | ||
|
||
=head1 SOURCE AVAILABILITY | ||
Although this module may come with your L<CPANSA::DB> distribution, | ||
it is not indexed by PAUSE. | ||
This module is on Github: | ||
https://github.com/briandfoy/cpan-security-advisories | ||
=head1 AUTHOR | ||
brian d foy, C<< <[email protected]> >> | ||
=head1 COPYRIGHT AND LICENSE | ||
Copyright © 2024, brian d foy C<< <[email protected]> >>. All rights reserved. | ||
This software is available under the Artistic License 2.0. | ||
=cut | ||
|
||
package # hide from PAUSE | ||
Local::Rx::Type::URL; | ||
use parent 'Data::Rx::CommonType::EasyNew'; | ||
|
Oops, something went wrong.