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:
@ -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
16
pmd-web/src/processor.rb
Normal 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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user