line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Coro::PatchSet; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
43753
|
use strict; |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
104
|
|
4
|
3
|
|
|
3
|
|
18
|
use Carp; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
953
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.11'; |
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
|
|
33
|
my ($class, @import) = @_; |
16
|
|
|
|
|
|
|
|
17
|
3
|
100
|
|
|
|
17
|
unless (@import) { |
18
|
2
|
|
|
|
|
11
|
@import = keys %known_classes; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
3
|
|
|
|
|
10
|
for my $class (@import) { |
22
|
3
|
|
|
|
|
12
|
$class = lc $class; |
23
|
|
|
|
|
|
|
|
24
|
3
|
50
|
|
|
|
15
|
unless (exists $known_classes{$class}) { |
25
|
0
|
|
|
|
|
0
|
croak "doesn't know how to patch `$class'"; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
3
|
50
|
33
|
|
|
24
|
if ($class eq 'lwp' && @_ == 1) { |
29
|
|
|
|
|
|
|
# Net::HTTP and others may be not installed |
30
|
0
|
|
|
|
|
0
|
eval { require $known_classes{$class} } |
|
0
|
|
|
|
|
0
|
|
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
else { |
33
|
3
|
|
|
|
|
1938
|
require $known_classes{$class}; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |