diff options
author | Joshua Nichols <nichoj@gentoo.org> | 2006-08-21 01:45:47 +0000 |
---|---|---|
committer | Joshua Nichols <nichoj@gentoo.org> | 2006-08-21 01:45:47 +0000 |
commit | 4d94932422eaffa1d852b15aebd6e1012837caea (patch) | |
tree | 504768c91607636b7756192f84e0c9d26ff0a5e5 /projects/devdashboard/herds.rb | |
parent | Added indexing of documents and metadata (diff) | |
download | nichoj-4d94932422eaffa1d852b15aebd6e1012837caea.tar.gz nichoj-4d94932422eaffa1d852b15aebd6e1012837caea.tar.bz2 nichoj-4d94932422eaffa1d852b15aebd6e1012837caea.zip |
Updated Herds and UserInfo parsing
svn path=/; revision=56
Diffstat (limited to 'projects/devdashboard/herds.rb')
-rw-r--r-- | projects/devdashboard/herds.rb | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/projects/devdashboard/herds.rb b/projects/devdashboard/herds.rb index 06669d9..e8dec6b 100644 --- a/projects/devdashboard/herds.rb +++ b/projects/devdashboard/herds.rb @@ -1,6 +1,47 @@ #!/usr/bin/ruby -w module Herds + class Herd + attr_reader :name, :description, :email, :packages, :developers + attr_writer :name, :description, :email, :packages, :developers + def initialize(name) + self.name = name + self.packages = [] + self.developers = [] + end + end + + def Herds.indexHerds(developers) + herdsxml = '/local/home/checkouts/gentoo-website/xml/htdocs/proj/en/metastructure/herds/herds.xml' + file = File.new(herdsxml) + doc = Document.new(file) + root = doc.root + + root.elements.each('herd') do |herdnode| + namenode = herdnode.elements['name'] + emailnode = herdnode.elements['email'] + descriptionnode = herdnode.elements['description'] + projectnode = herdnode.elements['maintainingproject'] + + herd = Herd.new(namenode.text) + herd.email = emailnode.text unless emailnode.nil? + herd.description = descriptionnode.text unless descriptionnode.nil? + + # look for maintainers if not part of a project + if projectnode.nil? + herdnode.elements.each('maintainer') do |maintainer| + email = maintainer.elements['email'].text + developer = developers[email] + unless developer.nil? + developer.herds.push(herd) + herd.developers.push(developer) + end + end +# else + end + end + end + def Herds.getHerdsForDev(handle) line = nil IO.popen("herdstat -n -q -d #{handle}") do |pipe| |