Abstract base class for text mode installers. Used by passenger-install-apache2-module and passenger-install-nginx-module.
Subclasses must at least implement the install! method which handles the installation itself.
Usage:
installer = ConcereteInstallerClass.new(options...) installer.start
Create an AbstractInstaller. All options will be stored as instance variables, for example:
installer = AbstractInstaller.new(:foo => "bar") installer.instance_variable_get(:"@foo") # => "bar"
# File lib/phusion_passenger/abstract_installer.rb, line 54 def initialize(options = {}) options.each_pair do |key, value| instance_variable_set(:"@#{key}", value) end end
Start the installation by calling the install! method.
# File lib/phusion_passenger/abstract_installer.rb, line 61 def start before_install install! rescue PlatformInfo::RuntimeError => e new_screen color_puts "<red>An error occurred</red>" puts puts e.message exit 1 ensure after_install end