Class: PhusionPassenger::AbstractInstaller
- Defined in:
- lib/phusion_passenger/abstract_installer.rb
Overview
Abstract base class for text mode installers. Used by passenger-install-apache2-module and passenger-install-nginx-module.
Subclasses must at least implement the #run_steps method which handles the installation itself.
Usage:
installer = ConcereteInstallerClass.new(...)
installer.run
Direct Known Subclasses
Defined Under Namespace
Classes: Abort, CommandError
Constant Summary collapse
- PASSENGER_WEBSITE =
"https://www.phusionpassenger.com"
- PHUSION_WEBSITE =
"www.phusion.nl"
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ AbstractInstaller
constructor
Create an AbstractInstaller.
-
#run ⇒ Object
Start the installation by calling the #install! method.
Constructor Details
#initialize(options = {}) ⇒ AbstractInstaller
Create an AbstractInstaller. All options will be stored as instance variables, for example:
installer = AbstractInstaller.new(:foo => "bar")
installer.instance_variable_get(:"@foo") # => "bar"
58 59 60 61 62 63 64 |
# File 'lib/phusion_passenger/abstract_installer.rb', line 58 def initialize( = {}) @stdout = STDOUT @stderr = STDERR .each_pair do |key, value| instance_variable_set(:"@#{key}", value) end end |
Instance Method Details
#run ⇒ Object
Start the installation by calling the #install! method.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/phusion_passenger/abstract_installer.rb', line 67 def run before_install run_steps return true rescue Abort puts return false rescue SignalException, SystemExit raise rescue PlatformInfo::RuntimeError => e new_screen puts "<red>An error occurred</red>" puts puts e. exit 1 rescue Exception => e (e) exit 2 ensure after_install end |