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

25 lines
528 B
Ruby
Raw Normal View History

2010-05-04 15:48:59 +00:00
require 'apache/quoteize'
module Apache
class Modules
class << self
include Apache::Quoteize
def build(*modules, &block)
@modules = []
modules.each { |m| self.send(m) }
self.instance_eval(&block) if block
@modules
end
def method_missing(method, *args)
module_name = "#{method}_module"
module_path = args[0] || "modules/mod_#{method}.so"
@modules << [ 'LoadModule', *quoteize(module_name, module_path) ] * " "
end
end
end
end