This module autodetects various platform-specific information, and provides that information through constants.
Users can change the detection behavior by setting the environment variable APXS2 to the correct ‘apxs’ (or ‘apxs2’) binary, as provided by Apache.
Methods
Constants
| RUBY | = | Config::CONFIG['bindir'] + '/' + Config::CONFIG['RUBY_INSTALL_NAME'] |
| The absolute path to the current Ruby interpreter. | ||
| GEM | = | determine_gem_command |
| The correct ‘gem’ command for this Ruby interpreter. | ||
| APXS2 | = | find_apxs2 |
| The absolute path to the ‘apxs’ or ‘apxs2’ executable. | ||
| APACHE2_BINDIR | = | determine_apache2_bindir |
| The absolute path to the Apache 2 ‘bin’ directory. | ||
| APACHE2_SBINDIR | = | determine_apache2_sbindir |
| The absolute path to the Apache 2 ‘sbin’ directory. | ||
| APACHE2CTL | = | find_apache2ctl |
| The absolute path to the ‘apachectl’ or ‘apache2ctl’ binary. | ||
| HTTPD | = | find_httpd |
| The absolute path to the Apache binary (that is, ‘httpd’, ‘httpd2’, ‘apache’ or ‘apache2’). | ||
| APXS2_FLAGS | = | determine_apxs2_flags |
| The C compiler flags that are necessary to compile an Apache module. | ||
| APR1_LIBS | = | determine_apr1_info |
| MULTI_ARCH_FLAGS | = | determine_multi_arch_flags |
| The C compiler flags that are necessary for building binaries in the same architecture(s) as Apache. | ||
| LIBEXT | = | determine_library_extension |
| The current platform‘s shared library extension (‘so’ on most Unices). | ||
| LINUX_DISTRO | = | determine_linux_distro |
| An identifier for the current Linux distribution. nil if the operating system is not Linux. | ||
Public Class methods
Check whether the specified command is in $PATH, and return its absolute filename. Returns nil if the command is not found.
This function exists because system(‘which’) doesn‘t always behave correctly, for some weird reason.
[ show source ]
# File lib/passenger/platform_info.rb, line 209
209: def self.find_command(name)
210: ENV['PATH'].split(File::PATH_SEPARATOR).detect do |directory|
211: path = File.join(directory, name.to_s)
212: if File.executable?(path)
213: return path
214: end
215: end
216: return nil
217: end