| 1 | package FCGI::Engine::Types; | ||||||||||||||||||||||||||||
| 2 | 10 | ▶ | use Moose::Util::TypeConstraints; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||
| 4 | 10 | ▶ | use Declare::Constraints::Simple '-All'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 10 | ▶ | use MooseX::Getopt::OptionTypeMap; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 10 | ▶ | use MooseX::Types::Path::Class; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 10 | our $VERSION = '0.22'; | |||||||||||||||||||||||||||
| 9 | 10 | our $AUTHORITY = 'cpan:STEVAN'; | |||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | ## FCGI::Engine | ||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | subtype 'FCGI::Engine::ListenerPort' | ||||||||||||||||||||||||||||
| 14 | => as 'Str' | ||||||||||||||||||||||||||||
| 15 | 6 | ▶ | => where { /\:(\d+)/ && $1 >= 1 && $1 <= 65535 }; | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=13.1
Branch: 1 branch
Condition33%1/3
/\:(\d+)/ and $1 >= 1
MC/DC0%0/2
/\:(\d+)/ and $1 >= 1
/\:(\d+)/
$1 >= 1
Truth table33%1/3
A and B
A= /\:(\d+)/B= $1 >= 1
| |||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 10 | subtype 'FCGI::Engine::Listener' | |||||||||||||||||||||||||||
| 18 | => as 'FCGI::Engine::ListenerPort | Path::Class::File'; | ||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 10 | MooseX::Getopt::OptionTypeMap->add_option_type_to_map( | |||||||||||||||||||||||||||
| 21 | 'FCGI::Engine::Listener' => '=s', | ||||||||||||||||||||||||||||
| 22 | ); | ||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | ## FCGI::Engine::Manager | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | # FIXME: | ||||||||||||||||||||||||||||
| 27 | # this is ugly I know, but it is better | ||||||||||||||||||||||||||||
| 28 | # then adding a backward incompatible | ||||||||||||||||||||||||||||
| 29 | # change and forcing others to update | ||||||||||||||||||||||||||||
| 30 | # their versions of Moose for this. | ||||||||||||||||||||||||||||
| 31 | # - SL | ||||||||||||||||||||||||||||
| 32 | 10 | ▶ | if ($Moose::VERSION < 0.72) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 33 | 0 | subtype 'FCGI::Engine::Manager::Server::Config' | |||||||||||||||||||||||||||
| 34 | => as 'HashRef' | ||||||||||||||||||||||||||||
| 35 | => And( | ||||||||||||||||||||||||||||
| 36 | IsHashRef, | ||||||||||||||||||||||||||||
| 37 | HasAllKeys(qw[scriptname pidfile socket]), | ||||||||||||||||||||||||||||
| 38 | OnHashKeys( | ||||||||||||||||||||||||||||
| 39 | additional_args => IsArrayRef | ||||||||||||||||||||||||||||
| 40 | ) | ||||||||||||||||||||||||||||
| 41 | ); | ||||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||
| 43 | else { | ||||||||||||||||||||||||||||
| 44 | 10 | subtype('FCGI::Engine::Manager::Server::Config', | |||||||||||||||||||||||||||
| 45 | { | ||||||||||||||||||||||||||||
| 46 | as => 'HashRef', | ||||||||||||||||||||||||||||
| 47 | where => And( | ||||||||||||||||||||||||||||
| 48 | IsHashRef, | ||||||||||||||||||||||||||||
| 49 | HasAllKeys(qw[scriptname pidfile socket]), | ||||||||||||||||||||||||||||
| 50 | OnHashKeys( | ||||||||||||||||||||||||||||
| 51 | additional_args => IsArrayRef | ||||||||||||||||||||||||||||
| 52 | ) | ||||||||||||||||||||||||||||
| 53 | ) | ||||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||
| 55 | ); | ||||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | 10 | subtype 'FCGI::Engine::Manager::Config' | |||||||||||||||||||||||||||
| 59 | => as 'ArrayRef[FCGI::Engine::Manager::Server::Config]'; | ||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||
| 61 | ## FCGI::Engine::ProcManager | ||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | 10 | enum 'FCGI::Engine::ProcManager::Role' => [ qw[manager server] ]; | |||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | 10 | 1; | |||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||
| 67 | __END__ | ||||||||||||||||||||||||||||