| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
23
|
|
|
23
|
|
105
|
use strict; |
|
|
23
|
|
|
|
|
31
|
|
|
|
23
|
|
|
|
|
857
|
|
|
2
|
23
|
|
|
23
|
|
76
|
use warnings; |
|
|
23
|
|
|
|
|
30
|
|
|
|
23
|
|
|
|
|
1409
|
|
|
3
|
|
|
|
|
|
|
package MetaCPAN::Client::Types; |
|
4
|
|
|
|
|
|
|
# ABSTRACT: type checking helper class |
|
5
|
|
|
|
|
|
|
$MetaCPAN::Client::Types::VERSION = '2.043000'; |
|
6
|
23
|
|
|
23
|
|
13760
|
use Type::Tiny (); |
|
|
23
|
|
|
|
|
520986
|
|
|
|
23
|
|
|
|
|
553
|
|
|
7
|
23
|
|
|
23
|
|
13500
|
use Types::Standard (); |
|
|
23
|
|
|
|
|
1892847
|
|
|
|
23
|
|
|
|
|
1244
|
|
|
8
|
23
|
|
|
23
|
|
616
|
use Ref::Util qw< is_ref >; |
|
|
23
|
|
|
|
|
528
|
|
|
|
23
|
|
|
|
|
1687
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
23
|
|
|
23
|
|
9533
|
use parent 'Exporter'; |
|
|
23
|
|
|
|
|
6282
|
|
|
|
23
|
|
|
|
|
131
|
|
|
11
|
|
|
|
|
|
|
our @EXPORT_OK = qw< Str Int Time ArrayRef HashRef Bool >; |
|
12
|
|
|
|
|
|
|
|
|
13
|
112
|
|
|
112
|
1
|
616
|
sub Str { Types::Standard::Str } |
|
14
|
67
|
|
|
67
|
1
|
312
|
sub Int { Types::Standard::Int } |
|
15
|
44
|
|
|
44
|
1
|
270
|
sub ArrayRef { Types::Standard::ArrayRef } |
|
16
|
67
|
|
|
67
|
1
|
339
|
sub HashRef { Types::Standard::HashRef } |
|
17
|
0
|
|
|
0
|
1
|
0
|
sub Bool { Types::Standard::Bool } |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub Time { |
|
20
|
|
|
|
|
|
|
return Type::Tiny->new( |
|
21
|
|
|
|
|
|
|
name => "Time", |
|
22
|
11
|
50
|
|
11
|
|
2640
|
constraint => sub { !is_ref($_) and /^[1-9][0-9]*(?:s|m|h)$/ }, |
|
23
|
0
|
|
|
0
|
|
0
|
message => sub { "$_ is not in time format (e.g. '5m')" }, |
|
24
|
23
|
|
|
23
|
1
|
325
|
); |
|
25
|
|
|
|
|
|
|
} |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
__END__ |