module ASF::Board
module which contains the Agenda
class
Constants
- DIRECTOR_MAP
- DISPLAY_NAME
- FIRST_NAME
- INITIALS
Map director ids->names and ids->initials Only filled in since 2007 or so, once the preapp data in meetings is parseable
- TIMEZONE
Public Class Methods
list of board meeting times as listed in committers/board/calendar.txt
# File lib/whimsy/asf/board.rb, line 49 def self.calendar svn = ASF::SVN.find('board') return [] unless svn txt = File.read(File.join(svn, 'calendar.txt')) times = txt.scan(/^\s+\*\)\s(.*)/).flatten times.map {|time| TIMEZONE.parse(time)} end
Return the display name for the uid Fails if there is no entry, so check first using directorHasId?
# File lib/whimsy/asf/board.rb, line 162 def self.directorDisplayName(id) DIRECTOR_MAP[id] && DIRECTOR_MAP[id][DISPLAY_NAME] end
Return the first name for the uid Fails if there is no entry, so check first using directorHasId?
# File lib/whimsy/asf/board.rb, line 156 def self.directorFirstName(id) DIRECTOR_MAP[id] && DIRECTOR_MAP[id][FIRST_NAME] end
Does the uid have an entry in the director initials table?
# File lib/whimsy/asf/board.rb, line 144 def self.directorHasId?(id) DIRECTOR_MAP[id] end
Return the initials for the uid Fails if there is no entry, so check first using directorHasId?
# File lib/whimsy/asf/board.rb, line 150 def self.directorInitials(id) DIRECTOR_MAP[id] && DIRECTOR_MAP[id][INITIALS] end
sorted list of Directors default to names only if withId == true, then return hash: { id: {name: public_name}} This allows for returning additional data such as start of tenure sort is by last name
# File lib/whimsy/asf/board.rb, line 35 def self.directors(withId=false) if withId ASF::Service['board'].members. map {|person| [person.id, {name: person.public_name}]}. sort_by {|_id, hash| hash[:name].split(' ').rotate(-1)}.to_h else ASF::Service['board'].members. map(&:public_name). sort_by {|name| name.split(' ').rotate(-1)} end end
time of previous meeting
# File lib/whimsy/asf/board.rb, line 78 def self.lastMeeting next_meeting = self.nextMeeting time = self.calendar.select {|t| t < next_meeting}.max unless time require 'chronic' this_month = Time.now.strftime('%B') time ||= Chronic.parse("3rd wednesday in #{this_month}") if not time or time > Time.now.utc time = Chronic.parse('3rd wednesday last month') end time = TIMEZONE.parse("#{time.to_date} 21:30") end time end
time of next meeting
# File lib/whimsy/asf/board.rb, line 58 def self.nextMeeting time = self.calendar.select {|t| t > Time.now.utc}.min unless time require 'chronic' this_month = Time.now.strftime('%B') time = Chronic.parse("3rd wednesday in #{this_month}") if not time or time < Time.now.utc time = Chronic.parse('3rd wednesday next month') end time = TIMEZONE.parse("#{time.to_date} 21:30") end time end
list of PMCs reporting in the specified meeting
# File lib/whimsy/asf/board.rb, line 99 def self.reporting(meeting) month = meeting.strftime('%B') ASF::Committee.load_committee_info ASF::Committee.pmcs.select do |pmc| pmc.report.split(', ').include? month or pmc.report == 'Every month' or pmc.report.start_with? 'Next month' end end
Convert a time to a timeanddate link, shortened if possible. Note: the path must be adjusted if the TIMEZONE
changes.
# File lib/whimsy/asf/board.rb, line 11 def self.tzlink(time) # build full time zone link path = '/worldclock/fixedtime.html?iso=' + time.strftime('%Y-%m-%dT%H:%M:%S') + '&msg=ASF+Board+Meeting' # path += '&p1=137' # time zone for PST/PDT locality link = "http://www.timeanddate.com/#{path}" # try to shorten time zone link begin shorten = 'http://www.timeanddate.com/createshort.html?url=' + CGI.escape(path) + '&confirm=1' shorten = URI.parse(shorten).read[/id=selectable>(.*?)</, 1] link = shorten if shorten end link end