line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CPANPLUS::Module::Author::Fake; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
|
4
|
16
|
|
|
16
|
|
152
|
use CPANPLUS::Module::Author; |
|
16
|
|
|
|
|
75
|
|
|
16
|
|
|
|
|
758
|
|
5
|
16
|
|
|
16
|
|
139
|
use CPANPLUS::Internals; |
|
16
|
|
|
|
|
62
|
|
|
16
|
|
|
|
|
870
|
|
6
|
16
|
|
|
16
|
|
139
|
use CPANPLUS::Error; |
|
16
|
|
|
|
|
52
|
|
|
16
|
|
|
|
|
1113
|
|
7
|
|
|
|
|
|
|
|
8
|
16
|
|
|
16
|
|
155
|
use strict; |
|
16
|
|
|
|
|
54
|
|
|
16
|
|
|
|
|
717
|
|
9
|
16
|
|
|
16
|
|
132
|
use vars qw[@ISA $VERSION]; |
|
16
|
|
|
|
|
46
|
|
|
16
|
|
|
|
|
1641
|
|
10
|
16
|
|
|
16
|
|
139
|
use Params::Check qw[check]; |
|
16
|
|
|
|
|
58
|
|
|
16
|
|
|
|
|
4843
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
$VERSION = "0.9914"; |
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
|
264
|
my $class = shift; |
52
|
100
|
|
|
|
|
319
|
my %hash = @_; |
53
|
|
|
|
|
|
|
|
54
|
100
|
|
|
|
|
693
|
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
|
|
|
|
465
|
my $args = check( $tmpl, \%hash ) or return; |
62
|
|
|
|
|
|
|
|
63
|
100
|
50
|
|
|
|
10110
|
my $obj = CPANPLUS::Module::Author->new( %$args ) or return; |
64
|
|
|
|
|
|
|
|
65
|
100
|
50
|
|
|
|
516
|
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
|
|
|
|
|
882
|
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: |