File Coverage

blib/lib/ExtUtils/XSpp/Node/File.pm
Criterion Covered Total %
statement 14 14 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 3 3 100.0
total 23 23 100.0


line stmt bran cond sub pod time code
1             package ExtUtils::XSpp::Node::File;
2 21     21   107 use strict;
  21         32  
  21         680  
3 21     21   66 use warnings;
  21         26  
  21         751  
4 21     21   70 use base 'ExtUtils::XSpp::Node';
  21         30  
  21         471  
5              
6             =head1 NAME
7              
8             ExtUtils::XSpp::Node::File - Directive that sets the name of the output file
9              
10             =head1 DESCRIPTION
11              
12             An L subclass representing a directive to change the
13             name of the output file:
14              
15             %file{file/to/write/to.xs}
16            
17             A special case is
18              
19             %file{-}
20            
21             which indicates that output should be written to STDOUT.
22              
23             =head1 METHODS
24              
25             =head2 new
26              
27             Creates a new C.
28              
29             Named parameters: C, the path to the file
30             that should be written to (or '-').
31              
32             =cut
33              
34             sub init {
35 8     8 1 10 my $this = shift;
36 8         17 my %args = @_;
37              
38 8         31 $this->{FILE} = $args{file};
39             }
40              
41             =head1 ACCESSORS
42              
43             =head2 file
44              
45             Returns the path of the file to write to (or C<-> for STDOUT).
46              
47             =cut
48              
49 8     8 1 13 sub file { $_[0]->{FILE} }
50 8     8 1 18 sub print { return '' }
51              
52             1;