Class: RightConf::PassengerConfigurator

Inherits:
Object
  • Object
show all
Includes:
Configurator
Defined in:
lib/rconf/configurators/passenger_configurator.rb

Constant Summary collapse

PASSENGER_GEM_VERSION =
'2.2.15'
DEFAULT_NGINX_INSTALL =
['/opt/nginx', File.join(ENV['HOME'], 'nginx')]

Instance Method Summary collapse

Methods included from Configurator

#[], included, #post_process, #run, #signature, #validate

Methods included from ProgressReporter

included, report_to_file, report_to_stdout

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RightConf::Configurator

Instance Method Details

#run_linuxObject Also known as: run_darwin

Install passenger gem in given ruby then run nginx install script

Return

true

Always return true



40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/rconf/configurators/passenger_configurator.rb', line 40

def run_linux
  set_defaults
  report_check("Checking for passenger gem #{gem_version}")
  res = Command.execute_in_ruby('gem', 'list', 'passenger')
  success = (res.output =~ /^passenger \(#{gem_version}\)$/)
  report_result(success)
  install_gem unless success
  report_check('Checking for passenger+nginx')
  res = Command.execute('which', 'nginx').success?
  res = File.exists?(File.join(install_path, 'sbin', 'nginx')) unless res
  report_result(res)
  install_passenger unless res
  true
end

#run_windowsObject

Not implemented on windows

Raise

(Exception)

Always raise



60
61
62
# File 'lib/rconf/configurators/passenger_configurator.rb', line 60

def run_windows
  raise "Passenger is not supported on Windows!"
end