line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MVC::Neaf::Route::PreRoute; |
2
|
|
|
|
|
|
|
|
3
|
94
|
|
|
94
|
|
710
|
use strict; |
|
94
|
|
|
|
|
243
|
|
|
94
|
|
|
|
|
2835
|
|
4
|
94
|
|
|
94
|
|
505
|
use warnings; |
|
94
|
|
|
|
|
205
|
|
|
94
|
|
|
|
|
4604
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.29'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
MVC::Neaf::Route::PreRoute - temporary route stub for Not Even A Framework |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 DESCRIPTION |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
This is utility class. |
14
|
|
|
|
|
|
|
Nothing to see here unless one intends to work on L itself. |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
It will show up in C<$req-Eroute> while a specific route |
17
|
|
|
|
|
|
|
has not yet been selected. |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
It can still contain hooks & helpers, that's what it's for. |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 METHODS |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=cut |
24
|
|
|
|
|
|
|
|
25
|
94
|
|
|
94
|
|
616
|
use Carp; |
|
94
|
|
|
|
|
204
|
|
|
94
|
|
|
|
|
5876
|
|
26
|
|
|
|
|
|
|
|
27
|
94
|
|
|
94
|
|
716
|
use parent qw(MVC::Neaf::Route); |
|
94
|
|
|
|
|
229
|
|
|
94
|
|
|
|
|
768
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head2 new |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
'method' parameter is required. |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=cut |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
my $nobody_home = sub { die 404 }; |
36
|
|
|
|
|
|
|
sub new { |
37
|
83
|
|
|
83
|
1
|
231
|
my $class = shift; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
# Not using SUPER::new because MVC::Neaf::Route requires a parent |
40
|
83
|
|
|
|
|
811
|
my $self = bless { |
41
|
|
|
|
|
|
|
where => '[in pre_route]', |
42
|
|
|
|
|
|
|
path => '/', |
43
|
|
|
|
|
|
|
code => $nobody_home, |
44
|
|
|
|
|
|
|
default => {}, |
45
|
|
|
|
|
|
|
hooks => {}, |
46
|
|
|
|
|
|
|
helpers => {}, |
47
|
|
|
|
|
|
|
@_ |
48
|
|
|
|
|
|
|
}, $class; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
$self->post_setup() |
51
|
83
|
100
|
|
|
|
1081
|
if $self->{parent}; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
# Probably a bad idea. How to visually separate missing path in logs? |
54
|
83
|
|
|
|
|
226
|
$self->{path} = '[pre_route]'; |
55
|
83
|
|
|
|
|
396
|
$self; |
56
|
|
|
|
|
|
|
}; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head2 RUNTIME STUB METHODS |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=over |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=item * method = Actual method; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=item * path = C<'[pre_route]'> |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
May change to C> in the future. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=item * code = C |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=item * where = C<'[pre_route]'> |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=back |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
Do not rely on these values. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=cut |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
This module is part of L suite. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Copyright 2016-2023 Konstantin S. Uvarin C. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
86
|
|
|
|
|
|
|
under the terms of either: the GNU General Public License as published |
87
|
|
|
|
|
|
|
by the Free Software Foundation; or the Artistic License. |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
See L for more information. |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=cut |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
1; |