| 1 | package PkgForge::BuildCommand; # -*-perl-*- | ||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 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 | 1 | our $VERSION = '1.1.10'; | |||||||||
| 12 | |||||||||||
| 13 | 1 | ▶ | use Moose::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | 1 | ▶ | use MooseX::Types::Moose qw(Str); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 15 | |||||||||||
| 16 | 1 | requires 'run'; | |||||||||
| 17 | |||||||||||
| 18 | 1 | 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 | 0 | ▶ | default => sub { [] }, | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 33 | 1 | handles => { | |||||||||
| 34 | tools_list => 'elements', | ||||||||||
| 35 | }, | ||||||||||
| 36 | documentation => 'The list of tools which are used by this command', | ||||||||||
| 37 | ); | ||||||||||
| 38 | |||||||||||
| 39 | 1 | ▶ | no Moose::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 40 | |||||||||||
| 41 | 0 | ▶ | sub build_name { | ||||||||
|
Subroutine
build_name: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 42 | 0 | my ($self) = @_; | |||||||||
| 43 | |||||||||||
| 44 | 0 | return ( split /::/, $self->meta->name )[-1], | |||||||||
| 45 | } | ||||||||||
| 46 | |||||||||||
| 47 | 0 | ▶ | sub stringify { | ||||||||
|
Subroutine
stringify: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 48 | 0 | my ($self) = @_; | |||||||||
| 49 | 0 | return $self->name; | |||||||||
| 50 | } | ||||||||||
| 51 | |||||||||||
| 52 | 0 | ▶ | sub verify_environment { | ||||||||
|
Subroutine
verify_environment: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||
| 53 | 0 | my ($self) = @_; | |||||||||
| 54 | |||||||||||
| 55 | 0 | for my $tool ($self->tools_list) { | |||||||||
| 56 | 0 | ▶ | if ( !-x $tool ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 57 | 0 | die "Cannot find $tool\n"; | |||||||||
| 58 | } | ||||||||||
| 59 | } | ||||||||||
| 60 | |||||||||||
| 61 | 0 | return 1; | |||||||||
| 62 | } | ||||||||||
| 63 | |||||||||||
| 64 | 1 | 1; | |||||||||
| 65 | __END__ | ||||||||||