blib/lib/Test/File/ShareDir/Object/Dist.pm

filter: Statementstmt 91.8% 45 / 49 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 88.2% 15 / 17 Podpod 100% 8 / 8 totaltotal 91.8% 68 / 74 CC 2 SCAR 2.0
CC
2
Cov
92%
__ANON__
2.0
install_all_dists
2.0
add_to_inc
2.0
CRAP 1.2
« lib/Test/File/ShareDir/Object/Inc.pm ↑ Summary lib/Test/File/ShareDir/Object/Module.pm »
1 3 ▶use 5.006; # pragmas
Subroutine BEGIN: called CC=1 SCAR=0.0
2 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 package Test::File::ShareDir::Object::Dist;
6  
7 3 our $VERSION = '1.001002';
8  
9 # ABSTRACT: Object Oriented ShareDir creation for distributions
10  
11 3 our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25 3 ▶use Class::Tiny {
Subroutine BEGIN: called CC=1 SCAR=0.0
26 2 ▶ inc => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
27 2 require Test::File::ShareDir::Object::Inc;
28 2 return Test::File::ShareDir::Object::Inc->new();
29 },
30 0 ▶ dists => sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
31 0 return {};
32 },
33 1 ▶ root => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
34 1 require Path::Tiny;
35 1 return Path::Tiny::path(q[./])->absolute;
36 },
37 3 };
38  
39 3 ▶use Carp qw( carp );
Subroutine BEGIN: called CC=1 SCAR=0.0
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59 2 ▶sub __rcopy { require File::Copy::Recursive; goto \&File::Copy::Recursive::rcopy; }
Subroutine __rcopy: called CC=1 SCAR=0.0
60  
61  
62  
63  
64  
65  
66  
67  
68  
69 2 ▶sub dist_names {
Subroutine dist_names: called CC=1 SCAR=0.0
Pod documented
70 2 my ($self) = @_;
71 2 return keys %{ $self->dists };
72 }
73  
74  
75  
76  
77  
78  
79  
80  
81  
82 2 ▶sub dist_share_target_dir {
Subroutine dist_share_target_dir: called CC=1 SCAR=0.0
Pod documented
83 2 my ( $self, $distname ) = @_;
84 2 return $self->inc->dist_tempdir->child($distname);
85 }
86  
87  
88  
89  
90  
91  
92  
93  
94  
95 2 ▶sub dist_share_source_dir {
Subroutine dist_share_source_dir: called CC=1 SCAR=0.0
Pod documented
96 2 my ( $self, $distname ) = @_;
97 2 require Path::Tiny;
98 2 return Path::Tiny::path( $self->dists->{$distname} )->absolute( $self->root );
99 }
100  
101  
102  
103  
104  
105  
106  
107  
108  
109 2 ▶sub install_dist {
Subroutine install_dist: called CC=1 SCAR=0.0
Pod documented
110 2 my ( $self, $distname ) = @_;
111 2 my $source = $self->dist_share_source_dir($distname);
112 2 my $target = $self->dist_share_target_dir($distname);
113 2 return __rcopy( $source, $target );
114 }
115  
116  
117  
118  
119  
120  
121  
122  
123  
124 2 ▶sub install_all_dists {
Subroutine install_all_dists: called CC=2 SCAR=6.9
Pod documented
125 2 my ($self) = @_;
126 2 for my $dist ( $self->dist_names ) {
127 2 $self->install_dist($dist);
128 }
129 2 return;
130 }
131  
132  
133  
134  
135  
136  
137  
138 0 ▶sub add_to_inc {
Subroutine add_to_inc: not called CC=1 SCAR=6.9
Pod documented
139 0 my ($self) = @_;
140 0 carp 'add_to_inc deprecated since 1.001000, use register';
141 0 return $self->register;
142 }
143  
144  
145  
146  
147  
148  
149  
150  
151  
152  
153  
154 2 ▶sub register {
Subroutine register: called CC=1 SCAR=0.0
Pod documented
155 2 my ($self) = @_;
156 2 $self->inc->register;
157 2 return;
158 }
159  
160  
161  
162  
163  
164  
165  
166  
167  
168  
169  
170 1 ▶sub clear {
Subroutine clear: called CC=1 SCAR=0.0
Pod documented
171 1 my ($self) = @_;
172 1 $self->inc->clear;
173 1 return;
174 }
175  
176 3 1;
177  
178 __END__
« lib/Test/File/ShareDir/Object/Inc.pm ↑ Summary lib/Test/File/ShareDir/Object/Module.pm »