apache-config-generator/lib/apache/mpm_prefork.rb
2010-05-05 12:25:07 -04:00

35 lines
824 B
Ruby

module Apache
module MPM
class Prefork
class << self
def build(&block)
@config = ['', '# Prefork config', '']
self.instance_eval(&block)
@config
end
def method_missing(method, *opts)
if which = {
:start => 'StartServers',
:spares => [ 'MinSpareServers', 'MaxSpareServers' ],
:limit => 'ServerLimit',
:clients => 'MaxClients',
:max_requests => 'MaxRequestsPerChild'
}[method]
case which
when String
@config << "#{which} #{opts * " "}"
when Array
which.each do |w|
@config << "#{w} #{opts.shift}"
end
end
end
end
end
end
end
end