line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Sweet::Home; |
2
|
1
|
|
|
1
|
|
4569646
|
use strict; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
55
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
75
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.05'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
1; |
8
|
|
|
|
|
|
|
__END__ |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Sweet::Home - Dir, File, HomeDir, and other sweet classes |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=begin HTML |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
<p><a href="https://metacpan.org/pod/Sweet::Home" target="_blank"><img alt="CPAN version" src="https://badge.fury.io/pl/Sweet-Home.svg"></a> <a href="https://travis-ci.org/fibo/Sweet-Home-pm" target="_blank"><img alt="Build Status" src="https://travis-ci.org/fibo/Sweet-Home-pm.svg?branch=master"></a></p> |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=end HTML |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 SYNOPSIS |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
use Sweet::Dir; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
my $dir = Sweet::Dir->new(path => '/path/to/mydir'); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
$dir->is_a_directory or $dir->create; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
my $dir2 = $dir->sub_dir('foo'); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
$dir2->create; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
say $dir2; # /path/to/mydir/foo |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
my $file = $dir2->file('bar'); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
say $file; # /path/to/mydir/foo/bar |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 DESCRIPTION |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
Nothing is better than feel at home. Where is the home? The home is where I can feel comfortable (cit. Jovanotti). |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
This package provides a set of features to make you feel comfortable when working with files and folders. |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
It is just syntactic sugar on top of packages like L<File::Basename>, L<File::Copy>, L<File::HomeDir>, L<File::Path>, L<File::Remove>, L<File::Spec>, etc. |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 SUGAR ADDED |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Perl version greater than C<v5.12> is supported. |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
File encoding defaults to utf8. |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 CODE COVERAGE |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Code coverage metrics report available L<here|http://g14n.info/Sweet-Home-pm/code/coverage.html> |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 CLASSES |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=over 4 |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=item L<Sweet::Dir> |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=item L<Sweet::File> |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=item L<Sweet::File::DSV> |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=item L<Sweet::File::CSV> |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=item L<Sweet::HomeDir> |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=item L<Sweet::SFTP> |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=back |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=begin HTML |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
<img src="http://g14n.info/Sweet-Home-pm/dia/Sweet-Home.svg" alt="Class diagram" /> |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=end HTML |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
This software is copyright (c) 2014 by G. Casati. |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=cut |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
|