[Bps-public-commit] r9123 - RT-OnlineDocs/trunk/html/Developer/Perldoc

falcone at bestpractical.com falcone at bestpractical.com
Sun Sep 23 16:23:29 EDT 2007


Author: falcone
Date: Sun Sep 23 16:23:28 2007
New Revision: 9123

Modified:
   RT-OnlineDocs/trunk/html/Developer/Perldoc/Body.html
   RT-OnlineDocs/trunk/html/Developer/Perldoc/TOC.html

Log:
* handle .pod files as well as .pm files

Modified: RT-OnlineDocs/trunk/html/Developer/Perldoc/Body.html
==============================================================================
--- RT-OnlineDocs/trunk/html/Developer/Perldoc/Body.html	(original)
+++ RT-OnlineDocs/trunk/html/Developer/Perldoc/Body.html	Sun Sep 23 16:23:28 2007
@@ -15,17 +15,28 @@
 my $dirname = File::Basename::dirname($INC{'RT.pm'});
 my $localdirname = File::Basename::dirname($INC{'RT.pm'})."/../local/lib/";
 $n =~ s/::/\//g;
+
 my $show;
-if ( -r "$dirname/$n.pm" ) {
-    $show = "$dirname/$n";
-} elsif ( -r "$localdirname/$n.pm" ) {
-    $show = "$localdirname/$n";
-} else {
-    $show = "$dirname/RT";
+my $suffix;
+
+foreach my $ending (qw(pm pod)) {
+    if ( -r "$dirname/$n.$ending" ) {
+        $show = "$dirname/$n";
+        $suffix = $ending;
+    } elsif ( -r "$localdirname/$n.$ending" ) {
+        $show = "$localdirname/$n";
+        $suffix = $ending;
+    }
+
+    last if $show;
 }
 
+unless ($show) {
+        $show = "$dirname/RT";
+        $suffix = 'pm';
+}
 
-if (-r "$show.pm") {
+if (-r "$show.$suffix") {
     local $/;
     my $got_name = 0;
 
@@ -33,8 +44,8 @@
 
     foreach my $postfix ('', '_Overlay', '_Vendor', '_Local') {
     	my $fh;
-        next unless -r "$show$postfix.pm";
-        open $fh, "$show$postfix.pm" or next;
+        next unless -r "$show$postfix.$suffix";
+        open $fh, "$show$postfix.$suffix" or next;
         my $body = <$fh>;
         if ($body =~ s/.*Create takes a hash of values and creates a row in the
 database:([^=]+)//s) {

Modified: RT-OnlineDocs/trunk/html/Developer/Perldoc/TOC.html
==============================================================================
--- RT-OnlineDocs/trunk/html/Developer/Perldoc/TOC.html	(original)
+++ RT-OnlineDocs/trunk/html/Developer/Perldoc/TOC.html	Sun Sep 23 16:23:28 2007
@@ -20,11 +20,11 @@
 File::Find::find(
     { untaint => 1,
       wanted => sub {
-        return unless /(\w+)\.pm$/;
+        return unless /(\w+)\.(?:pm|pod)$/;
         return if $1 =~ /_(?:_Local|Vendor|Overlay)/;
         my $name = $File::Find::name;
         $name =~ s/.*lib\b.//;
-        $name =~ s!\.pm!!i;
+        $name =~ s!\.(?:pm|pod)!!i;
         $name =~ s!\W!::!g;
         push @found, $name;
     },follow => ($^O ne 'MSWin32') },



More information about the Bps-public-commit mailing list