| 1 | 8 | ▶ | use 5.006; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 2 | 8 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 3 | 8 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||
| 5 | package Gentoo::Overlay::Types; | ||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||
| 7 | 8 | our $VERSION = '2.001001'; | |||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||
| 9 | # ABSTRACT: Gentoo Overlay types. | ||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||
| 11 | 8 | our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY | |||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||
| 13 | 8 | use Type::Library 0.008 '-base', -declare => qw( | |||||||||||||||||||||||||||||||||||||||||
| 14 | Gentoo__Overlay_Overlay | ||||||||||||||||||||||||||||||||||||||||||
| 15 | Gentoo__Overlay_Category | ||||||||||||||||||||||||||||||||||||||||||
| 16 | Gentoo__Overlay_Ebuild | ||||||||||||||||||||||||||||||||||||||||||
| 17 | Gentoo__Overlay_Package | ||||||||||||||||||||||||||||||||||||||||||
| 18 | Gentoo__Overlay_CategoryName | ||||||||||||||||||||||||||||||||||||||||||
| 19 | Gentoo__Overlay_EbuildName | ||||||||||||||||||||||||||||||||||||||||||
| 20 | Gentoo__Overlay_PackageName | ||||||||||||||||||||||||||||||||||||||||||
| 21 | Gentoo__Overlay_RepositoryName | ||||||||||||||||||||||||||||||||||||||||||
| 22 | 8 | ▶ | ); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 23 | 8 | ▶ | use Type::Utils; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 24 | 8 | ▶ | use Types::Standard qw( Str ); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||
| 34 | 8 | class_type Gentoo__Overlay_Overlay, { class => 'Gentoo::Overlay' }; | |||||||||||||||||||||||||||||||||||||||||
| 35 | coerce Gentoo__Overlay_Overlay, from Str, via { | ||||||||||||||||||||||||||||||||||||||||||
| 36 | 0 | ▶ | require Gentoo::Overlay; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||
| 37 | 0 | return Gentoo::Overlay->new( path => $_ ); | |||||||||||||||||||||||||||||||||||||||||
| 38 | 8 | }; | |||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||
| 46 | 8 | class_type Gentoo__Overlay_Category, { class => 'Gentoo::Overlay::Category' }; | |||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||
| 54 | 8 | class_type Gentoo__Overlay_Ebuild, { class => 'Gentoo::Overlay::Ebuild' }; | |||||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||||||||||
| 62 | 8 | class_type Gentoo__Overlay_Package, { class => 'Gentoo::Overlay::Package' }; | |||||||||||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||||||||||||||
| 73 | declare Gentoo__Overlay_CategoryName, as Str, where { | ||||||||||||||||||||||||||||||||||||||||||
| 74 | ## no critic ( RegularExpressions ) | ||||||||||||||||||||||||||||||||||||||||||
| 75 | 12 | ▶ | $_ =~ qr/^[a-zA-Z0-9+_.-]+$/ | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.6
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 76 | && $_ !~ qr/^[-.]/; | ||||||||||||||||||||||||||||||||||||||||||
| 77 | 8 | }; | |||||||||||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||||||||||||||
| 90 | declare Gentoo__Overlay_EbuildName, as Str, where { | ||||||||||||||||||||||||||||||||||||||||||
| 91 | ## no critic ( RegularExpressions ) | ||||||||||||||||||||||||||||||||||||||||||
| 92 | 1 | ▶ | $_ =~ qr/^[A-Za-z0-9+_.-]+$/ | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=4 SCAR=19.1
Branch: 1 branch
Condition33%2/6
$_ =~ qr/^[A-Za-z0-9+_.-]+$/ and not $_ =~ qr/^-/ and not $_ =~ qr/-$/
$_ =~ qr/^[A-Za-z0-9+_.-]+$/ and not $_ =~ qr/^-/
MC/DC0%0/3
$_ =~ qr/^[A-Za-z0-9+_.-]+$/ and not $_ =~ qr/^-/ and not $_ =~ qr/-$/
$_ =~ qr/^[A-Za-z0-9+_.-]+$/
not $_ =~ qr/^-/
not $_ =~ qr/-$/
Truth table25%1/4
A and not(B) and not(C)
A= $_ =~ qr/^[A-Za-z0-9+_.-]+$/B= not $_ =~ qr/^-/C= not $_ =~ qr/-$/
| |||||||||||||||||||||||||||||||||||||||||||
| 93 | && $_ !~ qr/^-/ | ||||||||||||||||||||||||||||||||||||||||||
| 94 | && $_ !~ qr/-$/ | ||||||||||||||||||||||||||||||||||||||||||
| 95 | && $_ =~ qr/\.ebuild$/; | ||||||||||||||||||||||||||||||||||||||||||
| 96 | 8 | }; | |||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||||||||||||||||
| 109 | declare Gentoo__Overlay_PackageName, as Str, where { | ||||||||||||||||||||||||||||||||||||||||||
| 110 | ## no critic ( RegularExpressions ) | ||||||||||||||||||||||||||||||||||||||||||
| 111 | 5 | ▶ | $_ =~ qr/^[A-Za-z0-9+_-]+$/ | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=4 SCAR=19.1
Branch: 1 branch
Condition33%2/6
$_ =~ qr/^[A-Za-z0-9+_-]+$/ and not $_ =~ qr/^-/ and not $_ =~ qr/-$/
$_ =~ qr/^[A-Za-z0-9+_-]+$/ and not $_ =~ qr/^-/
MC/DC0%0/3
$_ =~ qr/^[A-Za-z0-9+_-]+$/ and not $_ =~ qr/^-/ and not $_ =~ qr/-$/
$_ =~ qr/^[A-Za-z0-9+_-]+$/
not $_ =~ qr/^-/
not $_ =~ qr/-$/
Truth table25%1/4
A and not(B) and not(C)
A= $_ =~ qr/^[A-Za-z0-9+_-]+$/B= not $_ =~ qr/^-/C= not $_ =~ qr/-$/
| |||||||||||||||||||||||||||||||||||||||||||
| 112 | && $_ !~ qr/^-/ | ||||||||||||||||||||||||||||||||||||||||||
| 113 | && $_ !~ qr/-$/ | ||||||||||||||||||||||||||||||||||||||||||
| 114 | && $_ !~ qr/-\d+$/; | ||||||||||||||||||||||||||||||||||||||||||
| 115 | 8 | }; | |||||||||||||||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||||||||||||||||
| 121 | |||||||||||||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||||||||||||
| 126 | declare Gentoo__Overlay_RepositoryName, as Str, where { | ||||||||||||||||||||||||||||||||||||||||||
| 127 | ## no critic ( RegularExpressions ) | ||||||||||||||||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||||||||||||||||
| 129 | 5 | ▶ | $_ =~ qr/^[A-Za-z0-9_-]+$/ | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.6
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 130 | && $_ !~ qr/^-/; | ||||||||||||||||||||||||||||||||||||||||||
| 131 | 8 | }; | |||||||||||||||||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||||||||||||||||||
| 133 | 8 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||||||||||||||||
| 135 | __END__ | ||||||||||||||||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||||||||||||||||
| 137 | =pod | ||||||||||||||||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||||||||||||||||
| 139 | =encoding UTF-8 | ||||||||||||||||||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||||||||||||||||
| 141 | =head1 NAME | ||||||||||||||||||||||||||||||||||||||||||
| 142 | |||||||||||||||||||||||||||||||||||||||||||
| 143 | Gentoo::Overlay::Types - Gentoo Overlay types. | ||||||||||||||||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||||||||||||||||
| 145 | =head1 VERSION | ||||||||||||||||||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||||||||||||||||
| 147 | version 2.001001 | ||||||||||||||||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||||||||||||||||
| 149 | =head1 TYPES | ||||||||||||||||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||||||||||||||||
| 151 | =head2 Gentoo__Overlay_Overlay | ||||||||||||||||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||||||||||||||||
| 153 | class_type Gentoo::Overlay | ||||||||||||||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||||||||||||||
| 155 | coerces from Str | ||||||||||||||||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||||||||||||||||
| 157 | =head2 Gentoo__Overlay_Category | ||||||||||||||||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||||||||||||||||
| 159 | class_type Gentoo::Overlay::Category | ||||||||||||||||||||||||||||||||||||||||||
| 160 | |||||||||||||||||||||||||||||||||||||||||||
| 161 | =head2 Gentoo__Overlay_Ebuild | ||||||||||||||||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||||||||||||||||
| 163 | class_type Gentoo::Overlay::Ebuild | ||||||||||||||||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||||||||||||||||
| 165 | =head2 Gentoo__Overlay_Package | ||||||||||||||||||||||||||||||||||||||||||
| 166 | |||||||||||||||||||||||||||||||||||||||||||
| 167 | class_type Gentoo::Overlay::Package | ||||||||||||||||||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||||||||||||||||
| 169 | =head2 Gentoo__Overlay_CategoryName | ||||||||||||||||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||||||||||||||||
| 171 | Str matching ^[A-Za-z0-9+_.-]+$ | ||||||||||||||||||||||||||||||||||||||||||
| 172 | and not matching ^[-.] | ||||||||||||||||||||||||||||||||||||||||||
| 173 | |||||||||||||||||||||||||||||||||||||||||||
| 174 | I<A category name may contain any of the characters [A-Za-z0-9+_.-]. It must not begin with a hyphen or a dot.> | ||||||||||||||||||||||||||||||||||||||||||
| 175 | |||||||||||||||||||||||||||||||||||||||||||
| 176 | =head2 Gentoo__Overlay_EbuildName | ||||||||||||||||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||||||||||||||||
| 178 | Str matching ^[A-Za-z0-9+_.-]+$ | ||||||||||||||||||||||||||||||||||||||||||
| 179 | and not matching ^- | ||||||||||||||||||||||||||||||||||||||||||
| 180 | and not matching -$ | ||||||||||||||||||||||||||||||||||||||||||
| 181 | and matching \.ebuild$ | ||||||||||||||||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||||||||||||||||
| 183 | I<An ebuild name may contain any of the characters [A-Za-z0-9+_.-]. It must not begin with a hyphen, and must not end in a hyphen.> | ||||||||||||||||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||||||||||||||||
| 185 | =head2 Gentoo__Overlay_PackageName | ||||||||||||||||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||||||||||||||||
| 187 | Str matching ^[A-Za-z0-9+_-]+$ | ||||||||||||||||||||||||||||||||||||||||||
| 188 | and not matching ^- | ||||||||||||||||||||||||||||||||||||||||||
| 189 | and not matching -$ | ||||||||||||||||||||||||||||||||||||||||||
| 190 | and not matching -\d+$ | ||||||||||||||||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||||||||||||||||
| 192 | I<A package name may contain any of the characters [A-Za-z0-9+_-]. It must not begin with a hyphen, and must not end in a hyphen followed by one or more digits.> | ||||||||||||||||||||||||||||||||||||||||||
| 193 | |||||||||||||||||||||||||||||||||||||||||||
| 194 | =head2 Gentoo__Overlay_RepositoryName | ||||||||||||||||||||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||||||||||||||||||
| 196 | Str matching ^[A-Za-z0-9_-]+$ | ||||||||||||||||||||||||||||||||||||||||||
| 197 | and not matching ^- | ||||||||||||||||||||||||||||||||||||||||||
| 198 | |||||||||||||||||||||||||||||||||||||||||||
| 199 | I<A repository name may contain any of the characters [A-Za-z0-9_-]. It must not begin with a hyphen.> | ||||||||||||||||||||||||||||||||||||||||||
| 200 | |||||||||||||||||||||||||||||||||||||||||||
| 201 | =head1 AUTHOR | ||||||||||||||||||||||||||||||||||||||||||
| 202 | |||||||||||||||||||||||||||||||||||||||||||
| 203 | Kent Fredric <kentnl@cpan.org> | ||||||||||||||||||||||||||||||||||||||||||
| 204 | |||||||||||||||||||||||||||||||||||||||||||
| 205 | =head1 COPYRIGHT AND LICENSE | ||||||||||||||||||||||||||||||||||||||||||
| 206 | |||||||||||||||||||||||||||||||||||||||||||
| 207 | This software is copyright (c) 2014 by Kent Fredric <kentnl@cpan.org>. | ||||||||||||||||||||||||||||||||||||||||||
| 208 | |||||||||||||||||||||||||||||||||||||||||||
| 209 | This is free software; you can redistribute it and/or modify it under | ||||||||||||||||||||||||||||||||||||||||||
| 210 | the same terms as the Perl 5 programming language system itself. | ||||||||||||||||||||||||||||||||||||||||||
| 211 | |||||||||||||||||||||||||||||||||||||||||||
| 212 | =cut | ||||||||||||||||||||||||||||||||||||||||||