| 1 | package Dist::Zilla::Types 6.040; | ||||||||||
| 2 | # ABSTRACT: dzil-specific type library | ||||||||||
| 3 | |||||||||||
| 4 | 54 | ▶ | use Dist::Zilla::Pragmas; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 54 | ▶ | use namespace::autoclean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | #pod =head1 OVERVIEW | ||||||||||
| 9 | #pod | ||||||||||
| 10 | #pod This library provides L<MooseX::Types> types for use by Dist::Zilla. These | ||||||||||
| 11 | #pod types are not (yet?) for public consumption, and you should not rely on them. | ||||||||||
| 12 | #pod | ||||||||||
| 13 | #pod Dist::Zilla uses a number of types found in L<MooseX::Types::Perl>. Maybe | ||||||||||
| 14 | #pod that's what you want. | ||||||||||
| 15 | #pod | ||||||||||
| 16 | #pod =cut | ||||||||||
| 17 | |||||||||||
| 18 | 54 | ▶ | use MooseX::Types -declare => [qw( | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 19 | License OneZero YesNoStr ReleaseStatus | ||||||||||
| 20 | Path ArrayRefOfPaths | ||||||||||
| 21 | _Filename | ||||||||||
| 22 | 54 | )]; | |||||||||
| 23 | 54 | ▶ | use MooseX::Types::Moose qw(Str Int Defined ArrayRef); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 24 | 54 | ▶ | use Path::Tiny; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 25 | |||||||||||
| 26 | 54 | subtype License, as class_type('Software::License'); | |||||||||
| 27 | |||||||||||
| 28 | 54 | subtype Path, as class_type('Path::Tiny'); | |||||||||
| 29 | 17 | ▶ | coerce Path, from Defined, via { | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 30 | 17 | require Dist::Zilla::Path; | |||||||||
| 31 | 17 | Dist::Zilla::Path::path($_); | |||||||||
| 32 | 54 | }; | |||||||||
| 33 | |||||||||||
| 34 | 54 | subtype ArrayRefOfPaths, as ArrayRef[Path]; | |||||||||
| 35 | 4 | ▶ | coerce ArrayRefOfPaths, from ArrayRef[Defined], via { | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 36 | 4 | require Dist::Zilla::Path; | |||||||||
| 37 | 4 | [ map { Dist::Zilla::Path::path($_) } @$_ ]; | |||||||||
| 38 | 54 | }; | |||||||||
| 39 | |||||||||||
| 40 | 9 | ▶ | subtype OneZero, as Str, where { $_ eq '0' or $_ eq '1' }; | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
Branch: 1 branch
| |||||||||||
| 41 | |||||||||||
| 42 | 8 | ▶ | subtype YesNoStr, as Str, where { /\A(?:y|ye|yes)\Z/i or /\A(?:n|no)\Z/i }; | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
Branch: 1 branch
| |||||||||||
| 43 | |||||||||||
| 44 | 153 | ▶ | subtype ReleaseStatus, as Str, where { /\A(?:stable|testing|unstable)\z/ }; | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 45 | |||||||||||
| 46 | 8 | ▶ | coerce OneZero, from YesNoStr, via { /\Ay/i ? 1 : 0 }; | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
Branch: 1 branch
| |||||||||||
| 47 | |||||||||||
| 48 | subtype _Filename, as Str, | ||||||||||
| 49 | 1531 | ▶ | where { $_ !~ qr/(?:\x{0a}|\x{0b}|\x{0c}|\x{0d}|\x{85}|\x{2028}|\x{2029})/ }, | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 50 | 0 | ▶ | message { "Filename not a Str, or contains a newline or other vertical whitespace" }; | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||
| 51 | |||||||||||
| 52 | 54 | 1; | |||||||||
| 53 | |||||||||||
| 54 | __END__ | ||||||||||