line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: Help Directive for Validation Class Field Definitions |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Validation::Class::Directive::Help; |
4
|
|
|
|
|
|
|
|
5
|
109
|
|
|
109
|
|
52666
|
use strict; |
|
109
|
|
|
|
|
289
|
|
|
109
|
|
|
|
|
3300
|
|
6
|
109
|
|
|
109
|
|
620
|
use warnings; |
|
109
|
|
|
|
|
281
|
|
|
109
|
|
|
|
|
2860
|
|
7
|
|
|
|
|
|
|
|
8
|
109
|
|
|
109
|
|
605
|
use base 'Validation::Class::Directive'; |
|
109
|
|
|
|
|
266
|
|
|
109
|
|
|
|
|
10657
|
|
9
|
|
|
|
|
|
|
|
10
|
109
|
|
|
109
|
|
819
|
use Validation::Class::Util; |
|
109
|
|
|
|
|
321
|
|
|
109
|
|
|
|
|
754
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '7.900059'; # VERSION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has 'mixin' => 0; |
16
|
|
|
|
|
|
|
has 'field' => 1; |
17
|
|
|
|
|
|
|
has 'multi' => 0; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub normalize { |
20
|
|
|
|
|
|
|
|
21
|
1009
|
|
|
1009
|
0
|
2268
|
my ($self, $proto, $field) = @_; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# static help-text may contain multiline strings for the sake of |
24
|
|
|
|
|
|
|
# aesthetics, flatten them here |
25
|
|
|
|
|
|
|
|
26
|
1009
|
50
|
|
|
|
2674
|
if (defined $field->{help}) { |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
0
|
$field->{help} =~ s/^[\n\s\t\r]+//g; |
29
|
0
|
|
|
|
|
0
|
$field->{help} =~ s/[\n\s\t\r]+$//g; |
30
|
0
|
|
|
|
|
0
|
$field->{help} =~ s/[\n\s\t\r]+/ /g; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
1009
|
|
|
|
|
2346
|
return $self; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |