Module PhusionPassenger::Utils
In: src/ruby_supportlib/phusion_passenger/utils.rb
src/ruby_supportlib/phusion_passenger/utils/hosts_file_parser.rb
src/ruby_supportlib/phusion_passenger/utils/file_system_watcher.rb
src/ruby_supportlib/phusion_passenger/utils/terminal_choice_menu.rb
src/ruby_supportlib/phusion_passenger/utils/tee_input.rb
src/ruby_supportlib/phusion_passenger/utils/download.rb
src/ruby_supportlib/phusion_passenger/utils/native_support_utils.rb
src/ruby_supportlib/phusion_passenger/utils/lock.rb
src/ruby_supportlib/phusion_passenger/utils/json.rb
src/ruby_supportlib/phusion_passenger/utils/unseekable_socket.rb
src/ruby_supportlib/phusion_passenger/utils/tmpio.rb
src/ruby_supportlib/phusion_passenger/utils/ansi_colors.rb

Utility functions.

Methods

Classes and Modules

Module PhusionPassenger::Utils::AnsiColors
Module PhusionPassenger::Utils::Download
Module PhusionPassenger::Utils::NativeSupportUtils
Class PhusionPassenger::Utils::AnsiColorsPrinter
Class PhusionPassenger::Utils::FileSystemWatcher
Class PhusionPassenger::Utils::GeneratorTest
Class PhusionPassenger::Utils::HostsFileParser
Class PhusionPassenger::Utils::JSON
Class PhusionPassenger::Utils::Lock
Class PhusionPassenger::Utils::ParserTest
Class PhusionPassenger::Utils::TeeInput
Class PhusionPassenger::Utils::TerminalChoiceMenu
Class PhusionPassenger::Utils::TmpIO
Class PhusionPassenger::Utils::UnseekableSocket

Constants

FileSystemWatcher = NativeSupport::FileSystemWatcher

Public Class methods

Like Dir.mktmpdir, but creates shorter filenames.

Public Instance methods

Base64-encodes the given data. Newlines are removed. This is like `Base64.strict_encode64`, but also works on Ruby 1.8 which doesn‘t have that method.

A wrapper around Thread.new that installs a default exception handler. If an uncaught exception is encountered, it will immediately log the exception and abort the entire program.

Thread#abort_on_exception is also supposed to do that, but the problem is that it is implemented by forwarding the uncaught exception to the main thread, which may not expect that particular exception and may not handle it properly. The exception could be forwarded to the main thread during any point of the main thread‘s execution.

This method requires ‘thread’ and ‘ruby_core_enhancements’. If ‘debug_logging’ is loaded and included in the current module, it will use that for logging.

Generate a long, cryptographically secure random ID string, which is also a valid filename.

Returns a string which reports the backtraces for all threads, or if that‘s not supported the backtrace for the current thread.

Print the given exception, including the stack trace, to STDERR.

current_location is a string which describes where the code is currently at. Usually the current class name will be enough. It may be nil.

This method requires ‘ruby_core_enhancements’. If ‘debug_logging’ is loaded and included in the current module, it will use that for logging.

Checks whether the given process exists.

[Validate]