File Coverage

blib/lib/App/hopen/G/FilesCmd.pm
Criterion Covered Total %
statement 26 27 96.3
branch n/a
condition n/a
subroutine 8 8 100.0
pod n/a
total 34 35 97.1


line stmt bran cond sub pod time code
1             # App::hopen::G::FilesCmd - Cmd that outputs a list of files.
2             package App::hopen::G::FilesCmd;
3 2     2   14 use Data::Hopen;
  2         4  
  2         113  
4 2     2   11 use strict; use warnings;
  2     2   4  
  2         50  
  2         12  
  2         4  
  2         56  
5 2     2   11 use Data::Hopen::Base;
  2         4  
  2         22  
6              
7             our $VERSION = '0.000012'; # TRIAL
8              
9 2     2   2638 use parent 'App::hopen::G::Cmd';
  2         6  
  2         10  
10             use Class::Tiny {
11 0         0 files => sub { [] },
12 2     2   166 };
  2         6  
  2         18  
13              
14 2     2   959 use App::hopen::Asset;
  2         5  
  2         287  
15              
16             # Docs {{{1
17              
18             =head1 NAME
19              
20             Data::Hopen::G::FilesCmd - Cmd that holds a list of files.
21              
22             =head1 SYNOPSIS
23              
24             my $node = Data::Hopen::G::FilesCmd(files=>['foo.c'], name=>'foo node');
25              
26             Used by L<Data::Hopen::H/files>.
27              
28             =head1 ATTRIBUTES
29              
30             =head2 files
31              
32             The files that this Cmd outputs. Intended to be L<App::hopen::Util::BasedPath>
33             instances.
34              
35             =head1 FUNCTIONS
36              
37             =cut
38              
39             # }}}1
40              
41             =head2 _run
42              
43             Create L<App::hopen::Asset>s for the listed files and add them to the
44             generator's asset graph.
45             See L<Data::Hopen::Conventions/INTERNALS>.
46              
47             =cut
48              
49             sub _run {
50 3     3   1056 my ($self, %args) = getparameters('self', [qw(phase visitor ; *)], @_);
51              
52 3         241 my @assets = $self->make(@{$self->files});
  3         63  
53 3         34 $args{visitor}->asset($_) foreach @assets;
54              
55 3         14 return {};
56             } #run()
57              
58             1;
59             __END__
60             # vi: set fdm=marker: #