line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Dancer::Deprecation; |
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:SUKRIA'; |
3
|
|
|
|
|
|
|
#ABSTRACT: handle deprecation messages |
4
|
|
|
|
|
|
|
$Dancer::Deprecation::VERSION = '1.3514_04'; # TRIAL |
5
|
|
|
|
|
|
|
$Dancer::Deprecation::VERSION = '1.351404'; |
6
|
195
|
|
|
195
|
|
1904
|
use strict; |
|
195
|
|
|
|
|
330
|
|
|
195
|
|
|
|
|
4681
|
|
7
|
195
|
|
|
195
|
|
833
|
use warnings; |
|
195
|
|
|
|
|
311
|
|
|
195
|
|
|
|
|
4645
|
|
8
|
195
|
|
|
195
|
|
873
|
use Carp; |
|
195
|
|
|
|
|
305
|
|
|
195
|
|
|
|
|
10027
|
|
9
|
195
|
|
|
195
|
|
1205
|
use Dancer::Exception qw(:all); |
|
195
|
|
|
|
|
420
|
|
|
195
|
|
|
|
|
49322
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub deprecated { |
12
|
5
|
|
|
5
|
1
|
2501
|
my ($class, %args) = @_; |
13
|
|
|
|
|
|
|
|
14
|
5
|
|
|
|
|
31
|
my ( $package, undef, undef, $sub ) = caller(1); |
15
|
|
|
|
|
|
|
|
16
|
5
|
100
|
|
|
|
15
|
unless ( defined $args{feature} ) { |
17
|
3
|
|
|
|
|
6
|
$args{feature} = $sub; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
5
|
100
|
|
|
|
10
|
my $deprecated_at = defined $args{version} ? $args{version} : undef; |
21
|
|
|
|
|
|
|
|
22
|
5
|
|
|
|
|
6
|
my $msg; |
23
|
5
|
100
|
|
|
|
9
|
if ( defined $args{message} ) { |
24
|
2
|
|
|
|
|
3
|
$msg = $args{message}; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
else { |
27
|
3
|
|
|
|
|
6
|
$msg = "$args{feature} has been deprecated"; |
28
|
|
|
|
|
|
|
} |
29
|
5
|
100
|
|
|
|
11
|
$msg .= " since version $deprecated_at" if defined $deprecated_at; |
30
|
5
|
50
|
|
|
|
7
|
$msg .= ". " . $args{reason} if defined $args{reason}; |
31
|
|
|
|
|
|
|
|
32
|
5
|
100
|
|
|
|
12
|
raise core_deprecation => $msg if $args{fatal}; |
33
|
4
|
|
|
|
|
442
|
carp($msg); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |