Class: Apache::Modules
- Inherits:
-
Object
- Object
- Apache::Modules
- Defined in:
- lib/apache/modules.rb
Overview
Create lists of modules to load in the Apache 2.2 style (with LoadModule only)
Class Attribute Summary collapse
-
.modules ⇒ Object
Returns the value of attribute modules.
Class Method Summary collapse
-
.build(*modules, &block) ⇒ Object
Build a block of LoadModule commands.
-
.method_missing(method, *args) ⇒ Object
The method name becomes the module core name.
-
.reset! ⇒ Object
Reset the list of modules to output.
Class Attribute Details
.modules ⇒ Object
Returns the value of attribute modules.
5 6 7 |
# File 'lib/apache/modules.rb', line 5 def modules @modules end |
Class Method Details
.build(*modules, &block) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/apache/modules.rb', line 23 def build(*modules, &block) reset! modules.each { |mod| self.send(mod) } self.instance_eval(&block) if block [ '' ] + @modules + [ '' ] end |
.method_missing(method, *args) ⇒ Object
The method name becomes the module core name
33 34 35 36 37 |
# File 'lib/apache/modules.rb', line 33 def method_missing(method, *args) module_name = "#{method}_module" module_path = args[0] || "modules/mod_#{method}.so" @modules << [ 'LoadModule', *[ module_name, module_path ].quoteize ] * " " end |
.reset! ⇒ Object
Reset the list of modules to output
8 9 10 |
# File 'lib/apache/modules.rb', line 8 def reset! @modules = [] end |