File Coverage

inc/WWW/Wookie/Module/Build.pm
Criterion Covered Total %
statement 17 40 42.5
branch 0 10 0.0
condition n/a
subroutine 6 8 75.0
pod 0 1 0.0
total 23 59 38.9


line stmt bran cond sub pod time code
1             # -*- cperl; cperl-indent-level: 4 -*-
2             ## no critic (RequirePodSections)
3             package WWW::Wookie::Module::Build v1.1.4;
4              
5 1     1   25 use 5.016000;
  1         4  
6              
7 1     1   6 use strict;
  1         2  
  1         67  
8 1     1   6 use warnings;
  1         2  
  1         97  
9              
10 1     1   6 use Carp;
  1         3  
  1         173  
11 1     1   775 use English qw($OS_ERROR $EXECUTABLE_NAME -no_match_vars);
  1         4076  
  1         8  
12              
13 1     1   964 use parent 'WWW::Wookie::Module::Build::Standard';
  1         346  
  1         6  
14              
15             ## no critic (Capitalization)
16             sub ACTION_nytprof {
17             ## use critic
18 0     0 0   my ($self) = @_;
19 0           $self->depends_on('build');
20 0           $self->_run_nytprof();
21 0           return;
22             }
23              
24             sub _run_nytprof {
25 0     0     my ($self) = @_;
26 0 0         eval { require Devel::NYTProf; 1 }
  0            
  0            
27             or Carp::croak 'Devel::NYTProf is required to run nytprof';
28 0 0         eval { require File::Which; File::Which->import('which'); 1 }
  0            
  0            
  0            
29             or Carp::croak 'File::Which is required to run nytprof';
30 0 0         my $nytprofhtml = File::Which::which('nytprofhtml')
31             or Carp::croak 'Could not find nytprofhtml in your PATH';
32 0           my $this_perl = $EXECUTABLE_NAME;
33 0           my @perl_args = qw(-Iblib/lib -d:NYTProf bin/p800date 36LC0079.jpg);
34 0           warn qq{Running: $this_perl @perl_args\n};
35 0           my $status = system $this_perl, @perl_args;
36              
37 0 0         if ( 1 == $status ) {
38 0           Carp::croak qq{p800date failed with status $status};
39             }
40 0           $status = system $nytprofhtml;
41 0 0         if ($status) {
42 0           Carp::croak qq{nytprofhtml failed with status $status};
43             }
44 0           return;
45             }
46              
47             1;
48              
49             __END__
50              
51             =pod
52              
53             =for stopwords nytprof profiler Ipenburg
54              
55             =head1 NAME
56              
57             WWW::Wookie::Module::Build - Customization of L<Module::Build> for
58             L<WWW::Wookie>.
59              
60             =head1 DESCRIPTION
61              
62             This is a custom subclass of L<Module::Build> (actually,
63             L<WWW::Wookie::Module::Build::Standard>) that enhances existing functionality
64             and adds more for the benefit of installing and developing L<WWW::Wookie>. The
65             following actions have been added or redefined:
66              
67             =head1 ACTIONS
68              
69             =over
70              
71             =item nytprof
72              
73             Runs C<perlcritic> under the L<Devel::NYTProf> profiler and generates
74             an HTML report in F<nytprof/index.html>.
75              
76             =back
77              
78             =head1 AUTHOR
79              
80             Roland van Ipenburg <roland@rolandvanipenburg.com>, based on the work of Elliot
81             Shank <perl@galumph.com> in L<Perl::Critic>.
82              
83             =head1 COPYRIGHT
84              
85             Copyright (c) 2024 Roland van Ipenburg.
86              
87             This program is free software; you can redistribute it and/or modify
88             it under the same terms as Perl itself. The full text of this license
89             can be found in the LICENSE file included with this module.
90              
91             =cut