line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package POD2::Base; |
3
|
|
|
|
|
|
|
|
4
|
3
|
|
|
3
|
|
127070
|
use 5.005; |
|
3
|
|
|
|
|
11
|
|
|
3
|
|
|
|
|
120
|
|
5
|
3
|
|
|
3
|
|
18
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
106
|
|
6
|
3
|
|
|
3
|
|
17
|
use warnings; |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
128
|
|
7
|
|
|
|
|
|
|
|
8
|
3
|
|
|
3
|
|
16
|
use vars qw( $VERSION ); |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
219
|
|
9
|
|
|
|
|
|
|
$VERSION = '0.044_1'; |
10
|
|
|
|
|
|
|
|
11
|
3
|
|
|
3
|
|
16
|
use File::Spec (); |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
2096
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
3
|
|
|
3
|
1
|
2281
|
my $proto = shift; |
15
|
3
|
|
33
|
|
|
21
|
my $class = ref $proto || $proto; |
16
|
3
|
|
|
|
|
9
|
my $obj = bless {}, $class; |
17
|
3
|
|
|
|
|
13
|
return $obj->_init( @_ ); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
# instance variables: |
21
|
|
|
|
|
|
|
# lang - the preferred language of the POD documents |
22
|
|
|
|
|
|
|
# inc - alternate library dirs (if given, replaces the ones in @INC) |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub _init { |
25
|
3
|
|
|
3
|
|
5
|
my $self = shift; |
26
|
3
|
50
|
|
|
|
11
|
my %args = @_ ? %{$_[0]} : (); |
|
3
|
|
|
|
|
15
|
|
27
|
3
|
100
|
|
|
|
13
|
if ( !exists $args{lang} ) { |
28
|
1
|
|
|
|
|
5
|
$args{lang} = _extract_lang( ref $self ); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
#croak "???" unless $args{lang}; |
31
|
3
|
|
|
|
|
8
|
my $lang = uc $args{lang}; |
32
|
3
|
|
|
|
|
17
|
$self->{lang} = $lang; |
33
|
3
|
|
|
|
|
8
|
$self->{inc} = $args{inc}; # XXX croak ?! must be array ref |
34
|
|
|
|
|
|
|
|
35
|
3
|
|
|
|
|
11
|
return $self; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
# $lang = _extract_lang($module); |
39
|
|
|
|
|
|
|
sub _extract_lang { |
40
|
1
|
|
|
1
|
|
3
|
my $module = shift; |
41
|
|
|
|
|
|
|
|
42
|
1
|
50
|
|
|
|
12
|
return $module eq __PACKAGE__ ? undef |
|
|
50
|
|
|
|
|
|
43
|
|
|
|
|
|
|
: $module =~ /::(\w+)\z/ ? $1 |
44
|
|
|
|
|
|
|
: undef |
45
|
|
|
|
|
|
|
; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub _lib_dirs { |
49
|
3
|
|
|
3
|
|
5
|
my $self = shift; |
50
|
3
|
100
|
|
|
|
15
|
return $self->{inc} ? @{$self->{inc}} : @INC; |
|
2
|
|
|
|
|
9
|
|
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub pod_dirs { |
54
|
3
|
|
|
3
|
1
|
4013
|
my $self = shift; |
55
|
3
|
100
|
|
|
|
11
|
my %options = @_ ? %{$_[0]} : (); |
|
2
|
|
|
|
|
11
|
|
56
|
3
|
100
|
|
|
|
16
|
$options{test} = 1 unless exists $options{test}; |
57
|
|
|
|
|
|
|
|
58
|
3
|
|
|
|
|
20
|
my $lang = $self->{lang}; |
59
|
3
|
|
|
|
|
11
|
my @candidates = map { File::Spec->catdir( $_, 'POD2', $lang ) } $self->_lib_dirs; # XXX the right thing to do |
|
13
|
|
|
|
|
98
|
|
60
|
3
|
100
|
|
|
|
12
|
if ( $options{test} ) { |
61
|
1
|
|
|
|
|
3
|
return grep { -d } @candidates; |
|
1
|
|
|
|
|
42
|
|
62
|
|
|
|
|
|
|
} |
63
|
2
|
|
|
|
|
11
|
return @candidates; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
#sub search_perlfunc_re { |
67
|
|
|
|
|
|
|
# shift; |
68
|
|
|
|
|
|
|
# return 'Alphabetical Listing of Perl Functions'; |
69
|
|
|
|
|
|
|
#} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub pod_info { |
72
|
0
|
|
|
0
|
1
|
|
shift; |
73
|
0
|
|
|
|
|
|
return {}; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub print_pods { |
77
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
78
|
0
|
|
|
|
|
|
$self->print_pod(sort keys %{$self->pod_info}); |
|
0
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub print_pod { |
82
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
83
|
0
|
0
|
|
|
|
|
my @args = @_ ? @_ : @ARGV; |
84
|
|
|
|
|
|
|
|
85
|
0
|
|
|
|
|
|
my $pods = $self->pod_info; |
86
|
0
|
|
|
|
|
|
while (@args) { |
87
|
0
|
|
|
|
|
|
(my $pod = lc(shift @args)) =~ s/\.pod$//; |
88
|
0
|
0
|
|
|
|
|
if ( exists $pods->{$pod} ) { |
89
|
0
|
|
|
|
|
|
print "\t'$pod' translated from Perl $pods->{$pod}\n"; |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
else { |
92
|
0
|
|
|
|
|
|
print "\t'$pod' doesn't yet exists\n"; |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
1; |