File Coverage

inc/My/Module/Meta.pm
Criterion Covered Total %
statement 11 57 19.3
branch 0 12 0.0
condition 0 3 0.0
subroutine 4 23 17.3
pod 18 18 100.0
total 33 113 29.2


line stmt bran cond sub pod time code
1             package My::Module::Meta;
2              
3 1     1   17 use 5.008;
  1         3  
4              
5 1     1   3 use strict;
  1         1  
  1         16  
6 1     1   8 use warnings;
  1         1  
  1         28  
7              
8 1     1   3 use Carp;
  1         1  
  1         686  
9              
10             sub new {
11 0     0 1   my ( $class ) = @_;
12 0 0         ref $class and $class = ref $class;
13             my $self = {
14             distribution => $ENV{MAKING_MODULE_DISTRIBUTION},
15 0           };
16 0           bless $self, $class;
17 0           return $self;
18             }
19              
20             sub abstract {
21 0     0 1   return 'Test POD links';
22             }
23              
24             sub add_to_cleanup {
25 0     0 1   return [ qw{ cover_db xt/author/optionals } ];
26             }
27              
28             sub author {
29 0     0 1   return 'Thomas R. Wyant, III F';
30             }
31              
32             sub build_requires {
33             return +{
34 0     0 1   'Test::More' => 0.88, # Because of done_testing().
35             };
36             }
37              
38             sub configure_requires {
39             return +{
40 0     0 1   'lib' => 0,
41             'strict' => 0,
42             'warnings' => 0,
43             };
44             }
45              
46             sub dist_name {
47 0     0 1   return 'Test-Pod-LinkCheck-Lite';
48             }
49              
50             sub distribution {
51 0     0 1   my ( $self ) = @_;
52 0           return $self->{distribution};
53             }
54              
55             sub license {
56 0     0 1   return 'perl';
57             }
58              
59             sub meta_merge {
60 0     0 1   my ( undef, @extra ) = @_;
61             return {
62 0           'meta-spec' => {
63             version => 2,
64             },
65             dynamic_config => 1,
66             resources => {
67             bugtracker => {
68             web => 'https://github.com/trwyant/perl-Test-Pod-LinkCheck-Lite/issues',
69             mailto => 'harryfmudd@comcast.net',
70             },
71             license => 'http://dev.perl.org/licenses/',
72             repository => {
73             type => 'git',
74             url => 'git://github.com/trwyant/perl-Test-Pod-LinkCheck-Lite.git',
75             web => 'https://github.com/trwyant/perl-Test-Pod-LinkCheck-Lite',
76             },
77             },
78             @extra,
79             };
80             }
81              
82             sub module_name {
83 0     0 1   return 'Test::Pod::LinkCheck::Lite';
84             }
85              
86             sub no_index {
87             return +{
88 0     0 1   directory => [ qw{ inc t xt } ],
89             package => [ qw{ My_Parser } ],
90             };
91             }
92              
93             sub provides {
94 0     0 1   my $provides;
95 0           local $@ = undef;
96              
97 0 0         eval {
98 0           require CPAN::Meta;
99 0           require ExtUtils::Manifest;
100 0           require Module::Metadata;
101              
102 0           my $manifest;
103             {
104 0     0     local $SIG{__WARN__} = sub {};
  0            
105 0           $manifest = ExtUtils::Manifest::maniread();
106             }
107 0 0         keys %{ $manifest || {} }
  0 0          
108             or return;
109              
110             # Skeleton so we can use should_index_file() and
111             # should_index_package().
112 0           my $meta = CPAN::Meta->new( {
113             name => 'Euler',
114             version => 2.71828,
115             no_index => no_index(),
116             },
117             );
118              
119             # The Module::Metadata docs say not to use
120             # package_versions_from_directory() directly, but the 'files =>'
121             # version of provides() is broken, and has been known to be so
122             # since 2014, so it's not getting fixed any time soon. So:
123              
124 0           foreach my $fn ( sort keys %{ $manifest } ) {
  0            
125 0 0         $fn =~ m/ [.] pm \z /smx
126             or next;
127 0           my $pvd = Module::Metadata->package_versions_from_directory(
128             undef, [ $fn ] );
129 0           foreach my $pkg ( keys %{ $pvd } ) {
  0            
130             $meta->should_index_package( $pkg )
131             and $meta->should_index_file( $pvd->{$pkg}{file} )
132 0 0 0       and $provides->{$pkg} = $pvd->{$pkg};
133             }
134             }
135              
136 0           1;
137             } or return;
138              
139 0           return ( provides => $provides );
140             }
141              
142             sub optional_modules {
143 0     0 1   return ( qw{ IO::Socket::SSL Net::SSLeay } );
144             }
145              
146             sub requires {
147 0     0 1   my ( $self, @extra ) = @_;
148             ## if ( ! $self->distribution() ) {
149             ## }
150             return +{
151 0           'B::Keywords' => 0,
152             'Carp' => 0,
153             'Exporter' => 0,
154             'File::Find' => 0,
155             'File::Spec' => 0,
156             'HTTP::Tiny' => 0,
157             'IPC::Cmd' => 0,
158             'Module::Load::Conditional' => 0,
159             'Pod::Perldoc' => 0,
160             'Pod::Simple' => 0,
161             'Pod::Simple::LinkSection' => 0,
162             'Pod::Simple::PullParser' => 0,
163             'Storable' => 0,
164             'Test::Builder' => 0,
165             constant => 0,
166             strict => 0,
167             utf8 => 0,
168             warnings => 0,
169             @extra,
170             };
171             }
172              
173             sub requires_perl {
174 0     0 1   return 5.008;
175             }
176              
177             sub script_files {
178             return [
179 0     0 1   ];
180             }
181              
182             sub version_from {
183 0     0 1   return 'lib/Test/Pod/LinkCheck/Lite.pm';
184             }
185              
186             1;
187              
188             __END__