blob: ba9b43f9bde0f7ab8abb2dd29434370ace78fb0c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
|
#!/usr/local/bin/perl
#-*- perl -*-
#
# Copyright (C) 2001 Ken'ichi Fukamachi
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
# $Id$
# $FML$
#
use strict;
use Carp;
my $Module;
my $ModulePrefix;
my $TableMode = 1;
Init();
HEADER();
Show();
FOOTER();
exit 0;
sub Init
{
my $pwd = `pwd`;
chop($pwd);
$pwd =~ s@^.*fml/lib@@;
$pwd =~ s@^.*cpan/dist@@;
$pwd =~ s@^.*cpan/lib@@;
$pwd =~ s@^/@@;
$ModulePrefix = $pwd;
$ModulePrefix =~ s@/@::@g;
$Module = $pwd . "::*";
}
sub Show
{
print "<CENTER><EM>$ModulePrefix class modules</EM></CENTER>\n<HR>\n";
print ($TableMode ? "<TABLE BRODER=4>\n" : "<UL>\n");
my $pathname = '';
my $doc = '';
unlink ".cvsignore" if -f ".cvsignore";
foreach $pathname (<*>) {
next if $pathname =~ /^\__template/;
next if $pathname =~ /^\@/;
next if $pathname =~ /\~$/;
next if $pathname =~ /pod$/;
next if $pathname eq 'CVS';
next if $pathname eq 't'; # test directory
next if $pathname =~ /^index/;
next if $pathname eq 'Makefile';
my $module = $pathname;
# ignore module.txt file
# which is generated from module.pm automatically
if ($module =~ /txt$/) {
my $x = $module;
$x =~ s/txt$/pm/;
next if -f $x;
}
if ($module =~ /\.pm$/) {
$module = $ModulePrefix. "::". $pathname;
$module =~ s/\.pm$//;
if (-f $pathname) {
$doc = $pathname;
$doc =~ s/pm$/txt/;
print STDERR "\tpod2text $pathname > $doc\n";
system "pod2text $pathname > $doc";
system "echo $doc >> .cvsignore";
}
}
if (-d $pathname) {
print ($TableMode ? "<TR>\n" : "<LI>\n");
print "<TD>\n" if $TableMode;
if (-f "$pathname/index.ja.html") {
print " <A HREF=$pathname/index.ja.html>";
if ($ModulePrefix) {
print "${ModulePrefix}::${module}::* class</A>\n";
}
else {
print "${module}::*</A>\n";
}
}
else {
if (-f "$pathname/README") {
print " <A HREF=$pathname/README>README</A>\n";
}
if ( -f "$pathname/INSTALL") {
print " <A HREF=$pathname/INSTALL>INSTALL</A>\n";
}
print STDERR "Error: *** fail to convert $pathname ***\n";
print "${pathname}/\n";
}
}
else {
print ($TableMode ? "<TR>\n" : "<LI>\n");
print "<TD>\n" if $TableMode;
print " $module ";
print "<TD>\n" if $TableMode;
print "<A HREF=\"$pathname\">[source]</A>\n";
print "<TD>\n" if $TableMode;
print "<A HREF=\"$doc\">[doc]</A>\n" if -f $doc;
}
}
print ($TableMode ? "</TABLE>\n" : "</UL>\n");
}
sub HEADER
{
print <<"_EOF";
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>
$Module classes
</TITLE>
<META http-equiv="Content-Type"
content="text/html; charset=EUC-JP">
</HEAD>
<BODY BGCOLOR="#E6E6FA">
_EOF
}
sub FOOTER
{
print <<'_EOF';
</BODY>
</HTML>
_EOF
}
1;
|