Dist/Zilla/Plugin/ATOOMIC/License.pm untested

filter: Statementstmt 0.0% 0 / 39 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 9 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 57 CC 2 SCAR 10.3
CC
2
Cov
0%
provide_license
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.8
1 package Dist::Zilla::Plugin::ATOOMIC::License;
2  
3 use v5.10;
4  
5 use strict;
6 use warnings;
7 use autodie;
8 use namespace::autoclean;
9  
10 our $VERSION = '1.00';
11  
12 use Module::Runtime qw( use_module );
13 use String::RewritePrefix;
14  
15 use Moose;
16  
17 with 'Dist::Zilla::Role::LicenseProvider';
18  
19 sub provide_license {
20 my $self = shift;
21 my $args = shift;
22  
23 my $year = $args->{copyright_year};
24 my $this_year = (localtime)[5] + 1900;
25 my $years = $year == $this_year ? $year : "$year - $this_year";
26  
27 my $license_class = String::RewritePrefix->rewrite(
28 {
29 '=' => q{},
30 q{} => 'Software::License::'
31 },
32 $self->zilla()->_license_class() // 'Artistic_2_0',
33 );
34  
35 use_module($license_class);
36  
37 return $license_class->new(
38 {
39 holder => $args->{copyright_holder} || 'David Rolsky',
40 year => $years,
41 },
42 );
43 }
44  
45 __PACKAGE__->meta->make_immutable;
46  
47 1;
48  
49 # ABSTRACT: Sets up default license and copyright holder
50  
51 __END__