File Coverage

blib/lib/PkgForge/BuildCommand.pm
Criterion Covered Total %
statement 15 24 62.5
branch 0 2 0.0
condition n/a
subroutine 5 8 62.5
pod 0 3 0.0
total 20 37 54.0


line stmt bran cond sub pod time code
1             package PkgForge::BuildCommand; # -*-perl-*-
2 1     1   1045 use strict;
  1         2  
  1         46  
3 1     1   8 use warnings;
  1         2  
  1         58  
4              
5             # $Id: BuildCommand.pm.in 16785 2011-04-22 09:43:34Z squinney@INF.ED.AC.UK $
6             # $Source:$
7             # $Revision: 16785 $
8             # $HeadURL: https://svn.lcfg.org/svn/source/tags/PkgForge-Server/PkgForge_Server_1_1_10/lib/PkgForge/BuildCommand.pm.in $
9             # $Date: 2011-04-22 10:43:34 +0100 (Fri, 22 Apr 2011) $
10              
11             our $VERSION = '1.1.10';
12              
13 1     1   5 use Moose::Role;
  1         3  
  1         7  
14 1     1   5711 use MooseX::Types::Moose qw(Str);
  1         2  
  1         12  
15              
16             requires 'run';
17              
18             has 'name' => (
19             is => 'ro',
20             isa => Str,
21             required => 1,
22             lazy => 1,
23             builder => 'build_name',
24             documentation => 'The name of the command module',
25             );
26              
27             has 'tools' => (
28             traits => ['Array'],
29             is => 'ro',
30             isa => 'ArrayRef[Str]',
31             required => 1,
32             default => sub { [] },
33             handles => {
34             tools_list => 'elements',
35             },
36             documentation => 'The list of tools which are used by this command',
37             );
38              
39 1     1   6435 no Moose::Role;
  1         4  
  1         9  
40              
41             sub build_name {
42 0     0 0   my ($self) = @_;
43              
44 0           return ( split /::/, $self->meta->name )[-1],
45             }
46              
47             sub stringify {
48 0     0 0   my ($self) = @_;
49 0           return $self->name;
50             }
51              
52             sub verify_environment {
53 0     0 0   my ($self) = @_;
54              
55 0           for my $tool ($self->tools_list) {
56 0 0         if ( !-x $tool ) {
57 0           die "Cannot find $tool\n";
58             }
59             }
60              
61 0           return 1;
62             }
63              
64             1;
65             __END__