Hopen/G/Goal.pm

filter: Statementstmt 95.6% 22 / 23 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 87.5% 7 / 8 Podpod 100% 1 / 1 totaltotal 91.1% 31 / 34 CC 2 SCAR 2.2
CC
2
Cov
92%
BUILD
2.1
__ANON__
1.1
_run
1.0
CRAP 1.3
« Hopen/Base.pm ↑ Summary Hopen/G/Link.pm »
1 # Build::Hopen::G::Goal - A named build goal
2 package Build::Hopen::G::Goal;
3 3 ▶use Build::Hopen;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use Build::Hopen::Base;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 3 our $VERSION = '0.000008'; # TRIAL
7  
8 3 ▶use parent 'Build::Hopen::G::Op';
Subroutine BEGIN: called CC=1 SCAR=0.0
9 #use Class::Tiny qw(_passthrough);
10  
11 3 ▶use Build::Hopen::Arrrgs;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 3 ▶use Build::Hopen::Util::Data qw(forward_opts);
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 # Docs {{{1
15  
16 =head1 NAME
17  
18 Build::Hopen::G::Goal - a named goal in a hopen build
19  
20 =head1 SYNOPSIS
21  
22 A C<Goal> is a named build target, e.g., C<doc> or C<dist>. The name C<all>
23 is reserved for the root goal. Goals usually appear at the end of the build
24 graph, but this is not required --- Goal nodes can appear anywhere in the
25 graph.
26  
27 =head1 FUNCTIONS
28  
29 =head2 run
30  
31 Wraps a L<Build::Hopen::G::CollectOp>'s run function.
32  
33 =cut
34  
35 # }}}1
36  
37 1 ▶sub _run {
Subroutine _run: called CC=1 SCAR=0.2
38 1 my ($self, %args) = parameters('self', [qw(; phase generator)], @_);
39 0 ▶ hlog { Goal => $self->name };
Subroutine __ANON__: not called CC=1 SCAR=1.2
40 1 return $self->passthrough(-nocontext=>1, -levels => 'local',
41 forward_opts(\%args, {'-'=>1}, qw[phase generator]));
42 } #_run()
43  
44 =head2 BUILD
45  
46 Enforce the requirement for a user-specified name.
47  
48 =cut
49  
50 4 ▶sub BUILD {
Subroutine BUILD: called CC=2 SCAR=7.2
Pod documented
51 4 my ($self, $args) = @_;
52 4 ▶ croak 'Goals must have names' unless $args->{name};
Branch: 1 branch
BranchTrueFalseTotal
unless $args->{"name"} 0 4 4
53 } #BUILD()
54  
55 3 1;
56 __END__
« Hopen/Base.pm ↑ Summary Hopen/G/Link.pm »