From a686f98a991e033616249ba499dfba46489585d2 Mon Sep 17 00:00:00 2001 From: Tom Copeland Date: Mon, 30 Sep 2002 12:07:48 +0000 Subject: [PATCH] modified to skip error lines git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@1020 51baf565-9d33-0410-a72c-fc3788e3496d --- pmd-web/src/pmd.rb | 8 ++++++++ pmd-web/src/webpmd.pl | 13 ++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/pmd-web/src/pmd.rb b/pmd-web/src/pmd.rb index 6e8bbe5455..e2f09275d1 100644 --- a/pmd-web/src/pmd.rb +++ b/pmd-web/src/pmd.rb @@ -60,6 +60,14 @@ class Job def run_pmd cmd="java -jar pmd-1.0rc2.jar #{@sourceDirectory} html rulesets/unusedcode.xml > ../htdocs/reports/#{@unixName}_#{@moduleDirectory}.html" `#{cmd}` + arr = IO.readlines("../htdocs/reports/#{@unixName}_#{@moduleDirectory}.html") + newFile=File.open("../htdocs/reports/#{@unixName}_#{@moduleDirectory}.html", "w") + arr.each do | line | + if (line["Error while parsing"] == nil) + newFile << line + end + end + newFile.close end def clear diff --git a/pmd-web/src/webpmd.pl b/pmd-web/src/webpmd.pl index 4893c1e1f7..ec3d1ef0a2 100644 --- a/pmd-web/src/webpmd.pl +++ b/pmd-web/src/webpmd.pl @@ -48,16 +48,19 @@ sub default() { } sub printStats() { - # we're starting each build at 10 past the hour, so... - my $offset = 10; print hr(); - print b("Stats:"), br(), "There are ", ((60 + $offset) - localtime()->min) % 60, " minutes until the next run"; + print b("Stats:"), br(), "There are ", getTimeUntil(), " minutes until the next run"; open(FILE,"lastruntime.txt"); my $lastruntime=; print br(); - print "The last run took ${lastruntime} seconds"; + print "The last run took ", sprintf("%.0f", $lastruntime), " seconds"; print br(); - +} + +sub getTimeUntil() { + # we're starting each build at 10 past the hour, so... + my $offset = 10; + return ((60 + $offset) - localtime()->min) % 60; } sub loadProjectList() {