lib/CPANPLUS/Internals.pm

filter: Statementstmt 92.5% 175 / 189 Branchbran 69.3% 43 / 62 Conditioncond 45.4% 5 / 11 MC/DCmcdc 0.0% 0 / 6 Subroutinesub 100% 36 / 36 Podpod n/a totaltotal 85.2% 259 / 304 SCAR 38.4
CC
41
Cov
85%
_init
17.0
_flush
13.2
_add_to_path
6.0
CRAP 46.5
« lib/CPANPLUS/Selfupdate.pm ↑ Summary blib/lib/CPANPLUS.pm »
1 package CPANPLUS::Internals;
2  
3 ### we /need/ perl5.6.1 or higher -- we use coderefs in @INC,
4 ### and 5.6.0 is just too buggy
5 20 ▶use 5.006001;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 20 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 20 ▶use Config;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 20 ▶use CPANPLUS::Error;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 20 ▶use CPANPLUS::Selfupdate;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 20 ▶use CPANPLUS::Internals::Extract;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 20 ▶use CPANPLUS::Internals::Fetch;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 20 ▶use CPANPLUS::Internals::Utils;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 20 ▶use CPANPLUS::Internals::Constants;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 20 ▶use CPANPLUS::Internals::Search;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 20 ▶use CPANPLUS::Internals::Report;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 20 require base;
22 20 ▶use Cwd qw[cwd];
Subroutine BEGIN: called CC=1 SCAR=0.0
23 20 ▶use Module::Load qw[load];
Subroutine BEGIN: called CC=1 SCAR=0.0
24 20 ▶use Params::Check qw[check];
Subroutine BEGIN: called CC=1 SCAR=0.0
25 20 ▶use Locale::Maketext::Simple Class => 'CPANPLUS', Style => 'gettext';
Subroutine BEGIN: called CC=1 SCAR=0.0
26 20 ▶use Module::Load::Conditional qw[can_load];
Subroutine BEGIN: called CC=1 SCAR=0.0
27  
28 20 ▶use Object::Accessor;
Subroutine BEGIN: called CC=1 SCAR=0.0
29  
30 20 local $Params::Check::VERBOSE = 1;
31  
32 20 ▶use vars qw[@ISA $VERSION];
Subroutine BEGIN: called CC=1 SCAR=0.0
33  
34 20 @ISA = qw[
35 CPANPLUS::Internals::Extract
36 CPANPLUS::Internals::Fetch
37 CPANPLUS::Internals::Utils
38 CPANPLUS::Internals::Search
39 CPANPLUS::Internals::Report
40 ];
41  
42 20 $VERSION = "0.9912";
43  
44 =pod
45  
46 =head1 NAME
47  
48 CPANPLUS::Internals - CPANPLUS internals
49  
50 =head1 SYNOPSIS
51  
52 my $internals = CPANPLUS::Internals->_init( _conf => $conf );
53 my $backend = CPANPLUS::Internals->_retrieve_id( $ID );
54  
55 =head1 DESCRIPTION
56  
57 This module is the guts of CPANPLUS -- it inherits from all other
58 modules in the CPANPLUS::Internals::* namespace, thus defying normal
59 rules of OO programming -- but if you're reading this, you already
60 know what's going on ;)
61  
62 Please read the C<CPANPLUS::Backend> documentation for the normal API.
63  
64 =head1 ACCESSORS
65  
66 =over 4
67  
68 =item _conf
69  
70 Get/set the configure object
71  
72 =item _id
73  
74 Get/set the id
75  
76 =cut
77  
78 ### autogenerate accessors ###
79 20 for my $key ( qw[_conf _id _modules _hosts _methods _status _path
80 _callbacks _selfupdate _mtree _atree]
81 ) {
82 20 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
83 220 *{__PACKAGE__."::$key"} = sub {
84 12957 ▶ $_[0]->{$key} = $_[1] if @_ > 1;
Subroutine __ANON__: called CC=2 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
if @_ > 1 81 12876 12957
85 12957 return $_[0]->{$key};
86 }
87 220 }
88  
89 =pod
90  
91 =back
92  
93 =head1 METHODS
94  
95 =head2 $internals = CPANPLUS::Internals->_init( _conf => CONFIG_OBJ )
96  
97 C<_init> creates a new CPANPLUS::Internals object.
98  
99 You have to pass it a valid C<CPANPLUS::Configure> object.
100  
101 Returns the object on success, or dies on failure.
102  
103 =cut
104  
105 { ### NOTE:
106 ### if extra callbacks are added, don't forget to update the
107 ### 02-internals.t test script with them!
108 my $callback_map = {
109 ### name default value
110 install_prerequisite => 1, # install prereqs when 'ask' is set?
111 edit_test_report => 0, # edit the prepared test report?
112 send_test_report => 1, # send the test report?
113 # munge the test report
114 2 ▶ munge_test_report => sub { return $_[1] },
Subroutine __ANON__: called CC=1 SCAR=0.0
115 # filter out unwanted prereqs
116 4 ▶ filter_prereqs => sub { return $_[1] },
Subroutine __ANON__: called CC=1 SCAR=0.0
117 # continue if 'make test' fails?
118 1 ▶ proceed_on_test_failure => sub { return 0 },
Subroutine __ANON__: called CC=1 SCAR=0.0
119 1 ▶ munge_dist_metafile => sub { return $_[1] },
Subroutine __ANON__: called CC=1 SCAR=0.0
120 20 };
121  
122 20 my $status = Object::Accessor->new;
123 20 $status->mk_accessors(qw[pending_prereqs]);
124  
125 20 my $callback = Object::Accessor->new;
126 20 $callback->mk_accessors(keys %$callback_map);
127  
128 20 my $conf;
129 my $Tmpl = {
130 _conf => { required => 1, store => \$conf,
131 allow => IS_CONFOBJ },
132 _id => { default => '', no_override => 1 },
133 _authortree => { default => '', no_override => 1 },
134 _modtree => { default => '', no_override => 1 },
135 _hosts => { default => {}, no_override => 1 },
136 _methods => { default => {}, no_override => 1 },
137 _status => { default => '<empty>', no_override => 1 },
138 _callbacks => { default => '<empty>', no_override => 1 },
139 20 ▶ _path => { default => $ENV{PATH} || '', no_override => 1 },
Condition50%1/2
$ENV{'PATH'} || ''
l!l
200
MC/DC0%0/1
$ENV{'PATH'} || ''
$ENV{'PATH'}
Truth table50%1/2
A
A= $ENV{'PATH'}
Aresult
11
00
140 };
141  
142 sub _init {
143 14 ▶ my $class = shift;
Subroutine _init: called CC=12 SCAR=28.4
144 14 my %hash = @_;
145  
146 ### temporary warning until we fix the storing of multiple id's
147 ### and their serialization:
148 ### probably not going to happen --kane
149 14 ▶ if( my $id = $class->_last_id ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $id = $class->_last_id) 0 14 14
150 # make it a singleton.
151 0 warn loc(q[%1 currently only supports one %2 object per ] .
152 qq[running program\n], 'CPANPLUS', $class);
153  
154 0 return $class->_retrieve_id( $id );
155 }
156  
157 14 ▶ my $args = check($Tmpl, \%hash)
Branch: 1 branch
BranchTrueFalseTotal
my $args = check($Tmpl, \%hash) or die loc("Could not initialize '%1' object", $class) 0 14 14
158 or die loc(qq[Could not initialize '%1' object], $class);
159  
160 14 bless $args, $class;
161  
162 14 $args->{'_id'} = $args->_inc_id;
163 14 $args->{'_status'} = $status;
164 14 $args->{'_callbacks'} = $callback;
165  
166 ### initialize callbacks to default state ###
167 14 for my $name ( $callback->ls_accessors ) {
168 my $rv = ref $callback_map->{$name} ? 'sub return value' :
169 98 ▶ $callback_map->{$name} ? 'true' : 'false';
Branch: 2 branches
BranchTrueFalseTotal
ref $callback_map->{$name} ? : 56 42 98
$callback_map->{$name} ? : 28 14 42
170  
171 $args->_callbacks->$name(
172 16 ▶ sub { msg(loc("DEFAULT '%1' HANDLER RETURNING '%2'",
Subroutine __ANON__: called CC=2 SCAR=6.9
173 $name, $rv), $args->_conf->get_conf('debug'));
174 return ref $callback_map->{$name}
175 ? $callback_map->{$name}->( @_ )
176 16 ▶ : $callback_map->{$name};
Branch: 1 branch
BranchTrueFalseTotal
ref $callback_map->{$name} ? : 8 8 16
177 }
178 98 );
179 }
180  
181 ### create a selfupdate object
182 14 $args->_selfupdate( CPANPLUS::Selfupdate->new( $args ) );
183  
184 ### initialize it as an empty hashref ###
185 14 $args->_status->pending_prereqs( {} );
186  
187 14 ▶ $conf->_set_build( startdir => cwd() ),
Branch: 1 branch
BranchTrueFalseTotal
$conf->_set_build("startdir", cwd()) or error(loc("couldn't locate current dir!")) 0 14 14
188 or error( loc("couldn't locate current dir!") );
189  
190 14 ▶ $ENV{FTP_PASSIVE} = 1, if $conf->get_conf('passive');
Branch: 1 branch
BranchTrueFalseTotal
if $conf->get_conf("passive") 14 0 14
191  
192 14 my $id = $args->_store_id( $args );
193  
194 14 ▶ unless ( $id == $args->_id ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($id == $args->_id) 0 14 14
195 0 error( loc("IDs do not match: %1 != %2. Storage failed!",
196 $id, $args->_id) );
197 }
198  
199 ### different source engines available now, so set them here
200 14 ▶ { my $store = $conf->get_conf( 'source_engine' )
Condition50%1/2
$conf->get_conf('source_engine') || 'CPANPLUS::Internals::Source::Memory'
l!l
140
MC/DC0%0/1
$conf->get_conf('source_engine') || 'CPANPLUS::Internals::Source::Memory'
$conf->get_conf('source_engine')
Truth table50%1/2
A
A= $conf->get_conf('source_engine')
Aresult
11
00
201 || DEFAULT_SOURCE_ENGINE;
202  
203 14 ▶ unless( can_load( modules => { $store => '0.0' }, verbose => 1 ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (can_load('modules', {$store, '0.0'}, 'verbose', 1)) { } 14 0 14
204 0 error( loc( "Could not load source engine '%1'", $store ) );
205  
206 0 ▶ if( $store ne DEFAULT_SOURCE_ENGINE ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($store ne 'CPANPLUS::Internals::Source::Memory') { } 0 0 0
207 0 msg( loc("Falling back to %1", DEFAULT_SOURCE_ENGINE), 1 );
208  
209 0 load DEFAULT_SOURCE_ENGINE;
210  
211 0 base->import( DEFAULT_SOURCE_ENGINE );
212 } else {
213 0 return;
214 }
215 } else {
216 14 base->import( $store );
217 }
218 }
219  
220 14 return $args;
221 }
222  
223 =pod
224  
225 =head2 $bool = $internals->_flush( list => \@caches )
226  
227 Flushes the designated caches from the C<CPANPLUS> object.
228  
229 Returns true on success, false if one or more caches could not be
230 be flushed.
231  
232 =cut
233  
234 sub _flush {
235 9 ▶ my $self = shift;
Subroutine _flush: called CC=12 SCAR=25.8
236 9 my $conf = $self->configure_object;
237 9 my %hash = @_;
238  
239 9 my $aref;
240 9 my $tmpl = {
241 list => { required => 1, default => [],
242 strict_type => 1, store => \$aref },
243 };
244  
245 9 ▶ my $args = check( $tmpl, \%hash ) or return;
Branch: 1 branch
BranchTrueFalseTotal
my $args = check($tmpl, \%hash) or return 0 9 9
246  
247 9 my $flag = 0;
248 9 for my $what (@$aref) {
249 15 my $cache = '_' . $what;
250  
251 ### set the include paths back to their original ###
252 15 ▶ if( $what eq 'lib' ) {
Branch: 4 branches
BranchTrueFalseTotal
if ($what eq 'lib') { } 5 10 15
elsif ($what eq 'modules') { } 2 8 10
elsif ($what eq 'methods') { } 2 6 8
elsif ($what eq 'load') { } 3 3 6
253 5 ▶ $ENV{PERL5LIB} = $conf->_perl5lib || '';
Condition50%1/2
$conf->_perl5lib || ''
l!l
50
MC/DC0%0/1
$conf->_perl5lib || ''
$conf->_perl5lib
Truth table50%1/2
A
A= $conf->_perl5lib
Aresult
11
00
254 5 @INC = @{$conf->_lib};
255 5 ▶ $ENV{PATH} = $self->_path || '';
Condition50%1/2
$self->_path || ''
l!l
50
MC/DC0%0/1
$self->_path || ''
$self->_path
Truth table50%1/2
A
A= $self->_path
Aresult
11
00
256  
257 ### give all modules a new status object -- this is slightly
258 ### costly, but the best way to make sure all statuses are
259 ### forgotten --kane
260 } elsif ( $what eq 'modules' ) {
261 2 for my $modobj ( values %{$self->module_tree} ) {
262  
263 20 $modobj->_flush;
264 }
265  
266 ### blow away the methods cache... currently, that's only
267 ### File::Fetch's method fail list
268 } elsif ( $what eq 'methods' ) {
269  
270 ### still unbelievably p4 :( ###
271 2 $File::Fetch::METHOD_FAIL = $File::Fetch::METHOD_FAIL = {};
272  
273 ### blow away the m::l::c cache, so modules can be (re)loaded
274 ### again if they become available
275 } elsif ( $what eq 'load' ) {
276 3 undef $Module::Load::Conditional::CACHE;
277  
278 } else {
279 3 ▶ unless ( exists $self->{$cache} && exists $Tmpl->{$cache} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->{$cache} and exists $Tmpl->{$cache}) { } 3 0 3
Condition33%1/3
exists $self->{$cache} and exists $Tmpl->{$cache}
!ll&&!rl&&r
003
MC/DC0%0/2
exists $self->{$cache} and exists $Tmpl->{$cache}
exists $self->{$cache} exists $Tmpl->{$cache}
Truth table33%1/3
A and B
A= exists $self->{$cache}B= exists $Tmpl->{$cache}
ABresult
0X0
100
111
280 0 error( loc( "No such cache: '%1'", $what ) );
281 0 $flag++;
282 0 next;
283 } else {
284 3 $self->$cache( {} );
285 }
286 }
287 }
288 9 return !$flag;
289 }
290  
291 ### NOTE:
292 ### if extra callbacks are added, don't forget to update the
293 ### 02-internals.t test script with them!
294  
295 =pod
296  
297 =head2 $bool = $internals->_register_callback( name => CALLBACK_NAME, code => CODEREF );
298  
299 Registers a callback for later use by the internal libraries.
300  
301 Here is a list of the currently used callbacks:
302  
303 =over 4
304  
305 =item install_prerequisite
306  
307 Is called when the user wants to be C<asked> about what to do with
308 prerequisites. Should return a boolean indicating true to install
309 the prerequisite and false to skip it.
310  
311 =item send_test_report
312  
313 Is called when the user should be prompted if he wishes to send the
314 test report. Should return a boolean indicating true to send the
315 test report and false to skip it.
316  
317 =item munge_test_report
318  
319 Is called when the test report message has been composed, giving
320 the user a chance to programmatically alter it. Should return the
321 (munged) message to be sent.
322  
323 =item edit_test_report
324  
325 Is called when the user should be prompted to edit test reports
326 about to be sent out by Test::Reporter. Should return a boolean
327 indicating true to edit the test report in an editor and false
328 to skip it.
329  
330 =item proceed_on_test_failure
331  
332 Is called when 'make test' or 'Build test' fails. Should return
333 a boolean indicating whether the install should continue even if
334 the test failed.
335  
336 =item munge_dist_metafile
337  
338 Is called when the C<CPANPLUS::Dist::*> metafile is created, like
339 C<control> for C<CPANPLUS::Dist::Deb>, giving the user a chance to
340 programmatically alter it. Should return the (munged) text to be
341 written to the metafile.
342  
343 =back
344  
345 =cut
346  
347 sub _register_callback {
348 9 ▶ my $self = shift or return;
Subroutine _register_callback: called CC=4 SCAR=14.3
Branch: 1 branch
BranchTrueFalseTotal
my $self = shift() or return 0 9 9
349 9 my %hash = @_;
350  
351 9 my ($name,$code);
352 9 my $tmpl = {
353 name => { required => 1, store => \$name,
354 allow => [$callback->ls_accessors] },
355 code => { required => 1, allow => IS_CODEREF,
356 store => \$code },
357 };
358  
359 9 ▶ check( $tmpl, \%hash ) or return;
Branch: 1 branch
BranchTrueFalseTotal
check($tmpl, \%hash) or return 0 9 9
360  
361 9 ▶ $self->_callbacks->$name( $code ) or return;
Branch: 1 branch
BranchTrueFalseTotal
$self->_callbacks->$name($code) or return 0 9 9
362  
363 9 return 1;
364 }
365  
366 # =head2 $bool = $internals->_add_callback( name => CALLBACK_NAME, code => CODEREF );
367 #
368 # Adds a new callback to be used from anywhere in the system. If the callback
369 # is already known, an error is raised and false is returned. If the callback
370 # is not yet known, it is added, and the corresponding coderef is registered
371 # using the
372 #
373 # =cut
374 #
375 # sub _add_callback {
376 # my $self = shift or return;
377 # my %hash = @_;
378 #
379 # my ($name,$code);
380 # my $tmpl = {
381 # name => { required => 1, store => \$name, },
382 # code => { required => 1, allow => IS_CODEREF,
383 # store => \$code },
384 # };
385 #
386 # check( $tmpl, \%hash ) or return;
387 #
388 # if( $callback->can( $name ) ) {
389 # error(loc("Callback '%1' is already registered"));
390 # return;
391 # }
392 #
393 # $callback->mk_accessor( $name );
394 #
395 # $self->_register_callback( name => $name, code => $code ) or return;
396 #
397 # return 1;
398 # }
399  
400 }
401  
402 =pod
403  
404 =head2 $bool = $internals->_add_to_includepath( directories => \@dirs )
405  
406 Adds a list of directories to the include path.
407 This means they get added to C<@INC> as well as C<$ENV{PERL5LIB}>.
408  
409 Returns true on success, false on failure.
410  
411 =cut
412  
413 20 sub _add_to_includepath {
414 12 ▶ my $self = shift;
Subroutine _add_to_includepath: called CC=5 SCAR=16.1
415 12 my %hash = @_;
416  
417 12 my $dirs;
418 12 my $tmpl = {
419 directories => { required => 1, default => [], store => \$dirs,
420 strict_type => 1 },
421 };
422  
423 12 ▶ check( $tmpl, \%hash ) or return;
Branch: 1 branch
BranchTrueFalseTotal
check($tmpl, \%hash) or return 0 12 12
424  
425 12 my $s = $Config{'path_sep'};
426  
427 ### only add if it's not added yet
428 12 for my $lib (@$dirs) {
429 32 ▶ unshift @INC, $lib unless grep { $_ eq $lib } @INC;
Branch: 1 branch
BranchTrueFalseTotal
unless grep {$_ eq $lib;} @INC 16 16 32
430 #
431 ### it will be complaining if $ENV{PERL5LIB] is not defined (yet).
432 32 local $^W;
433 $ENV{'PERL5LIB'} .= $s . $lib
434 32 ▶ unless $ENV{'PERL5LIB'} =~ qr|\Q$s$lib\E|;
Branch: 1 branch
BranchTrueFalseTotal
unless $ENV{"PERL5LIB"} =~ qr/\Q$s$lib\E/ 13 19 32
435 }
436  
437 12 return 1;
438 }
439  
440 =pod
441  
442 =head2 $bool = $internals->_add_to_path( directories => \@dirs )
443  
444 Adds a list of directories to the PATH, but only if they actually
445 contain anything.
446  
447 Returns true on success, false on failure.
448  
449 =cut
450  
451 sub _add_to_path {
452 10 ▶ my $self = shift;
Subroutine _add_to_path: called CC=6 SCAR=17.9
453 10 my %hash = @_;
454  
455 10 my $dirs;
456 10 my $tmpl = {
457 directories => { required => 1, default => [], store => \$dirs,
458 strict_type => 1 },
459 };
460  
461 10 ▶ check( $tmpl, \%hash ) or return;
Branch: 1 branch
BranchTrueFalseTotal
check($tmpl, \%hash) or return 0 10 10
462  
463 10 my $s = $Config{'path_sep'};
464  
465 10 require File::Glob;
466  
467 ### only add if it's not added yet
468 10 for my $dir (@$dirs) {
469 20 $dir =~ s![\\/]*$!!g;
470 20 ▶ next if $ENV{PATH} =~ qr|\Q$dir\E|;
Branch: 1 branch
BranchTrueFalseTotal
if $ENV{"PATH"} =~ qr/\Q$dir\E/ 4 16 20
471 16 ▶ next unless -d $dir;
Branch: 1 branch
BranchTrueFalseTotal
unless -d $dir 4 12 16
472 12 ▶ next unless File::Glob::bsd_glob( $dir . q{/*} );
Branch: 1 branch
BranchTrueFalseTotal
unless File::Glob::bsd_glob($dir . '/*') 8 4 12
473 4 $ENV{PATH} = join $s, $dir, $ENV{PATH};
474 }
475  
476 10 return 1;
477 }
478  
479 =pod
480  
481 =head2 $id = CPANPLUS::Internals->_last_id
482  
483 Return the id of the last object stored.
484  
485 =head2 $id = CPANPLUS::Internals->_store_id( $internals )
486  
487 Store this object; return its id.
488  
489 =head2 $obj = CPANPLUS::Internals->_retrieve_id( $ID )
490  
491 Retrieve an object based on its ID -- return false on error.
492  
493 =head2 CPANPLUS::Internals->_remove_id( $ID )
494  
495 Remove the object marked by $ID from storage.
496  
497 =head2 @objs = CPANPLUS::Internals->_return_all_objects
498  
499 Return all stored objects.
500  
501 =cut
502  
503  
504 ### code for storing multiple objects
505 ### -- although we only support one right now
506 ### XXX when support for multiple objects comes, saving source will have
507 ### to change
508 {
509 20 my $idref = {};
510 20 my $count = 0;
511  
512 15 ▶ sub _inc_id { return ++$count; }
Subroutine _inc_id: called CC=1 SCAR=0.0
513  
514 278 ▶ sub _last_id { $count }
Subroutine _last_id: called CC=1 SCAR=0.0
515  
516 sub _store_id {
517 15 ▶ my $self = shift;
Subroutine _store_id: called CC=3 SCAR=12.3
518 15 ▶ my $obj = shift or return;
Branch: 1 branch
BranchTrueFalseTotal
my $obj = shift() or return 0 15 15
519  
520 15 ▶ unless( IS_INTERNALS_OBJ->($obj) ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (sub { package CPANPLUS::Internals::Constants; use strict; UNIVERSAL::isa($_[-1], 'CPANPLUS::Internals');}->($obj)) 0 15 15
521 0 error( loc("The object you passed has the wrong ref type: '%1'",
522 ref $obj) );
523 0 return;
524 }
525  
526 15 $idref->{ $obj->_id } = $obj;
527 15 return $obj->_id;
528 }
529  
530 sub _retrieve_id {
531 831 ▶ my $self = shift;
Subroutine _retrieve_id: called CC=2 SCAR=7.0
532 831 ▶ my $id = shift or return;
Branch: 1 branch
BranchTrueFalseTotal
my $id = shift() or return 0 831 831
533  
534 831 my $obj = $idref->{$id};
535 831 return $obj;
536 }
537  
538 sub _remove_id {
539 1 ▶ my $self = shift;
Subroutine _remove_id: called CC=2 SCAR=7.1
540 1 ▶ my $id = shift or return;
Branch: 1 branch
BranchTrueFalseTotal
my $id = shift() or return 0 1 1
541  
542 1 return delete $idref->{$id};
543 }
544  
545 87 ▶ sub _return_all_objects { return values %$idref }
Subroutine _return_all_objects: called CC=1 SCAR=0.0
546 }
547  
548 20 1;
549  
550 # Local variables:
551 # c-indentation-style: bsd
552 # c-basic-offset: 4
553 # indent-tabs-mode: nil
554 # End:
555 # vim: expandtab shiftwidth=4:
« lib/CPANPLUS/Selfupdate.pm ↑ Summary blib/lib/CPANPLUS.pm »