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:



224
225
226
227
228
229
230
231
# File 'lib/git/lighttp.rb', line 224

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



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

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

#members(group) ⇒ Object



233
234
235
# File 'lib/git/lighttp.rb', line 233

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