apache-config-generator/lib/apache/mpm_prefork.rb

35 lines
824 B
Ruby
Raw Normal View History

2010-05-05 16:25:07 +00:00
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