File Coverage

blib/lib/Dist/Zilla/MintingProfile/ACPS.pm
Criterion Covered Total %
statement 1 3 33.3
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 2 4 50.0


line stmt bran cond sub pod time code
1             package Dist::Zilla::MintingProfile::ACPS;
2              
3 1     1   1454 use Moose;
  0            
  0            
4             use v5.10;
5             use File::HomeDir;
6             use File::Spec;
7             use Dist::Zilla::PluginBundle::ACPS;
8              
9             # ABSTRACT: ACPS Dist::Zilla minting profile
10             our $VERSION = '0.30'; # VERSION
11              
12             with qw( Dist::Zilla::Role::MintingProfile );
13              
14             my $prep = sub {
15             use autodie;
16              
17             my $dzil_dir = File::Spec->catdir(File::HomeDir->my_home, '.dzil');
18             my $dzil_ini = File::Spec->catfile(File::HomeDir->my_home, '.dzil', 'config.ini');
19              
20             mkdir $dzil_dir unless -d $dzil_dir;
21             unless(-e $dzil_ini)
22             {
23              
24             my($user, $name) = eval { (getpwnam($ENV{USER} // $ENV{USERNAME}))[0,6] };
25              
26             warn "unable to determine user name: $@" if $@;
27              
28             $user //= "user";
29             $name //= "User Name";
30              
31             my $email = "$user\@sesda2.com";
32              
33             print "creating $dzil_ini with default settings (you may want to edit this to change defaults)";
34             open my $fp, '>', $dzil_ini;
35             say $fp "[%User]";
36             say $fp "name = $name";
37             say $fp "email = $email";
38             say $fp "";
39             say $fp "[%Rights]";
40             say $fp "license_class = None";
41             say $fp "copyright_holder = NASA GSFC";
42             close $fp;
43             }
44             };
45              
46             sub profile_dir
47             {
48             my($self, $name) = @_;
49             $prep->();
50             Dist::Zilla::PluginBundle::ACPS
51             ->share_dir
52             ->subdir('profiles')
53             ->subdir($name);
54             }
55              
56             no Moose;
57             __PACKAGE__->meta->make_immutable;
58              
59             1;
60              
61              
62              
63             =pod
64              
65             =head1 NAME
66              
67             Dist::Zilla::MintingProfile::ACPS - ACPS Dist::Zilla minting profile
68              
69             =head1 VERSION
70              
71             version 0.30
72              
73             =head1 SYNOPSIS
74              
75             % dzil new -P ACPS Hello::World
76              
77             =head1 DESCRIPTION
78              
79             Minting profile for ACPS.
80              
81             =head1 AUTHOR
82              
83             Graham Ollis <gollis@sesda3.com>
84              
85             =head1 COPYRIGHT AND LICENSE
86              
87             This software is copyright (c) 2012 by NASA GSFC.
88              
89             This is free software; you can redistribute it and/or modify it under
90             the same terms as the Perl 5 programming language system itself.
91              
92             =cut
93              
94              
95             __END__
96