Class: Git::Lighttp::Htgroup

Inherits:
Object
  • Object
show all
Defined in:
lib/git/lighttp.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(file) {|_self| ... } ⇒ Htgroup

Returns a new instance of Htgroup.

Yields:

  • (_self)

Yield Parameters:



230
231
232
233
234
235
236
237
# File 'lib/git/lighttp.rb', line 230

def initialize(file)
  require 'webrick/httpauth/htgroup'
  WEBrick::HTTPAuth::Htgroup.class_eval do
    attr_reader :group
  end
  @handler = WEBrick::HTTPAuth::Htgroup.new(file)
  yield self if block_given?
end

Instance Method Details

#groups(username) ⇒ Object



243
244
245
246
247
# File 'lib/git/lighttp.rb', line 243

def groups(username)
  @handler.group.select do |_group, members|
    members.include? username
  end.keys
end

#members(group) ⇒ Object



239
240
241
# File 'lib/git/lighttp.rb', line 239

def members(group)
  @handler.members(group)
end