File Coverage

blib/lib/Dist/Zilla/Plugin/Author/Plicease.pm
Criterion Covered Total %
statement 20 24 83.3
branch 1 6 16.6
condition 0 3 0.0
subroutine 7 8 87.5
pod 2 2 100.0
total 30 43 69.7


line stmt bran cond sub pod time code
1             package Dist::Zilla::Plugin::Author::Plicease 2.75 {
2              
3 3     3   271348 use strict;
  3         11  
  3         103  
4 3     3   20 use warnings;
  3         22  
  3         81  
5 3     3   75 use 5.020;
  3         11  
6 3     3   1954 use Path::Tiny ();
  3         13361  
  3         80  
7 3     3   1107 use File::ShareDir::Dist ();
  3         2024  
  3         66  
8 3     3   1500 use File::Which ();
  3         3207  
  3         539  
9              
10             # ABSTRACT: Dist::Zilla plugins used by Plicease
11              
12              
13             sub dist_dir
14             {
15 3     3 1 4977661 my $file = Path::Tiny->new(__FILE__);
16 3 50       185 if($file->is_absolute)
17             {
18 3         194 return Path::Tiny->new(
19             File::ShareDir::Dist::dist_share('Dist-Zilla-PluginBundle-Author-Plicease')
20             );
21             }
22             else
23             {
24 0           my $share = $file
25             ->absolute
26             ->parent
27             ->parent
28             ->parent
29             ->parent
30             ->parent
31             ->parent
32             ->child('share');
33 0 0         die "no share $share" unless -d $share;
34 0           return $share;
35             }
36             }
37              
38              
39             sub git
40             {
41 0 0 0 0 1   File::Which::which('git') && eval { require Dist::Zilla::Plugin::Git; 1 } ? 1 : 0
42             }
43             }
44              
45             1;
46              
47             __END__
48              
49             =pod
50              
51             =encoding UTF-8
52              
53             =head1 NAME
54              
55             Dist::Zilla::Plugin::Author::Plicease - Dist::Zilla plugins used by Plicease
56              
57             =head1 VERSION
58              
59             version 2.75
60              
61             =head1 DESCRIPTION
62              
63             The modules in this namespace contain some miscellaneous L<Dist::Zilla>
64             plugins that I use to customize my personal L<Dist::Zilla> experience.
65             Most likely you don't want or need to use them. If you do run into
66             one of my distributions my L<Dist::Zilla> bundle includes documentation
67             that may be able to help:
68              
69             L<Dist::Zilla::PluginBundle::Author::Plicease>
70              
71             =head1 METHODS
72              
73             =head2 dist_dir
74              
75             my $dir = Dist::Zilla::Plugin::Author::Plicease->dist_dir;
76              
77             Returns this distributions share directory.
78              
79             =head2 git
80              
81             my $bool = Dist::Zilla::Plugin::Author::Plicease->git;
82              
83             Returns true if C<git> and the Git plugins are installed.
84              
85             =head1 AUTHOR
86              
87             Graham Ollis <plicease@cpan.org>
88              
89             =head1 COPYRIGHT AND LICENSE
90              
91             This software is copyright (c) 2012-2022 by Graham Ollis.
92              
93             This is free software; you can redistribute it and/or modify it under
94             the same terms as the Perl 5 programming language system itself.
95              
96             =cut