File Coverage

blib/lib/Bundler/MultiGem/Utl/Directories.pm
Criterion Covered Total %
statement 14 20 70.0
branch 0 8 0.0
condition n/a
subroutine 5 7 71.4
pod 0 2 0.0
total 19 37 51.3


line stmt bran cond sub pod time code
1             package Bundler::MultiGem::Utl::Directories;
2              
3 1     1   15 use 5.006;
  1         3  
4 1     1   4 use strict;
  1         2  
  1         15  
5 1     1   4 use warnings;
  1         1  
  1         44  
6              
7             =head1 NAME
8              
9             Bundler::MultiGem::Util::Directories - The great new Bundler::MultiGem::Directories!
10              
11             =head1 VERSION
12              
13             Version 0.01
14              
15             =cut
16              
17             our $VERSION = '0.01';
18              
19 1     1   11 use Exporter qw(import);
  1         2  
  1         45  
20             our @EXPORT = qw(mk_dir rm_dir);
21              
22 1     1   5 use File::Path qw( make_path remove_tree );
  1         1  
  1         161  
23              
24             =head1 SYNOPSIS
25              
26             Quick summary of what the module does.
27              
28             Perhaps a little code snippet.
29              
30             use Bundler::MultiGem::Directories;
31              
32             my $foo = Bundler::MultiGem::Directories->new();
33             ...
34              
35             =head1 EXPORT
36              
37             A list of functions that can be exported. You can delete this section
38             if you don't export anything, such as for a purely object-oriented module.
39              
40             =head1 SUBROUTINES/METHODS
41              
42             =head2 make_dir
43              
44             =cut
45              
46             sub mk_dir {
47 0     0 0   my $dir = shift;
48 0 0         if ( !-d $dir ) {
49 0 0         make_path $dir or die "Failed to create path: ${dir}";
50             }
51             }
52              
53             =head2 rm_{dir}
54              
55             =cut
56              
57             sub rm_dir {
58 0     0 0   my $dir = shift;
59 0 0         if ( -d $dir ) {
60 0 0         remove_tree $dir or die "Failed to remove path: ${dir}";
61             }
62             }
63              
64             =head1 AUTHOR
65              
66             Mauro Berlanda, C<< >>
67              
68             =head1 BUGS
69              
70             Please report any bugs or feature requests to C, or through
71             the web interface at L. I will be notified, and then you'll
72             automatically be notified of progress on your bug as I make changes.
73              
74              
75              
76              
77             =head1 SUPPORT
78              
79             You can find documentation for this module with the perldoc command.
80              
81             perldoc Bundler::MultiGem::Directories
82              
83              
84             You can also look for information at:
85              
86             =over 4
87              
88             =item * RT: CPAN's request tracker (report bugs here)
89              
90             L
91              
92             =item * AnnoCPAN: Annotated CPAN documentation
93              
94             L
95              
96             =item * CPAN Ratings
97              
98             L
99              
100             =item * Search CPAN
101              
102             L
103              
104             =back
105              
106              
107             =head1 ACKNOWLEDGEMENTS
108              
109              
110             =head1 LICENSE AND COPYRIGHT
111              
112             Copyright 2018 Mauro Berlanda.
113              
114             This program is free software; you can redistribute it and/or modify it
115             under the terms of the the Artistic License (2.0). You may obtain a
116             copy of the full license at:
117              
118             L
119              
120             Any use, modification, and distribution of the Standard or Modified
121             Versions is governed by this Artistic License. By using, modifying or
122             distributing the Package, you accept this license. Do not use, modify,
123             or distribute the Package, if you do not accept this license.
124              
125             If your Modified Version has been derived from a Modified Version made
126             by someone other than you, you are nevertheless required to ensure that
127             your Modified Version complies with the requirements of this license.
128              
129             This license does not grant you the right to use any trademark, service
130             mark, tradename, or logo of the Copyright Holder.
131              
132             This license includes the non-exclusive, worldwide, free-of-charge
133             patent license to make, have made, use, offer to sell, sell, import and
134             otherwise transfer the Package with respect to any patent claims
135             licensable by the Copyright Holder that are necessarily infringed by the
136             Package. If you institute patent litigation (including a cross-claim or
137             counterclaim) against any party alleging that the Package constitutes
138             direct or contributory patent infringement, then this Artistic License
139             to you shall terminate on the date that such litigation is filed.
140              
141             Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER
142             AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
143             THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
144             PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY
145             YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR
146             CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR
147             CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE,
148             EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
149              
150              
151             =cut
152              
153             1; # End of Bundler::MultiGem::Directories