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

calendar() click to toggle source

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
directorDisplayName(id) click to toggle source

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
directorFirstName(id) click to toggle source

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
directorHasId?(id) click to toggle source

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
directorInitials(id) click to toggle source

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
directors(withId=false) click to toggle source

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
lastMeeting() click to toggle source

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
nextMeeting() click to toggle source

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
reporting(meeting) click to toggle source

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