Sha256: 77c91c5822218b13e54088830987ee769ea358bc75e663bd0a61334cdaa99dd9
Contents?: true
Size: 1.48 KB
Versions: 8
Compression:
Stored size: 1.48 KB
Contents
require 'nokogiri' require_relative '../asf' module ASF class Podlings include Enumerable def quarter [ Date.today.strftime('%B'), Date.today.next_month.strftime('%B'), Date.today.next_month.next_month.strftime('%B') ] end def each incubator_content = ASF::SVN['asf/incubator/public/trunk/content'] podlings = Nokogiri::XML(File.read("#{incubator_content}/podlings.xml")) podlings.search('podling').map do |node| reporting = node.at('reporting') if reporting group = reporting['group'] monthly = reporting.text.split(/,\s*/) if reporting['monthly'] reporting = %w(January April July October) if group == '1' reporting = %w(February May August November) if group == '2' reporting = %w(March June September December) if group == '3' reporting.rotate! until quarter.include? reporting.first if monthly monthly.shift until monthly.empty? or quarter.include? monthly.first reporting = (monthly + reporting).uniq end end data = { name: node['name'], status: node['status'], reporting: reporting, description: node.at('description').text, mentors: node.search('mentor').map {|mentor| mentor['username']} } data[:champion] = node.at('champion')['availid'] if node.at('champion') yield node['resource'], data end end end end
Version data entries
8 entries across 8 versions & 1 rubygems