line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
1548
|
use 5.001001; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
114
|
|
2
|
|
|
|
|
|
|
package Mojolicious::Plugin::SQLiteViewerLite::Base; |
3
|
2
|
|
|
2
|
|
9
|
use Mojo::Base 'Mojolicious::Plugin'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
13
|
|
4
|
2
|
|
|
2
|
|
1760
|
use DBIx::Custom; |
|
2
|
|
|
|
|
69371
|
|
|
2
|
|
|
|
|
27
|
|
5
|
2
|
|
|
2
|
|
1720
|
use Validator::Custom; |
|
2
|
|
|
|
|
34808
|
|
|
2
|
|
|
|
|
27
|
|
6
|
2
|
|
|
2
|
|
95
|
use File::Basename 'dirname'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
250
|
|
7
|
2
|
|
|
2
|
|
13
|
use Cwd 'abs_path'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
108
|
|
8
|
2
|
|
|
2
|
|
12
|
use Carp 'croak'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
1302
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has 'prefix'; |
11
|
|
|
|
|
|
|
has validator => sub { |
12
|
|
|
|
|
|
|
my $validator = Validator::Custom->new; |
13
|
|
|
|
|
|
|
$validator->register_constraint( |
14
|
|
|
|
|
|
|
safety_name => sub { |
15
|
|
|
|
|
|
|
my $name = shift; |
16
|
|
|
|
|
|
|
return ($name || '') =~ /^\w+$/ ? 1 : 0; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
return $validator; |
20
|
|
|
|
|
|
|
}; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
has dbi => sub { DBIx::Custom->new }; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
has command => sub { croak "Unimplemented" }; |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
0
|
1
|
0
|
sub register { croak "Unimplemented" } |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub add_template_path { |
29
|
2
|
|
|
2
|
0
|
35
|
my ($self, $renderer, $class) = @_; |
30
|
2
|
|
|
|
|
23
|
$class =~ s/::/\//g; |
31
|
2
|
|
|
|
|
7
|
$class .= '.pm'; |
32
|
2
|
|
|
|
|
298
|
my $public = abs_path $INC{$class}; |
33
|
2
|
|
|
|
|
17
|
$public =~ s/\.pm$//; |
34
|
2
|
|
|
|
|
6
|
push @{$renderer->paths}, "$public/templates"; |
|
2
|
|
|
|
|
33
|
|
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub add_static_path { |
38
|
2
|
|
|
2
|
0
|
32
|
my ($self, $static, $class) = @_; |
39
|
2
|
|
|
|
|
17
|
$class =~ s/::/\//g; |
40
|
2
|
|
|
|
|
6
|
$class .= '.pm'; |
41
|
2
|
|
|
|
|
181
|
my $public = abs_path $INC{$class}; |
42
|
2
|
|
|
|
|
14
|
$public =~ s/\.pm$//; |
43
|
2
|
|
|
|
|
5
|
push @{$static->paths}, "$public/public"; |
|
2
|
|
|
|
|
13
|
|
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |