blib/lib/App/hopen/H.pm

filter: Statementstmt 100% 53 / 53 Branchbran n/a Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 15 / 15 Podpod 100% 1 / 1 totaltotal 97.2% 70 / 72 CC 2 SCAR 1.2
CC
2
Cov
98%
files
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« blib/lib/App/hopen/T/Gnu/C/CompileCmd.pm ↑ Summary eg/001-single-file-hello/001.hopen.pl »
1 # App::hopen::H - H:: namespace for use in hopen files
2 package App::hopen::H;
3 2 ▶use strict; use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use Data::Hopen::Base;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 our $VERSION = '0.000013'; # TRIAL
7  
8 2 ▶use parent 'Exporter';
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use vars::i '@EXPORT' => [];
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use vars::i '@EXPORT_OK' => qw(files);
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 use vars::i '%EXPORT_TAGS' => (
12 default => [@EXPORT],
13 all => [@EXPORT, @EXPORT_OK]
14 2 ▶ );
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 2 ▶use App::hopen::BuildSystemGlobals;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 2 ▶use App::hopen::G::FilesCmd;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 2 ▶use App::hopen::Util::BasedPath;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 2 ▶use Data::Hopen qw(hlog getparameters);
Subroutine BEGIN: called CC=1 SCAR=0.0
20 2 ▶use Data::Hopen::G::GraphBuilder;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 2 ▶use Data::Hopen::Util::Data qw(forward_opts);
Subroutine BEGIN: called CC=1 SCAR=0.0
22 2 ▶use Path::Class;
Subroutine BEGIN: called CC=1 SCAR=0.0
23  
24 # Docs {{{1
25  
26 =head1 NAME
27  
28 App::hopen::H - H:: namespace for use in hopen files
29  
30 =head1 SYNOPSIS
31  
32 This module is loaded as C<H::*> into hopen files by
33 L<App::hopen::HopenFileKit>.
34  
35 =head1 FUNCTIONS
36  
37 =cut
38  
39 # }}}1
40  
41 =head2 files
42  
43 Creates a command-graph node representing a set of input files.
44 Example usage:
45  
46 $Build->H::files('foo.c')->C::compile->C::link('foo')->default_goal;
47  
48 The node is an L<App::hopen::G::FilesCmd>.
49  
50 The file path is assumed to be relative to the current project directory.
51 TODO handle subdirectories.
52  
53 Adds each specified file as a separate node in the asset graph.
54  
55 =cut
56  
57 sub files {
58 4 ▶ my ($builder, %args) = getparameters('self', ['*'], @_);
Subroutine files: called CC=2 SCAR=7.0
Pod documented
59 4 hlog { __PACKAGE__, 'files:', Dumper(\%args) } 3;
60 4 ▶ my $lrFiles = $args{'*'} // [];
Condition50%1/2
$args{"*"} // []
l!l
40
MC/DC0%0/1
$args{"*"} // []
$args{"*"}
Truth table50%1/2
A
A= $args{"*"}
Aresult
11
00
61 4 my @files = map { based_path(path => file($_), base => $ProjDir) } @$lrFiles;
62 4 hlog { __PACKAGE__, 'file objects:', @files } 3;
63 4 my $files_op = App::hopen::G::FilesCmd->new(
64 files => [ @files ],
65 forward_opts(\%args, 'name')
66 );
67  
68 4 return $files_op;
69 } #files()
70  
71 2 make_GraphBuilder 'files';
72  
73 2 1;
74 __END__
75 # vi: set fdm=marker: #
« blib/lib/App/hopen/T/Gnu/C/CompileCmd.pm ↑ Summary eg/001-single-file-hello/001.hopen.pl »