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   18 use 5.010;
  1         2  
4              
5 1     1   4 use strict;
  1         1  
  1         16  
6 1     1   2 use warnings;
  1         1  
  1         28  
7              
8 1     1   3 use Carp;
  1         1  
  1         672  
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 'Add almanac date/time functionality (sunrise, etc.) to Date::Manip';
22             }
23              
24             sub add_to_cleanup {
25 0     0 1   return [ qw{ cover_db } ];
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   'Test2::V0' => 0,
35             'Test2::Plugin::BailOnFail' => 0,
36             'Test2::Tools::LoadModule' => 0.008,
37             };
38             }
39              
40             sub configure_requires {
41             return +{
42 0     0 1   'lib' => 0,
43             'strict' => 0,
44             'warnings' => 0,
45             };
46             }
47              
48             sub dist_name {
49 0     0 1   return 'Date-ManipX-Almanac';
50             }
51              
52             sub distribution {
53 0     0 1   my ( $self ) = @_;
54 0           return $self->{distribution};
55             }
56              
57             sub license {
58 0     0 1   return 'perl';
59             }
60              
61             sub meta_merge {
62 0     0 1   my ( undef, @extra ) = @_;
63             return {
64 0           'meta-spec' => {
65             version => 2,
66             },
67             dynamic_config => 1,
68             resources => {
69             bugtracker => {
70             web => 'https://github.com/trwyant/perl-Date-ManipX-Almanac/issues',
71             # # web => 'https://github.com/trwyant/perl-Date-ManipX-Almanac/issues',
72             mailto => 'harryfmudd@comcast.net',
73             },
74             license => 'http://dev.perl.org/licenses/',
75             repository => {
76             type => 'git',
77             url => 'git://github.com/trwyant/perl-Date-ManipX-Almanac.git',
78             web => 'https://github.com/trwyant/perl-Date-ManipX-Almanac',
79             },
80             },
81             @extra,
82             };
83             }
84              
85             sub module_name {
86 0     0 1   return 'Date::ManipX::Almanac';
87             }
88              
89             sub no_index {
90             return +{
91 0     0 1   directory => [ qw{ eg inc t tools xt } ],
92             };
93             }
94              
95             sub optionals_for_testing {
96 0     0 1   return qw{
97             Astro::Coord::ECI::Star
98             Astro::Coord::ECI::VSOP87D::Venus
99             Sub::Util
100             };
101             }
102              
103             sub provides {
104 0     0 1   my $provides;
105 0           local $@ = undef;
106              
107 0 0         eval {
108 0           require CPAN::Meta;
109 0           require ExtUtils::Manifest;
110 0           require Module::Metadata;
111              
112 0           my $manifest;
113             {
114 0     0     local $SIG{__WARN__} = sub {};
  0            
115 0           $manifest = ExtUtils::Manifest::maniread();
116             }
117 0 0         keys %{ $manifest || {} }
  0 0          
118             or return;
119              
120             # Skeleton so we can use should_index_file() and
121             # should_index_package().
122 0           my $meta = CPAN::Meta->new( {
123             name => 'Euler',
124             version => 2.71828,
125             no_index => no_index(),
126             },
127             );
128              
129             # The Module::Metadata docs say not to use
130             # package_versions_from_directory() directly, but the 'files =>'
131             # version of provides() is broken, and has been known to be so
132             # since 2014, so it's not getting fixed any time soon. So:
133              
134 0           foreach my $fn ( sort keys %{ $manifest } ) {
  0            
135 0 0         $fn =~ m/ [.] pm \z /smx
136             or next;
137 0           my $pvd = Module::Metadata->package_versions_from_directory(
138             undef, [ $fn ] );
139 0           foreach my $pkg ( keys %{ $pvd } ) {
  0            
140             $meta->should_index_package( $pkg )
141             and $meta->should_index_file( $pvd->{$pkg}{file} )
142 0 0 0       and $provides->{$pkg} = $pvd->{$pkg};
143             }
144             }
145              
146 0           1;
147             } or return;
148              
149 0           return ( provides => $provides );
150             }
151              
152             sub requires {
153 0     0 1   my ( $self, @extra ) = @_;
154             ## if ( ! $self->distribution() ) {
155             ## }
156             return +{
157 0           'Astro::Coord::ECI' => 0.119, # For clone() to work
158             'Astro::Coord::ECI::Moon' => 0.119, # For clone() to work
159             'Astro::Coord::ECI::Sun' => 0.119, # For clone() to work
160             'Astro::Coord::ECI::Utils' => 0.119, # For clone() to work
161             'Carp' => 0,
162             'Date::Manip' => 6.55, # For new_config()
163             'Date::Manip::Date' => 6.55, # to work
164             'Module::Load' => 0,
165             'Scalar::Util' => 0,
166             'Text::ParseWords' => 0,
167             constant => 0,
168             parent => 0,
169             strict => 0,
170             utf8 => 0,
171             warnings => 0,
172             @extra,
173             };
174             }
175              
176             sub requires_perl {
177 0     0 1   return 5.010;
178             }
179              
180             sub script_files {
181             return [
182 0     0 1   ];
183             }
184              
185             sub version_from {
186 0     0 1   return 'lib/Date/ManipX/Almanac.pm';
187             }
188              
189             1;
190              
191             __END__