Class: PhusionPassenger::AbstractInstaller

Inherits:
Object
  • Object
show all
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(options...)
installer.run

Direct Known Subclasses

Standalone::RuntimeInstaller

Defined Under Namespace

Classes: Abort, CommandError

Constant Summary collapse

PASSENGER_WEBSITE =
"https://www.phusionpassenger.com"
PHUSION_WEBSITE =
"www.phusion.nl"

Instance Method Summary collapse

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(options = {})
	@stdout = STDOUT
	@stderr = STDERR
	options.each_pair do |key, value|
		instance_variable_set(:"@#{key}", value)
	end
end

Instance Method Details

#runObject

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.message
	exit 1
rescue Exception => e
	show_support_options_for_installer_bug(e)
	exit 2
ensure
	after_install
end