line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CPANPLUS::Module::Fake; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
|
4
|
16
|
|
|
16
|
|
82924
|
use CPANPLUS::Error; |
|
16
|
|
|
|
|
83
|
|
|
16
|
|
|
|
|
1060
|
|
5
|
16
|
|
|
16
|
|
168
|
use CPANPLUS::Module; |
|
16
|
|
|
|
|
85
|
|
|
16
|
|
|
|
|
736
|
|
6
|
16
|
|
|
16
|
|
8152
|
use CPANPLUS::Module::Author::Fake; |
|
16
|
|
|
|
|
62
|
|
|
16
|
|
|
|
|
529
|
|
7
|
16
|
|
|
16
|
|
149
|
use CPANPLUS::Internals; |
|
16
|
|
|
|
|
62
|
|
|
16
|
|
|
|
|
360
|
|
8
|
|
|
|
|
|
|
|
9
|
16
|
|
|
16
|
|
113
|
use strict; |
|
16
|
|
|
|
|
59
|
|
|
16
|
|
|
|
|
400
|
|
10
|
16
|
|
|
16
|
|
106
|
use vars qw[@ISA $VERSION]; |
|
16
|
|
|
|
|
49
|
|
|
16
|
|
|
|
|
855
|
|
11
|
16
|
|
|
16
|
|
127
|
use Params::Check qw[check]; |
|
16
|
|
|
|
|
46
|
|
|
16
|
|
|
|
|
4326
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
$VERSION = "0.9910"; |
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. |
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
|
1043
|
my $class = shift; |
52
|
147
|
|
|
|
|
1120
|
my %hash = @_; |
53
|
|
|
|
|
|
|
|
54
|
147
|
|
|
|
|
486
|
local $Params::Check::ALLOW_UNKNOWN = 1; |
55
|
|
|
|
|
|
|
|
56
|
147
|
|
|
|
|
1306
|
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
|
|
|
|
608
|
my $args = check( $tmpl, \%hash ) or return; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
$args->{author} ||= CPANPLUS::Module::Author::Fake->new( |
67
|
147
|
|
66
|
|
|
27667
|
_id => $args->{_id} ); |
68
|
|
|
|
|
|
|
|
69
|
147
|
50
|
|
|
|
1294
|
my $obj = CPANPLUS::Module->new( %$args ) or return; |
70
|
|
|
|
|
|
|
|
71
|
147
|
50
|
|
|
|
760
|
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
|
|
|
|
|
1155
|
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: |