line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CPANPLUS::Module::Author::Fake; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
|
4
|
16
|
|
|
16
|
|
141
|
use CPANPLUS::Module::Author; |
|
16
|
|
|
|
|
48
|
|
|
16
|
|
|
|
|
711
|
|
5
|
16
|
|
|
16
|
|
151
|
use CPANPLUS::Internals; |
|
16
|
|
|
|
|
62
|
|
|
16
|
|
|
|
|
792
|
|
6
|
16
|
|
|
16
|
|
140
|
use CPANPLUS::Error; |
|
16
|
|
|
|
|
72
|
|
|
16
|
|
|
|
|
975
|
|
7
|
|
|
|
|
|
|
|
8
|
16
|
|
|
16
|
|
124
|
use strict; |
|
16
|
|
|
|
|
70
|
|
|
16
|
|
|
|
|
602
|
|
9
|
16
|
|
|
16
|
|
106
|
use vars qw[@ISA $VERSION]; |
|
16
|
|
|
|
|
53
|
|
|
16
|
|
|
|
|
1513
|
|
10
|
16
|
|
|
16
|
|
130
|
use Params::Check qw[check]; |
|
16
|
|
|
|
|
39
|
|
|
16
|
|
|
|
|
4330
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
$VERSION = "0.9912"; |
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<CPANPLUS::Module::Author>. |
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
|
258
|
my $class = shift; |
52
|
100
|
|
|
|
|
345
|
my %hash = @_; |
53
|
|
|
|
|
|
|
|
54
|
100
|
|
|
|
|
686
|
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
|
|
|
|
416
|
my $args = check( $tmpl, \%hash ) or return; |
62
|
|
|
|
|
|
|
|
63
|
100
|
50
|
|
|
|
9860
|
my $obj = CPANPLUS::Module::Author->new( %$args ) or return; |
64
|
|
|
|
|
|
|
|
65
|
100
|
50
|
|
|
|
504
|
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
|
|
|
|
|
907
|
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: |