blob: 85c90637a177b0ae2d98da95e9bb3aee7fe01da8 [file] [log] [blame]
module ASF
class Authorization
include Enumerable
def self.find_by_id(value)
new.select {|auth, ids| ids.include? value}.map(&:first)
end
def initialize(file='asf')
@file = file
end
def each
auth = ASF::SVN['infra/infrastructure/trunk/subversion/authorization']
File.read("#{auth}/#{@file}-authorization-template").
scan(/^([-\w]+)=(\w.*)$/).each do |pmc, ids|
yield pmc, ids.split(',')
end
end
end
class Person
def auth
@auths ||= ASF::Authorization.find_by_id(name)
end
end
end