| Class | WEBrick::HTTPAuth::Htgroup |
| In: |
webrick/httpauth/htgroup.rb
|
| Parent: | Object |
# File webrick/httpauth/htgroup.rb, line 15 def initialize(path) @path = path @mtime = Time.at(0) @group = Hash.new open(@path,"a").close unless File::exist?(@path) reload end
# File webrick/httpauth/htgroup.rb, line 56 def add(group, members) @group[group] = members(group) | members end
# File webrick/httpauth/htgroup.rb, line 37 def flush(output=nil) output ||= @path tmp = Tempfile.new("htgroup", File::dirname(output)) begin @group.keys.sort.each{|group| tmp.puts(format("%s: %s", group, self.members(group).join(" "))) } tmp.close File::rename(tmp.path, output) rescue tmp.close(true) end end
ruby-doc.org is a community service provided by Happy Camper Studios, a Phoenix, Arizona, Ruby application development company.
Documentation content on ruby-doc.org is provided by remarkable members of the Ruby community.
For more information on the Ruby programming language, visit ruby-lang.org.
Want to help improve Ruby's API docs? See Ruby Documentation Guidelines.