module Josef::Local

Public Instance Methods

exculued?(group_mail_address) click to toggle source
# File lib/josef/local.rb, line 21
def exculued?(group_mail_address)
  exculued_groups.include?(group_mail_address)
end
exculued_groups(exculued_groups_file = nil) click to toggle source
# File lib/josef/local.rb, line 25
def exculued_groups(exculued_groups_file = nil)
  @_exculued_groups ||= exculued_groups!(exculued_groups_file)
end
exculued_groups!(exculued_groups_file) click to toggle source
# File lib/josef/local.rb, line 29
def exculued_groups!(exculued_groups_file)
  return [] if exculued_groups_file.nil?

  YAML.load_file(exculued_groups_file).symbolize_keys[:exculued_groups]
end
local(local_file = nil) click to toggle source
# File lib/josef/local.rb, line 6
def local(local_file = nil)
  @_local ||= local!(local_file)
end
local!(local_file) click to toggle source
# File lib/josef/local.rb, line 10
def local!(local_file)
  return [] if local_file.nil?

  local_groups = YAML.load_file(local_file).map{|h| h.deep_symbolize_keys}
  local_groups.each do | group |
    group[:members] = [] if group[:members].nil?
  end

  local_groups
end