line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: HiD type constraints |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package HiD::Types; |
5
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:GENEHACK'; |
6
|
|
|
|
|
|
|
$HiD::Types::VERSION = '1.99'; |
7
|
12
|
|
|
12
|
|
195
|
use 5.014; # strict, unicode_strings |
|
12
|
|
|
|
|
57
|
|
8
|
12
|
|
|
12
|
|
52
|
use utf8; |
|
12
|
|
|
|
|
21
|
|
|
12
|
|
|
|
|
58
|
|
9
|
12
|
|
|
12
|
|
237
|
use autodie; |
|
12
|
|
|
|
|
18
|
|
|
12
|
|
|
|
|
53
|
|
10
|
12
|
|
|
12
|
|
53269
|
use warnings; |
|
12
|
|
|
|
|
24
|
|
|
12
|
|
|
|
|
426
|
|
11
|
12
|
|
|
12
|
|
59
|
use warnings qw/ FATAL utf8 /; |
|
12
|
|
|
|
|
35
|
|
|
12
|
|
|
|
|
419
|
|
12
|
12
|
|
|
12
|
|
59
|
use open qw/ :std :utf8 /; |
|
12
|
|
|
|
|
24
|
|
|
12
|
|
|
|
|
67
|
|
13
|
12
|
|
|
12
|
|
1523
|
use charnames qw/ :full /; |
|
12
|
|
|
|
|
19
|
|
|
12
|
|
|
|
|
60
|
|
14
|
|
|
|
|
|
|
|
15
|
12
|
|
|
12
|
|
1865
|
use Moose::Util::TypeConstraints; |
|
12
|
|
|
|
|
25
|
|
|
12
|
|
|
|
|
139
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
subtype 'HiD_DirPath' |
18
|
|
|
|
|
|
|
=> as 'Str' |
19
|
|
|
|
|
|
|
=> where { -d $_ }; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# TODO make this a bit more useful? |
22
|
|
|
|
|
|
|
subtype 'HiD_FileExtension' |
23
|
|
|
|
|
|
|
=> as 'Str' , |
24
|
|
|
|
|
|
|
#=> where { what, exactly? } |
25
|
|
|
|
|
|
|
; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
subtype 'HiD_FilePath' |
28
|
|
|
|
|
|
|
=> as 'Str' |
29
|
|
|
|
|
|
|
=> where { -f $_ }; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
subtype 'HiD_PosInt' |
32
|
|
|
|
|
|
|
=> as 'Int' |
33
|
|
|
|
|
|
|
=> where { $_ > 0 } |
34
|
|
|
|
|
|
|
=> message { "Must be positive integer." }; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
class_type 'HiD_Post' , { class => 'HiD::Post' }; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
### FIXME delete if after 13 Nov 2014 |
39
|
|
|
|
|
|
|
class_type 'deprecated_HiD_Plugin_class' , { class => 'HiD::Plugin'}; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
role_type 'HiD_Plugin' , { role => 'HiD::Plugin'}; |
42
|
|
|
|
|
|
|
role_type 'HiD_Generator' , { role => 'HiD::Generator'}; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
union 'Pluginish' , [qw/ |
45
|
|
|
|
|
|
|
deprecated_HiD_Plugin_class |
46
|
|
|
|
|
|
|
HiD_Plugin |
47
|
|
|
|
|
|
|
HiD_Generator |
48
|
|
|
|
|
|
|
/ ]; |
49
|
|
|
|
|
|
|
|
50
|
12
|
|
|
12
|
|
24424
|
no Moose::Util::TypeConstraints; |
|
12
|
|
|
|
|
21
|
|
|
12
|
|
|
|
|
57
|
|
51
|
|
|
|
|
|
|
1; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
__END__ |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=pod |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=encoding UTF-8 |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 NAME |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
HiD::Types - HiD type constraints |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 DESCRIPTION |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Type constraints for HiD. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 VERSION |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
version 1.99 |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 AUTHOR |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
John SJ Anderson <genehack@genehack.org> |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
This software is copyright (c) 2015 by John SJ Anderson. |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
80
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=cut |