#!/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;
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/@@;
$ModulePrefix = $pwd;
$ModulePrefix =~ s@/@::@g;
$Module = $pwd . "::*";
}
sub Show
{
print "
$ModulePrefix classes \n
\n";
print "
\n";
my $pathname = '';
foreach $pathname (<*>) {
next if $pathname =~ /^\@/;
next if $pathname =~ /\~$/;
next if $pathname eq 'CVS';
next if $pathname =~ /^index/;
next if $pathname eq 'Makefile';
my $module = $pathname;
if ($module =~ /pm/) {
$module = $ModulePrefix. "::". $pathname;
$module =~ s/\.pm$//;
}
if (-d $pathname) {
print "\t- ";
if (-f "$pathname/index.ja.html") {
print " ";
print "${module}::*\n";
}
else {
if (-f "$pathname/README") {
print " README\n";
}
if ( -f "$pathname/INSTALL") {
print " INSTALL\n";
}
print STDERR "Error: *** fail to convert $pathname ***\n";
}
}
else {
print "\t
- ";
print " $module\n";
}
}
print "
\n";
}
sub HEADER
{
print <<"_EOF";
$Module classes
_EOF
}
sub FOOTER
{
print <<'_EOF';
_EOF
}
1;