Class Facter::Util::Resolution
In: lib/facter/util/resolution.rb
Parent: Object

Methods

Constants

INTERPRETER = Facter::Util::Config.is_windows? ? "cmd.exe" : "/bin/sh"

Attributes

code  [RW] 
interpreter  [RW] 
name  [RW] 
timeout  [RW] 

Public Class methods

Determine in a platform-specific way whether a path is absolute. This defaults to the local platform if none is specified.

Execute a program and return the output of that program.

Returns nil if the program can‘t be found, or if there is a problem executing the code.

Expand the executable of a commandline to an absolute path. The executable is the first word of the commandline. If the executable contains spaces, it has be but in double quotes to be properly recognized.

Returns the commandline with the expanded binary or nil if the binary can‘t be found. If the path to the binary contains quotes, the whole binary is put in quotes.

Create a new resolution mechanism.

Returns the locations to be searched when looking for a binary. This is currently determined by the PATH environment variable plus /sbin and /usr/sbin when run on unix

Determine the full path to a binary. If the supplied filename does not already describe an absolute path then different locations (determined by self.search_paths) will be searched for a match.

Returns nil if no matching executable can be found otherwise returns the expanded pathname.

Public Instance methods

Add a new confine to the resolution mechanism.

We need this as a getter for ‘timeout’, because some versions of ruby seem to already have a ‘timeout’ method and we can‘t seem to override the instance methods, somehow.

Is this resolution mechanism suitable on the system in question?

How we get a value for our resolution mechanism.

Return the importance of this resolution.

[Validate]