flush(output=nil)
public
Flush the group database. If output is given the database will be
written there instead of to the original path.
# File lib/webrick/httpauth/htgroup.rb, line 64
def flush(output=nil)
output ||= @path
tmp = Tempfile.create("htgroup", File::dirname(output))
begin
@group.keys.sort.each{|group|
tmp.puts(format("%s: %s", group, self.members(group).join(" ")))
}
ensure
tmp.close
if $!
File.unlink(tmp.path)
else
return File.rename(tmp.path, output)
end
end
end