Methods

Class/Module Index [+]

Quicksearch

PhusionPassenger::Config::ValidateInstallCommand

Constants

FAIL_EXIT_CODE

Signifies that there is at least 1 error.

WARN_EXIT_CODE

Signifies that there are no error, but at least 1 warning.

Public Class Methods

help() click to toggle source
# File lib/phusion_passenger/config/validate_install_command.rb, line 36
def self.help
        puts "Usage: passenger-config validate-install"
        puts "Validate this #{PROGRAM_NAME} installation."
        puts
        puts "Exit codes:"
        puts "  0 - All checks passed. No errors, no warnings."
        puts "  #{FAIL_EXIT_CODE} - There are some errors."
        puts "  #{WARN_EXIT_CODE} - There are no errors, but there are some warnings."
end

Public Instance Methods

run() click to toggle source
# File lib/phusion_passenger/config/validate_install_command.rb, line 46
def run
        if @argv[0] == '--help'
                self.class.help
                exit
        elsif @argv.size > 0
                self.class.help
                exit 1
        end

        begin
                require 'rubygems'
        rescue LoadError
        end
        PhusionPassenger.require_passenger_lib 'utils/ansi_colors'
        PhusionPassenger.require_passenger_lib 'platform_info'

        @error_count = 0
        @warning_count = 0

        prepare_terminal
        begin
                check_tools_in_path
                check_no_other_installs_in_path

                exit(FAIL_EXIT_CODE) if @error_count > 0
                exit(WARN_EXIT_CODE) if @warning_count > 0
        ensure
                reset_terminal
        end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.