File Coverage

blib/lib/App/hopen/G/FilesCmd.pm
Criterion Covered Total %
statement 20 21 95.2
branch n/a
condition n/a
subroutine 6 6 100.0
pod n/a
total 26 27 96.3


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 1     1   18 use Data::Hopen;
  1         5  
  1         56  
4 1     1   7 use Data::Hopen::Base;
  1         3  
  1         5  
5              
6             our $VERSION = '0.000010';
7              
8 1     1   1341 use parent 'App::hopen::G::Cmd';
  1         2  
  1         5  
9             use Class::Tiny {
10 0         0 files => sub { [] },
11 1     1   86 };
  1         2  
  1         33  
12              
13 1     1   735 use App::hopen::Asset;
  1         3  
  1         137  
14              
15             # Docs {{{1
16              
17             =head1 NAME
18              
19             Data::Hopen::G::FilesCmd - Cmd that holds a list of files.
20              
21             =head1 SYNOPSIS
22              
23             my $node = Data::Hopen::G::FilesCmd(files=>['foo.c'], name=>'foo node');
24              
25             Used by L<Data::Hopen::H/files>.
26              
27             =head1 FUNCTIONS
28              
29             =cut
30              
31             # }}}1
32              
33             =head2 _run
34              
35             Create L<App::hopen::Asset>s for the listed files and add them to the
36             generator's asset graph.
37             See L<Data::Hopen::Conventions/INTERNALS>.
38              
39             =cut
40              
41             sub _run {
42 1     1   402 my ($self, %args) = getparameters('self', [qw(phase visitor ; *)], @_);
43              
44 1         87 my @assets = $self->make(@{$self->files});
  1         24  
45 1         11 $args{visitor}->asset($_) foreach @assets;
46              
47 1         6 return {};
48             } #run()
49              
50             1;
51             __END__
52             # vi: set fdm=marker: #