[Jspro-cvs] jsPro/scripts jsDoc.pl,1.1,1.2
Brought to you by:
wigleys
|
From: <wi...@us...> - 2003-10-01 14:51:01
|
Update of /cvsroot/jspro/jsPro/scripts
In directory sc8-pr-cvs1:/tmp/cvs-serv30135
Modified Files:
jsDoc.pl
Log Message:
Some minor tweeks to make sure that the script does actually work
Index: jsDoc.pl
===================================================================
RCS file: /cvsroot/jspro/jsPro/scripts/jsDoc.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** jsDoc.pl 1 Oct 2003 14:42:58 -0000 1.1
--- jsDoc.pl 1 Oct 2003 14:50:53 -0000 1.2
***************
*** 1,7 ****
--- 1,33 ----
#!/usr/bin/perl -w
+ # +-------------------------------------------------------------------------+
+ # | jsPro - Documentation Script |
+ # +-------------------------------------------------------------------------+
+ # | Copyright (C) 2001-2003 Stuart Wigley |
+ # +-------------------------------------------------------------------------+
+ # | This library is free software; you can redistribute it and/or modify it |
+ # | under the terms of the GNU Lesser General Public License as published by|
+ # | the Free Software Foundation; either version 2.1 of the License, or (at |
+ # | your option) any later version. |
+ # | |
+ # | This library is distributed in the hope that it will be useful, but |
+ # | WITHOUT ANY WARRANTY; without even the implied warranty of |
+ # | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser |
+ # | General Public License for more details. |
+ # | |
+ # | You should have received a copy of the GNU Lesser General Public License|
+ # | along with this library; if not, write to the Free Software Foundation, |
+ # | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
+ # +-------------------------------------------------------------------------+
+ # | Authors: Stuart Wigley <stu...@ya...> |
+ # +-------------------------------------------------------------------------+
+ # $Id$
+
use strict;
+ # get the number of command line arguments
my $iNumArgs = $#ARGV + 1;
+ # where to look for the javascript files
+ my $jsFolder = "..";
if ($iNumArgs != 1) {
***************
*** 27,31 ****
&README_INTRO;
! opendir(DIR, ".");
my $counter = 1;
--- 53,57 ----
&README_INTRO;
! opendir(DIR, $jsFolder);
my $counter = 1;
***************
*** 36,47 ****
if ($filename =~ m/\.js$/) {
! open( FILE, "< $filename" ) or die "Can't open $filename : $!";
print "$filename\n";
print "-------------------------------------------------------------------------------\n";
! #for each line of the file
while (<FILE>) {
chomp;
--- 62,74 ----
if ($filename =~ m/\.js$/) {
! open( FILE, "< $jsFolder/$filename" ) or die "Can't open $filename : $!";
print "$filename\n";
print "-------------------------------------------------------------------------------\n";
! # for each line of the file
while (<FILE>) {
+ # remove the trailing newline character
chomp;
***************
*** 54,64 ****
if ($_ =~ m/function\(/) {
! #match the " =" on this line
/ \=/;
! #print the output line
print $counter . ". " . $` . "(): " . $sShortDesc . "\n";
$counter++;
! #reset the shortDescription value ready for the next iteration
$sShortDesc = "";
}
--- 81,91 ----
if ($_ =~ m/function\(/) {
! # match the " =" on this line
/ \=/;
! # print the output line and increment
print $counter . ". " . $` . "(): " . $sShortDesc . "\n";
$counter++;
! # reset the shortDescription value ready for the next iteration
$sShortDesc = "";
}
***************
*** 73,77 ****
! #this subroutine prints the standard README header
sub README_INTRO {
print
--- 100,104 ----
! # this subroutine prints the standard README header
sub README_INTRO {
print
***************
*** 105,109 ****
! #this subroutine inserts a standard footer
sub FOOTER {
my $localTime = localtime();
--- 132,136 ----
! # this subroutine inserts a standard footer
sub FOOTER {
my $localTime = localtime();
***************
*** 116,120 ****
! #this subroutine displays help on the script
sub HELP {
die
--- 143,147 ----
! # this subroutine displays help on the script
sub HELP {
die
***************
*** 122,125 ****
Example: jsDoc -r\n
-r, --readme generate README file for all JavaScript files in current
! directory\n";
}
--- 149,152 ----
Example: jsDoc -r\n
-r, --readme generate README file for all JavaScript files in current
! directory\n";
}
|