line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Coro::PatchSet; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
41950
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
80
|
|
4
|
3
|
|
|
3
|
|
17
|
use Carp; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
680
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.12'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
my %known_classes = ( |
9
|
|
|
|
|
|
|
socket => 'Coro/PatchSet/Socket.pm', |
10
|
|
|
|
|
|
|
handle => 'Coro/PatchSet/Handle.pm', |
11
|
|
|
|
|
|
|
lwp => 'Coro/PatchSet/LWP.pm', |
12
|
|
|
|
|
|
|
); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub import { |
15
|
3
|
|
|
3
|
|
27
|
my ($class, @import) = @_; |
16
|
|
|
|
|
|
|
|
17
|
3
|
100
|
|
|
|
17
|
unless (@import) { |
18
|
2
|
|
|
|
|
10
|
@import = keys %known_classes; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
3
|
|
|
|
|
8
|
for my $class (@import) { |
22
|
5
|
|
|
|
|
14
|
$class = lc $class; |
23
|
|
|
|
|
|
|
|
24
|
5
|
50
|
|
|
|
19
|
unless (exists $known_classes{$class}) { |
25
|
0
|
|
|
|
|
0
|
croak "doesn't know how to patch `$class'"; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
5
|
100
|
66
|
|
|
36
|
if ($class eq 'lwp' && @_ == 1) { |
29
|
|
|
|
|
|
|
# Net::HTTP and others may be not installed |
30
|
2
|
|
|
|
|
4
|
eval { require $known_classes{$class} } |
|
2
|
|
|
|
|
1014
|
|
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
else { |
33
|
3
|
|
|
|
|
1476
|
require $known_classes{$class}; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |