line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CPANPLUS::Module::Author::Fake; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
|
4
|
16
|
|
|
16
|
|
136
|
use CPANPLUS::Module::Author; |
|
16
|
|
|
|
|
53
|
|
|
16
|
|
|
|
|
740
|
|
5
|
16
|
|
|
16
|
|
164
|
use CPANPLUS::Internals; |
|
16
|
|
|
|
|
64
|
|
|
16
|
|
|
|
|
855
|
|
6
|
16
|
|
|
16
|
|
116
|
use CPANPLUS::Error; |
|
16
|
|
|
|
|
51
|
|
|
16
|
|
|
|
|
1051
|
|
7
|
|
|
|
|
|
|
|
8
|
16
|
|
|
16
|
|
145
|
use strict; |
|
16
|
|
|
|
|
71
|
|
|
16
|
|
|
|
|
660
|
|
9
|
16
|
|
|
16
|
|
136
|
use vars qw[@ISA $VERSION]; |
|
16
|
|
|
|
|
65
|
|
|
16
|
|
|
|
|
1683
|
|
10
|
16
|
|
|
16
|
|
140
|
use Params::Check qw[check]; |
|
16
|
|
|
|
|
54
|
|
|
16
|
|
|
|
|
4653
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
$VERSION = "0.9910"; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
@ISA = qw[CPANPLUS::Module::Author]; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
$Params::Check::VERBOSE = 1; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=pod |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 NAME |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
CPANPLUS::Module::Author::Fake - dummy author object for CPANPLUS |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 SYNOPSIS |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
my $auth = CPANPLUS::Module::Author::Fake->new( |
27
|
|
|
|
|
|
|
author => 'Foo Bar', |
28
|
|
|
|
|
|
|
email => 'luser@foo.com', |
29
|
|
|
|
|
|
|
cpanid => 'FOO', |
30
|
|
|
|
|
|
|
_id => $cpan->id, |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 DESCRIPTION |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
A class for creating fake author objects, for shortcut use internally |
36
|
|
|
|
|
|
|
by CPANPLUS. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Inherits from C. |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 METHODS |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head2 new( _id => DIGIT ) |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
Creates a dummy author object. It can take the same options as |
45
|
|
|
|
|
|
|
C<< CPANPLUS::Module::Author->new >>, but will fill in default ones |
46
|
|
|
|
|
|
|
if none are provided. Only the _id key is required. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=cut |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub new { |
51
|
100
|
|
|
100
|
1
|
262
|
my $class = shift; |
52
|
100
|
|
|
|
|
329
|
my %hash = @_; |
53
|
|
|
|
|
|
|
|
54
|
100
|
|
|
|
|
751
|
my $tmpl = { |
55
|
|
|
|
|
|
|
author => { default => 'CPANPLUS Internals' }, |
56
|
|
|
|
|
|
|
email => { default => 'cpanplus-info@lists.sf.net' }, |
57
|
|
|
|
|
|
|
cpanid => { default => 'CPANPLUS' }, |
58
|
|
|
|
|
|
|
_id => { default => CPANPLUS::Internals->_last_id }, |
59
|
|
|
|
|
|
|
}; |
60
|
|
|
|
|
|
|
|
61
|
100
|
50
|
|
|
|
401
|
my $args = check( $tmpl, \%hash ) or return; |
62
|
|
|
|
|
|
|
|
63
|
100
|
50
|
|
|
|
9928
|
my $obj = CPANPLUS::Module::Author->new( %$args ) or return; |
64
|
|
|
|
|
|
|
|
65
|
100
|
50
|
|
|
|
472
|
unless( $obj->_id ) { |
66
|
0
|
|
|
|
|
0
|
error(loc("No '%1' specified -- No CPANPLUS object associated!",'_id')); |
67
|
0
|
|
|
|
|
0
|
return; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
### rebless object ### |
71
|
100
|
|
|
|
|
925
|
return bless $obj, $class; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
1; |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
# Local variables: |
78
|
|
|
|
|
|
|
# c-indentation-style: bsd |
79
|
|
|
|
|
|
|
# c-basic-offset: 4 |
80
|
|
|
|
|
|
|
# indent-tabs-mode: nil |
81
|
|
|
|
|
|
|
# End: |
82
|
|
|
|
|
|
|
# vim: expandtab shiftwidth=4: |