| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
15
|
|
|
15
|
|
384
|
use 5.010001; |
|
|
15
|
|
|
|
|
57
|
|
|
2
|
15
|
|
|
15
|
|
87
|
use strict; |
|
|
15
|
|
|
|
|
36
|
|
|
|
15
|
|
|
|
|
424
|
|
|
3
|
15
|
|
|
15
|
|
75
|
use warnings; |
|
|
15
|
|
|
|
|
36
|
|
|
|
15
|
|
|
|
|
702
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
use Mite::Miteception -role, -all; |
|
6
|
15
|
|
|
15
|
|
98
|
|
|
|
15
|
|
|
|
|
35
|
|
|
|
15
|
|
|
|
|
139
|
|
|
7
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
|
8
|
|
|
|
|
|
|
our $VERSION = '0.010008'; |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has required_methods => |
|
11
|
|
|
|
|
|
|
is => ro, |
|
12
|
|
|
|
|
|
|
isa => ArrayRef[MethodName], |
|
13
|
|
|
|
|
|
|
builder => sub { [] }; |
|
14
|
10
|
|
|
10
|
|
22
|
|
|
15
|
|
|
|
|
|
|
my $self = shift; |
|
16
|
|
|
|
|
|
|
|
|
17
|
2
|
|
|
2
|
0
|
4
|
push @{ $self->required_methods }, @_; |
|
18
|
|
|
|
|
|
|
|
|
19
|
2
|
|
|
|
|
4
|
return; |
|
|
2
|
|
|
|
|
11
|
|
|
20
|
|
|
|
|
|
|
} |
|
21
|
2
|
|
|
|
|
6
|
|
|
22
|
|
|
|
|
|
|
before inject_mite_functions => sub { |
|
23
|
|
|
|
|
|
|
my ( $self, $file, $arg ) = ( shift, @_ ); |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
my $requested = sub { $arg->{$_[0]} ? 1 : $arg->{'!'.$_[0]} ? 0 : $arg->{'-all'} ? 1 : $_[1]; }; |
|
26
|
|
|
|
|
|
|
my $defaults = ! $arg->{'!-defaults'}; |
|
27
|
|
|
|
|
|
|
my $shim = $self->shim_name; |
|
28
|
|
|
|
|
|
|
my $package = $self->name; |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
no strict 'refs'; |
|
31
|
|
|
|
|
|
|
|
|
32
|
15
|
|
|
15
|
|
134
|
if ( $requested->( 'requires', $defaults ) ) { |
|
|
15
|
|
|
|
|
48
|
|
|
|
15
|
|
|
|
|
3444
|
|
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
*{ $package .'::requires' } = sub { |
|
35
|
|
|
|
|
|
|
$self->add_required_methods( @_ ); |
|
36
|
|
|
|
|
|
|
return; |
|
37
|
|
|
|
|
|
|
}; |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
$self->imported_keywords->{requires} = 'sub {}'; |
|
40
|
|
|
|
|
|
|
} |
|
41
|
|
|
|
|
|
|
}; |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
around _compile_mop_required_methods => sub { |
|
44
|
|
|
|
|
|
|
my ( $next, $self ) = ( shift, shift ); |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
my $code = $self->$next( @_ ); |
|
47
|
|
|
|
|
|
|
$code .= "\n" if $code; |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
if ( my @req = @{ $self->required_methods } ) { |
|
50
|
|
|
|
|
|
|
$code .= sprintf " \$PACKAGE->add_required_methods( %s );\n", |
|
51
|
|
|
|
|
|
|
join( q{, }, map B::perlstring( $_ ), @req ), |
|
52
|
|
|
|
|
|
|
} |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
return $code; |
|
55
|
|
|
|
|
|
|
}; |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1; |