line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
465051
|
use v5.012; |
|
2
|
|
|
|
|
24
|
|
2
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
38
|
|
3
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
175
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Missing::XS; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
8
|
|
|
|
|
|
|
our $VERSION = '0.001000'; |
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
14
|
use constant { true => !!1, false => !!0 }; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
158
|
|
11
|
|
|
|
|
|
|
|
12
|
2
|
|
|
2
|
|
1018
|
use Module::Runtime qw( module_notional_filename require_module ); |
|
2
|
|
|
|
|
3551
|
|
|
2
|
|
|
|
|
10
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $CPANM = false; |
15
|
|
|
|
|
|
|
our @RECOMMENDATIONS; |
16
|
|
|
|
|
|
|
sub import { |
17
|
0
|
|
|
0
|
|
0
|
my $class = shift; |
18
|
0
|
|
|
|
|
0
|
$CPANM = !! ( "@_" =~ /cpanm/i ); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
our @CHECKS = ( |
22
|
|
|
|
|
|
|
sub { shift->basic_check_or_warning( 'Class::Load' ) }, |
23
|
|
|
|
|
|
|
sub { shift->basic_check_or_warning( 'JSON' ) }, |
24
|
|
|
|
|
|
|
sub { shift->basic_check_or_warning( 'JSON::MaybeXS', 'Cpanel::JSON::XS' ) }, |
25
|
|
|
|
|
|
|
sub { shift->basic_check_or_warning( 'List::MoreUtils' ) }, |
26
|
|
|
|
|
|
|
sub { shift->basic_check_or_warning( 'List::SomeUtils' ) }, |
27
|
|
|
|
|
|
|
sub { shift->basic_check_or_warning( 'match::simple' ) }, |
28
|
|
|
|
|
|
|
sub { shift->basic_check_or_warning( 'Moo', 'Class::XSAccessor' ) }, |
29
|
|
|
|
|
|
|
sub { shift->basic_check_or_warning( 'Object::Accessor' ) }, |
30
|
|
|
|
|
|
|
sub { shift->basic_check_or_warning( 'Object::Adhoc', 'Class::XSAccessor' ) }, |
31
|
|
|
|
|
|
|
sub { shift->basic_check_or_warning( 'Package::Stash' ) }, |
32
|
|
|
|
|
|
|
sub { shift->basic_check_or_warning( 'PerlX::ArraySkip' ) }, |
33
|
|
|
|
|
|
|
sub { shift->basic_check_or_warning( 'PerlX::Maybe' ) }, |
34
|
|
|
|
|
|
|
sub { shift->basic_check_or_warning( 'PPI' ) }, |
35
|
|
|
|
|
|
|
sub { shift->basic_check_or_warning( 'Readonly' ) }, |
36
|
|
|
|
|
|
|
sub { shift->basic_check_or_warning( 'Ref::Util' ) }, |
37
|
|
|
|
|
|
|
sub { shift->basic_check_or_warning( 'String::Numeric' ) }, |
38
|
|
|
|
|
|
|
sub { shift->basic_check_or_warning( 'Text::CSV', 'Text::CSV_XS' ) }, |
39
|
|
|
|
|
|
|
sub { shift->basic_check_or_warning( 'Type::Params', 'Class::XSAccessor' ) }, |
40
|
|
|
|
|
|
|
sub { shift->basic_check_or_warning( 'Type::Tiny' ) }, |
41
|
|
|
|
|
|
|
sub { |
42
|
|
|
|
|
|
|
my $class = shift; |
43
|
|
|
|
|
|
|
return true if !$INC{'Mouse/Util.pm'}; |
44
|
|
|
|
|
|
|
Mouse::Util::MOUSE_XS() |
45
|
|
|
|
|
|
|
or warn "Mouse is installed without its XS backend.\n"; |
46
|
|
|
|
|
|
|
}, |
47
|
|
|
|
|
|
|
); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub all_checks { |
50
|
0
|
|
|
0
|
0
|
0
|
my $class = shift; |
51
|
0
|
|
|
|
|
0
|
for my $check ( @CHECKS ) { |
52
|
0
|
|
|
|
|
0
|
$class->$check; |
53
|
|
|
|
|
|
|
} |
54
|
0
|
0
|
0
|
|
|
0
|
if ( $CPANM and @RECOMMENDATIONS ) { |
55
|
0
|
|
|
|
|
0
|
warn "\n"; |
56
|
0
|
|
|
|
|
0
|
warn "You may wish to run:\n"; |
57
|
0
|
|
|
|
|
0
|
warn qq|cpanm @{[ map qq{"$_"}, @RECOMMENDATIONS ]}\n|; |
|
0
|
|
|
|
|
0
|
|
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub basic_check_or_warning { |
62
|
0
|
|
|
0
|
0
|
0
|
my ( $class, $frontend, $xs_backend ) = ( shift, @_ ); |
63
|
0
|
|
0
|
|
|
0
|
$xs_backend //= "$frontend\::XS"; |
64
|
0
|
0
|
|
|
|
0
|
$class->basic_check( $frontend, $xs_backend ) |
65
|
|
|
|
|
|
|
or $class->basic_warning( $frontend, $xs_backend ); |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub basic_check { |
69
|
2
|
|
|
2
|
0
|
53184
|
my ( $class, $frontend, $xs_backend ) = ( shift, @_ ); |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
# If this module is not being used at all, everything is okay. |
72
|
2
|
|
|
|
|
9
|
my $frontend_filename = module_notional_filename( $frontend ); |
73
|
2
|
100
|
|
|
|
95
|
return true if !$INC{$frontend_filename}; |
74
|
|
|
|
|
|
|
|
75
|
1
|
|
|
|
|
3
|
return !!eval { require_module($xs_backend) }; |
|
1
|
|
|
|
|
5
|
|
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub basic_warning { |
79
|
0
|
|
|
0
|
0
|
|
my ( $class, $frontend, $xs_backend ) = ( shift, @_ ); |
80
|
0
|
|
|
|
|
|
warn sprintf( "%s loaded but %s is not available.\n", $frontend, $xs_backend ); |
81
|
0
|
|
|
|
|
|
push @RECOMMENDATIONS, $xs_backend; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
END { |
85
|
2
|
50
|
|
2
|
|
13551
|
__PACKAGE__->all_checks unless $ENV{PERL_MISSING_XS_NO_END}; |
86
|
|
|
|
|
|
|
}; |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
1; |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
__END__ |