Revision: 6524
          
http://languagetool.svn.sourceforge.net/languagetool/?rev=6524&view=rev
Author:   dnaber
Date:     2012-02-13 00:15:25 +0000 (Mon, 13 Feb 2012)
Log Message:
-----------
new argument for class that builds the language overview: take web root as a 
parameter now that is has been moved in SVN

Modified Paths:
--------------
    trunk/JLanguageTool/src/dev/org/languagetool/dev/RuleOverview.java

Modified: trunk/JLanguageTool/src/dev/org/languagetool/dev/RuleOverview.java
===================================================================
--- trunk/JLanguageTool/src/dev/org/languagetool/dev/RuleOverview.java  
2012-02-13 00:13:12 UTC (rev 6523)
+++ trunk/JLanguageTool/src/dev/org/languagetool/dev/RuleOverview.java  
2012-02-13 00:15:25 UTC (rev 6524)
@@ -41,15 +41,19 @@
 public final class RuleOverview {
 
   public static void main(final String[] args) throws IOException {
+    if (args.length != 1) {
+      System.out.println("Usage: " + RuleOverview.class.getName() + " 
<webRoot>");
+      System.exit(1);
+    }
     final RuleOverview prg = new RuleOverview();
-    prg.run();
+    prg.run(new File(args[0]));
   }
   
   private RuleOverview() {
     // no public constructor
   }
   
-  private void run() throws IOException {
+  private void run(File webRoot) throws IOException {
     System.out.println("<b>Rules in LanguageTool " + JLanguageTool.VERSION + 
"</b><br />");
     System.out.println("Date: " + new 
SimpleDateFormat("yyyy-MM-dd").format(new Date()) + "<br /><br />\n");
     System.out.println("<table class=\"tablesorter sortable\">");
@@ -75,13 +79,14 @@
       .replaceAll("(?s)<rules.*?>", "");
 
     int overallJavaCount = 0;
+    int langSpecificWebsiteCount = 0;
     for (final String langName : sortedLanguages) {
       final Language lang = Language.getLanguageForName(langName);
       System.out.print("<tr>");
-      final File webDir = new File("website", "www");
-      final File langSpecificWebsite = new File(webDir, lang.getShortName());
+      final File langSpecificWebsite = new File(webRoot, lang.getShortName());
       if (langSpecificWebsite.isDirectory()) {
         System.out.print("<td valign=\"top\"><a href=\"../" + 
lang.getShortName() + "/\">" + lang.getName() + "</a></td>");
+        langSpecificWebsiteCount++;
       } else {
         System.out.print("<td valign=\"top\">" + lang.getName() + "</td>");
       }
@@ -135,8 +140,13 @@
     }
       
     if (overallJavaCount == 0) {
-      throw new RuntimeException("No Java rules found");
+      throw new RuntimeException("No Java rules found - start this script from 
the LanguageTool directory so " +
+              "that the sources are at 'src/java/org/languagetool'");
     }
+    if (langSpecificWebsiteCount == 0) {
+      throw new RuntimeException("No language specific websites found - please 
let the web root parameter " +
+              "point to the 'www' directory (current value: '" + webRoot + 
"')");
+    }
 
     System.out.println("</tbody>");
     System.out.println("</table>");

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Languagetool-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/languagetool-cvs

Reply via email to