line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
3
|
|
|
3
|
|
2441
|
use 5.001001; |
|
3
|
|
|
|
|
13
|
|
2
|
|
|
|
|
|
|
package Mojolicious::Plugin::SQLiteViewerLite::Base; |
3
|
3
|
|
|
3
|
|
19
|
use Mojo::Base 'Mojolicious::Plugin'; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
24
|
|
4
|
3
|
|
|
3
|
|
1962
|
use DBIx::Custom; |
|
3
|
|
|
|
|
56571
|
|
|
3
|
|
|
|
|
32
|
|
5
|
3
|
|
|
3
|
|
2060
|
use Validator::Custom; |
|
3
|
|
|
|
|
54073
|
|
|
3
|
|
|
|
|
22
|
|
6
|
3
|
|
|
3
|
|
116
|
use File::Basename 'dirname'; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
166
|
|
7
|
3
|
|
|
3
|
|
20
|
use Cwd 'abs_path'; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
133
|
|
8
|
3
|
|
|
3
|
|
18
|
use Carp 'croak'; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
1733
|
|
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
|
3
|
|
|
3
|
0
|
27
|
my ($self, $renderer, $class) = @_; |
30
|
3
|
|
|
|
|
17
|
$class =~ s/::/\//g; |
31
|
3
|
|
|
|
|
10
|
$class .= '.pm'; |
32
|
3
|
|
|
|
|
289
|
my $public = abs_path $INC{$class}; |
33
|
3
|
|
|
|
|
25
|
$public =~ s/\.pm$//; |
34
|
3
|
|
|
|
|
8
|
push @{$renderer->paths}, "$public/templates"; |
|
3
|
|
|
|
|
19
|
|
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub add_static_path { |
38
|
3
|
|
|
3
|
0
|
32
|
my ($self, $static, $class) = @_; |
39
|
3
|
|
|
|
|
14
|
$class =~ s/::/\//g; |
40
|
3
|
|
|
|
|
7
|
$class .= '.pm'; |
41
|
3
|
|
|
|
|
277
|
my $public = abs_path $INC{$class}; |
42
|
3
|
|
|
|
|
22
|
$public =~ s/\.pm$//; |
43
|
3
|
|
|
|
|
11
|
push @{$static->paths}, "$public/public"; |
|
3
|
|
|
|
|
17
|
|
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |