modifying to use ruby for the processor

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@982 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Tom Copeland
2002-09-24 20:08:22 +00:00
parent 6f7b80a722
commit 502ac929ed
2 changed files with 33 additions and 7 deletions

View File

@ -1,9 +1,9 @@
#
# project.rb - This is the basics of what we need
# pmd.rb - This is the basics of what we need
# to represent a project.
#
module PMD;
module PMD
class Project
def initialize( name, source )
@ -37,16 +37,26 @@ end
class SFProject < CVSProject
def initialize( name, mod, source )
@name = name
@cvsroot = ':pserver:anonymous@cvs.' + name +
'.sourceforge.net:/cvsroot/' + name
@cvsroot = ':pserver:anonymous@cvs.' + name + '.sourceforge.net:/cvsroot/' + name
@mod = mod
@source = name + '/' + mod + '/' + source
end
end
class Job
def initialize( projectName, moduleDirectory, sourceDirectory )
@projectName = projectName
@cvsroot = ':pserver:anonymous@cvs.' + projectName + '.sourceforge.net:/cvsroot/' + projectName
@moduleDirectory = moduleDirectory
@sourceDirectory = moduleDirectory + '/' + sourceDirectory
end
def to_s
return @projectName +":"+@moduleDirectory+":"+@sourceDirectory
end
end
quilt = PMD::SFProject.new ARGV[0], ARGV[1], ARGV[2]
quilt.updateSource
quilt.runAnt
end

16
pmd-web/src/processor.rb Normal file
View File

@ -0,0 +1,16 @@
require 'c:\data\pmd\pmd-web\src\pmd.rb'
jobsDir = Dir.new("jobs")
jobsDir.each { |candidate|
if candidate[".txt"]
jobFile=File.new("jobs/#{candidate}")
jobData = jobFile.read
jobFile.close
name,moduleDir,srcDir=jobData.split(":")
job = PMD::Job.new(name, moduleDir, srcDir)
puts job
end
}