| 1 | package Reply::Plugin::LoadClass; | ||||||||||
| 2 | 1 | our $AUTHORITY = 'cpan:DOY'; | |||||||||
| 3 | 1 | $Reply::Plugin::LoadClass::VERSION = '0.42'; | |||||||||
| 4 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | # ABSTRACT: attempts to load classes implicitly if possible | ||||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | use base 'Reply::Plugin'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 1 | ▶ | use Module::Runtime 'use_package_optimistically'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 1 | ▶ | use Try::Tiny; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | |||||||||||
| 13 | |||||||||||
| 14 | 0 | ▶ | sub execute { | ||||||||
|
Subroutine
execute: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 15 | 0 | my $self = shift; | |||||||||
| 16 | 0 | my ($next, @args) = @_; | |||||||||
| 17 | |||||||||||
| 18 | 0 | ▶ | try { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 19 | 0 | $next->(@args); | |||||||||
| 20 | } | ||||||||||
| 21 | 0 | ▶ | catch { | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||
| 22 | 0 | ▶ | if (/^Can't locate object method "[^"]*" via package "([^"]*)"/) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | 0 | use_package_optimistically($1); | |||||||||
| 24 | 0 | $next->(@args); | |||||||||
| 25 | } | ||||||||||
| 26 | else { | ||||||||||
| 27 | 0 | die $_; | |||||||||
| 28 | } | ||||||||||
| 29 | } | ||||||||||
| 30 | 0 | } | |||||||||
| 31 | |||||||||||
| 32 | 1 | 1; | |||||||||
| 33 | |||||||||||
| 34 | __END__ | ||||||||||