### Home Classes Methods

### In Files

- lib/phusion_passenger/platform_info/depcheck.rb

### Namespace

- CLASS PhusionPassenger::PlatformInfo::Depcheck::ConsoleRunner
- CLASS PhusionPassenger::PlatformInfo::Depcheck::Dependency

### Methods

- ::define
- ::find
- ::load

### Class/Module Index

Quicksearch

- PhusionPassenger
- PhusionPassenger::AbstractInstaller
- PhusionPassenger::AbstractInstaller::Abort
- PhusionPassenger::AbstractInstaller::CommandError
- PhusionPassenger::AdminTools
- PhusionPassenger::AdminTools::MemoryStats
- PhusionPassenger::AdminTools::MemoryStats::Process
- PhusionPassenger::AdminTools::ServerInstance
- PhusionPassenger::AdminTools::ServerInstance::CorruptedDirectoryError
- PhusionPassenger::AdminTools::ServerInstance::GenerationsAbsentError
- PhusionPassenger::AdminTools::ServerInstance::Group
- PhusionPassenger::AdminTools::ServerInstance::Process
- PhusionPassenger::AdminTools::ServerInstance::RoleDeniedError
- PhusionPassenger::AdminTools::ServerInstance::StaleDirectoryError
- PhusionPassenger::AdminTools::ServerInstance::Stats
- PhusionPassenger::AdminTools::ServerInstance::UnsupportedGenerationStructureVersionError
- PhusionPassenger::AnalyticsLogger
- PhusionPassenger::AnalyticsLogger::Connection
- PhusionPassenger::AnalyticsLogger::Lock
- PhusionPassenger::AnalyticsLogger::Log
- PhusionPassenger::ClassicRails
- PhusionPassenger::ClassicRails::CGIFixed
- PhusionPassenger::ClassicRails::ThreadHandlerExtension
- PhusionPassenger::ConsoleTextTemplate
- PhusionPassenger::DebugLogging
- PhusionPassenger::LoaderSharedHelpers
- PhusionPassenger::MessageChannel
- PhusionPassenger::MessageChannel::InvalidHashError
- PhusionPassenger::MessageClient
- PhusionPassenger::NativeSupportLoader
- PhusionPassenger::Packaging
- PhusionPassenger::PlatformInfo
- PhusionPassenger::PlatformInfo::Depcheck
- PhusionPassenger::PlatformInfo::Depcheck::ConsoleRunner
- PhusionPassenger::PlatformInfo::Depcheck::Dependency
- PhusionPassenger::PlatformInfo::RuntimeError
- PhusionPassenger::Plugin
- PhusionPassenger::PreloaderSharedHelpers
- PhusionPassenger::Rack
- PhusionPassenger::Rack::OutOfBandGc
- PhusionPassenger::Rack::ThreadHandlerExtension
- PhusionPassenger::Rails3Extensions
- PhusionPassenger::Rails3Extensions::AnalyticsLogging
- PhusionPassenger::Rails3Extensions::AnalyticsLogging::ACExtension
- PhusionPassenger::Rails3Extensions::AnalyticsLogging::ASBenchmarkableExtension
- PhusionPassenger::Rails3Extensions::AnalyticsLogging::ExceptionLogger
- PhusionPassenger::RequestHandler
- PhusionPassenger::RequestHandler::ThreadHandler
- PhusionPassenger::RequestHandler::ThreadHandler::Interrupted
- PhusionPassenger::SharedConstants
- PhusionPassenger::Standalone
- PhusionPassenger::Standalone::AppFinder
- PhusionPassenger::Standalone::Command
- PhusionPassenger::Standalone::ConfigFile
- PhusionPassenger::Standalone::ConfigFile::DisallowedContextError
- PhusionPassenger::Standalone::HelpCommand
- PhusionPassenger::Standalone::Main
- PhusionPassenger::Standalone::PackageRuntimeCommand
- PhusionPassenger::Standalone::RuntimeInstaller
- PhusionPassenger::Standalone::StartCommand
- PhusionPassenger::Standalone::StatusCommand
- PhusionPassenger::Standalone::StopCommand
- PhusionPassenger::Standalone::Utils
- PhusionPassenger::Standalone::VersionCommand
- PhusionPassenger::Utils
- PhusionPassenger::Utils::AnsiColors
- PhusionPassenger::Utils::FileSystemWatcher
- PhusionPassenger::Utils::FileSystemWatcher::DirInfo
- PhusionPassenger::Utils::FileSystemWatcher::FileInfo
- PhusionPassenger::Utils::HostsFileParser
- PhusionPassenger::Utils::TeeInput
- PhusionPassenger::Utils::TmpIO
- PhusionPassenger::Utils::UnseekableSocket
- CommonLibraryBuilder
- Exception
- GC
- IO
- Object
- Signal

No matching classes.

# PhusionPassenger::PlatformInfo::Depcheck

Almost all software require other software in order to run. We call those other software 'dependencies'. Reliably checking for dependencies can be difficult. Helping the user in case a dependency is not installed (or doesn't seem to be installed) is more difficult still.

The Depcheck framework seeks to make all this easier. It allows the programmer to write "specs" which contain dependency checking code in a structured way. The programmer defines a dependency's basic information (name, website, etc), defines installation instructions (which may be customized per platform) and defines code for checking whether the dependency actually exists. The Depcheck framework:

    * Provides helpers for checking for the existance of commands, libraries,
      headers, etc.
    * Registers all dependency specs in a way that can be easily accessed
      structurally.
    * Allows user-friendly display of dependency checking progress and user help
      instructions.

Most dependency checking code (e.g. autoconf) is very straightforward: they just check for the existance of a command, library, header, etc and either report "found" or "not found". In our experience the world is unfortunately not that simple. Users can have multiple versions of a dependency installed, where some dependencies are suitable while others are not. Therefore specs should print as many details about the dependency as possible (location, version, etc) so that the user can override any decisions if necessary.

### Constants

THIS_DIR

### Public Class Methods

define(identifier, &block) click to toggle source

    # File lib/phusion_passenger/platform_info/depcheck.rb, line 50
    def self.define(identifier, &block)
            @@database[identifier.to_s] = block
    end

find(identifier) click to toggle source

    # File lib/phusion_passenger/platform_info/depcheck.rb, line 54
    def self.find(identifier)
            # We lazy-initialize everything in order to save resources. This also
            # allows blocks to perform relatively expensive checks without hindering
            # startup time.
            identifier = identifier.to_s
            result = @@database[identifier]
            if result.is_a?(Proc)
                    result = Dependency.new(&result)
                    @@database[identifier] = result
            end
            result
    end

load(partial_filename) click to toggle source

    # File lib/phusion_passenger/platform_info/depcheck.rb, line 41
    def self.load(partial_filename)
            if !@@loaded[partial_filename]
                    filename = "#{THIS_DIR}/#{partial_filename}.rb"
                    content = File.read(filename)
                    instance_eval(content, filename)
                    @@loaded[partial_filename] = true
            end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.