line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CPANPLUS::Module::Fake; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
|
4
|
16
|
|
|
16
|
|
103984
|
use CPANPLUS::Error; |
|
16
|
|
|
|
|
62
|
|
|
16
|
|
|
|
|
1549
|
|
5
|
16
|
|
|
16
|
|
147
|
use CPANPLUS::Module; |
|
16
|
|
|
|
|
56
|
|
|
16
|
|
|
|
|
555
|
|
6
|
16
|
|
|
16
|
|
7787
|
use CPANPLUS::Module::Author::Fake; |
|
16
|
|
|
|
|
63
|
|
|
16
|
|
|
|
|
512
|
|
7
|
16
|
|
|
16
|
|
130
|
use CPANPLUS::Internals; |
|
16
|
|
|
|
|
59
|
|
|
16
|
|
|
|
|
330
|
|
8
|
|
|
|
|
|
|
|
9
|
16
|
|
|
16
|
|
104
|
use strict; |
|
16
|
|
|
|
|
50
|
|
|
16
|
|
|
|
|
404
|
|
10
|
16
|
|
|
16
|
|
98
|
use vars qw[@ISA $VERSION]; |
|
16
|
|
|
|
|
44
|
|
|
16
|
|
|
|
|
827
|
|
11
|
16
|
|
|
16
|
|
133
|
use Params::Check qw[check]; |
|
16
|
|
|
|
|
51
|
|
|
16
|
|
|
|
|
4265
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
$VERSION = "0.9912"; |
14
|
|
|
|
|
|
|
@ISA = qw[CPANPLUS::Module]; |
15
|
|
|
|
|
|
|
$Params::Check::VERBOSE = 1; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=pod |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 NAME |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
CPANPLUS::Module::Fake - fake module object for internal use |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 SYNOPSIS |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
my $obj = CPANPLUS::Module::Fake->new( |
26
|
|
|
|
|
|
|
module => 'Foo', |
27
|
|
|
|
|
|
|
path => 'ftp/path/to/foo', |
28
|
|
|
|
|
|
|
author => CPANPLUS::Module::Author::Fake->new, |
29
|
|
|
|
|
|
|
package => 'fake-1.1.tgz', |
30
|
|
|
|
|
|
|
_id => $cpan->_id, |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 DESCRIPTION |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
A class for creating fake module objects, for shortcut use internally |
36
|
|
|
|
|
|
|
by CPANPLUS. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Inherits from C<CPANPLUS::Module>. |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 METHODS |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head2 new( module => $mod, path => $path, package => $pkg, [_id => DIGIT] ) |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
Creates a dummy module object from the above parameters. It can |
45
|
|
|
|
|
|
|
take more options (same as C<< CPANPLUS::Module->new >> but the above |
46
|
|
|
|
|
|
|
are required. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=cut |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub new { |
51
|
147
|
|
|
147
|
1
|
1014
|
my $class = shift; |
52
|
147
|
|
|
|
|
982
|
my %hash = @_; |
53
|
|
|
|
|
|
|
|
54
|
147
|
|
|
|
|
480
|
local $Params::Check::ALLOW_UNKNOWN = 1; |
55
|
|
|
|
|
|
|
|
56
|
147
|
|
|
|
|
1114
|
my $tmpl = { |
57
|
|
|
|
|
|
|
module => { required => 1 }, |
58
|
|
|
|
|
|
|
path => { required => 1 }, |
59
|
|
|
|
|
|
|
package => { required => 1 }, |
60
|
|
|
|
|
|
|
_id => { default => CPANPLUS::Internals->_last_id }, |
61
|
|
|
|
|
|
|
author => { default => '' }, |
62
|
|
|
|
|
|
|
}; |
63
|
|
|
|
|
|
|
|
64
|
147
|
50
|
|
|
|
570
|
my $args = check( $tmpl, \%hash ) or return; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
$args->{author} ||= CPANPLUS::Module::Author::Fake->new( |
67
|
147
|
|
66
|
|
|
28070
|
_id => $args->{_id} ); |
68
|
|
|
|
|
|
|
|
69
|
147
|
50
|
|
|
|
1131
|
my $obj = CPANPLUS::Module->new( %$args ) or return; |
70
|
|
|
|
|
|
|
|
71
|
147
|
50
|
|
|
|
657
|
unless( $obj->_id ) { |
72
|
0
|
|
|
|
|
0
|
error(loc("No '%1' specified -- No CPANPLUS object associated!",'_id')); |
73
|
0
|
|
|
|
|
0
|
return; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
### rebless object ### |
77
|
147
|
|
|
|
|
1164
|
return bless $obj, $class; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
1; |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
# Local variables: |
83
|
|
|
|
|
|
|
# c-indentation-style: bsd |
84
|
|
|
|
|
|
|
# c-basic-offset: 4 |
85
|
|
|
|
|
|
|
# indent-tabs-mode: nil |
86
|
|
|
|
|
|
|
# End: |
87
|
|
|
|
|
|
|
# vim: expandtab shiftwidth=4: |