App/Command/mkrpmspec.pm untested

filter: Statementstmt 0.0% 0 / 34 Branchbran n/a Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 46 CC 1 SCAR 6.9
CC
1
Cov
0%
abstract
2.0
execute
2.0
BEGIN
2.0
CRAP 2.0
1 package Dist::Zilla::App::Command::mkrpmspec;
2 # ABSTRACT: generate RPM spec file from your template
3  
4 use strict;
5 use warnings;
6 use Carp;
7  
8 use Dist::Zilla::App -command;
9  
10 our $VERSION = '0.016'; # VERSION
11  
12 sub abstract { 'generate RPM spec file from your build template' }
13  
14 sub execute {
15 my($self,$opt,$args) = @_;
16 my($filename) = @{$args};
17 $filename ||= 'dzil.spec';
18  
19 require Path::Class;
20  
21 $_->before_build for @{ $self->zilla->plugins_with(-BeforeBuild) };
22 $_->gather_files for @{ $self->zilla->plugins_with(-FileGatherer) };
23 $_->prune_files for @{ $self->zilla->plugins_with(-FilePruner) };
24 $_->register_prereqs for @{ $self->zilla->plugins_with(-PrereqSource) };
25  
26 my $outfile = Path::Class::File->new($filename);
27 my $out = $outfile->openw;
28 print $out $self->zilla->plugin_named('RPM')->mk_spec(
29 sprintf('%s-%s.tar.gz',$self->zilla->name,$self->zilla->version)
30 );
31  
32 $self->log("spec file written to $outfile");
33 }
34  
35 1;
36  
37 __END__