line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
3
|
|
|
3
|
|
799150
|
use 5.008008; |
|
3
|
|
|
|
|
44
|
|
2
|
3
|
|
|
3
|
|
14
|
use strict; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
60
|
|
3
|
3
|
|
|
3
|
|
11
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
202
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
7
|
|
|
|
|
|
|
our $VERSION = '0.085'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
use Type::Library -base; |
10
|
3
|
|
|
3
|
|
829
|
use Type::Utils (); |
|
3
|
|
|
|
|
59493
|
|
|
3
|
|
|
|
|
38
|
|
11
|
3
|
|
|
3
|
|
2521
|
|
|
3
|
|
|
|
|
22683
|
|
|
3
|
|
|
|
|
92
|
|
12
|
|
|
|
|
|
|
BEGIN { |
13
|
|
|
|
|
|
|
Type::Utils::extends(qw/ |
14
|
3
|
|
|
3
|
|
13
|
Types::Standard |
15
|
|
|
|
|
|
|
Types::Common::Numeric |
16
|
|
|
|
|
|
|
Types::Common::String |
17
|
|
|
|
|
|
|
/); |
18
|
|
|
|
|
|
|
}; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
our (%EXPORT_TAGS, @EXPORT_OK); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
$EXPORT_TAGS{ 'booleans' } = [qw/ true false /]; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
$EXPORT_TAGS{ 'privacy' } = [qw/ ro rw rwp lazy bare private /]; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
use Scalar::Util qw( blessed ); |
29
|
|
|
|
|
|
|
@_ = sprintf(shift, @_) if @_ > 1; |
30
|
|
|
|
|
|
|
require Carp; |
31
|
|
|
|
|
|
|
goto \&Carp::confess; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
$EXPORT_TAGS{ 'util' } = [qw/ blessed confess /]; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
push @EXPORT_OK, map @{$EXPORT_TAGS{$_}}, keys(%EXPORT_TAGS); |
37
|
3
|
|
|
3
|
|
396299
|
|
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
612
|
|
38
|
|
|
|
|
|
|
my $orig = 'Type::Library'->can('import'); |
39
|
0
|
0
|
|
0
|
0
|
0
|
'strict'->import; |
40
|
0
|
|
|
|
|
0
|
'warnings'->import; |
41
|
0
|
|
|
|
|
0
|
push @_, -all if @_ == 1; |
42
|
|
|
|
|
|
|
goto $orig; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=pod |
49
|
|
|
|
|
|
|
|
50
|
3
|
|
|
3
|
|
45
|
=encoding utf-8 |
51
|
3
|
|
|
|
|
57
|
|
52
|
3
|
100
|
|
|
|
16
|
=head1 NAME |
53
|
3
|
|
|
|
|
17
|
|
54
|
|
|
|
|
|
|
MooX::Press::Keywords - handy keywords for MooX::Press |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 SYNOPSIS |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
use MooX::Press::Keywords; |
59
|
|
|
|
|
|
|
use MooX::Press ( |
60
|
|
|
|
|
|
|
class => [ |
61
|
|
|
|
|
|
|
'Leaf' => { |
62
|
|
|
|
|
|
|
has => { |
63
|
|
|
|
|
|
|
'colour' => { |
64
|
|
|
|
|
|
|
is => rwp, |
65
|
|
|
|
|
|
|
enum => [qw/ green red brown /], |
66
|
|
|
|
|
|
|
default => 'green', |
67
|
|
|
|
|
|
|
}, |
68
|
|
|
|
|
|
|
}, |
69
|
|
|
|
|
|
|
}, |
70
|
|
|
|
|
|
|
'Tree' => { |
71
|
|
|
|
|
|
|
has => { |
72
|
|
|
|
|
|
|
'species' => { |
73
|
|
|
|
|
|
|
is => ro, |
74
|
|
|
|
|
|
|
isa => Str, |
75
|
|
|
|
|
|
|
required => true, |
76
|
|
|
|
|
|
|
}, |
77
|
|
|
|
|
|
|
'foliage' => { |
78
|
|
|
|
|
|
|
is => lazy, |
79
|
|
|
|
|
|
|
isa => '@Leaf', |
80
|
|
|
|
|
|
|
builder => sub { [] }, |
81
|
|
|
|
|
|
|
}, |
82
|
|
|
|
|
|
|
}, |
83
|
|
|
|
|
|
|
}, |
84
|
|
|
|
|
|
|
], |
85
|
|
|
|
|
|
|
); |
86
|
|
|
|
|
|
|
no MooX::Press::Keywords; |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 DESCRIPTION |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
This is just a quick way of importing: |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=over |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=item * |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
L<strict> and L<warnings>. |
97
|
|
|
|
|
|
|
(C<< no MooX::Press::Keywords >> won't unimport these!) |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=item * |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
L<Types::Standard>, L<Types::Common::Numeric>, and L<Types::Common::String>. |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=item * |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
C<true> and C<false> boolean constants. |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=item * |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
C<ro>, C<rw>, C<rwp>, C<lazy>, C<private>, and C<bare> string constants. |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=item * |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
C<blessed> from L<Scalar::Util>. |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=item * |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
C<confess> from L<Carp>. |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=back |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
You don't need to use it, but it might save a few lines of boilerplate |
122
|
|
|
|
|
|
|
code, and allow you to use some meaningful barewords instead of quoted |
123
|
|
|
|
|
|
|
strings and numbers. |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=head1 BUGS |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
Please report any bugs to |
128
|
|
|
|
|
|
|
L<http://rt.cpan.org/Dist/Display.html?Queue=MooX-Press>. |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=head1 SEE ALSO |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
L<MooX::Press>. |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=head1 AUTHOR |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
Toby Inkster E<lt>tobyink@cpan.orgE<gt>. |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENCE |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
This software is copyright (c) 2020 by Toby Inkster. |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
143
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=head1 DISCLAIMER OF WARRANTIES |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED |
148
|
|
|
|
|
|
|
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF |
149
|
|
|
|
|
|
|
MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
150
|
|
|
|
|
|
|
|