Class: Vito::Recipes::Apache::Install
- Inherits:
-
Vito::Recipe
- Object
- Vito::Recipe
- Vito::Recipes::Apache::Install
- Defined in:
- lib/vito/recipes/apache/install.rb
Constant Summary collapse
- APACHE_HOMEDIR =
"/etc/apache2"
Instance Method Summary collapse
-
#initialize(options, connection) ⇒ Install
constructor
A new instance of Install.
- #install ⇒ Object
-
#vhosts(options = {}) ⇒ Object
Used in the Apache block.
Methods inherited from Vito::Recipe
#depends_on_recipe, #install_os_dependencies, #method_missing, #os, #program_version, #query, #remove, #run_command, #update, #with, #with?
Constructor Details
#initialize(options, connection) ⇒ Install
Returns a new instance of Install.
7 8 9 10 |
# File 'lib/vito/recipes/apache/install.rb', line 7 def initialize(, connection) @vhosts = {} super end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Vito::Recipe
Instance Method Details
#install ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/vito/recipes/apache/install.rb', line 12 def install if installed? Vito::Log.write "Apache2 already installed." else Vito::Log.write "Installing Apache2" install_apache end end |
#vhosts(options = {}) ⇒ Object
Used in the Apache block
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/vito/recipes/apache/install.rb', line 22 def vhosts( = {}) @vhosts[:rails_env] = [:rails_env] || "production" @vhosts[:servername] = [:servername] || "www.example.com" @vhosts[:ports] = [:ports] || [80] @vhosts[:ports] << 443 if Array([:with]).include?(:ssl) @vhosts[:path] = [:path] raise InvalidApacheVhosts, "VHosts' app path not specified" unless @vhosts[:path] raise InvalidApacheVhosts, "VHosts' app port not specified" unless @vhosts[:ports] end |