# File lib/facter/core/execution/posix.rb, line 26 def absolute_path?(path) !! (path =~ ABSOLUTE_PATH_REGEX) end
# File lib/facter/core/execution/posix.rb, line 33 def expand_command(command) exe = nil args = nil if (match = (command.match(DOUBLE_QUOTED_COMMAND) || command.match(SINGLE_QUOTED_COMMAND))) exe, args = match.captures else exe, args = command.split(/ /,2) end if exe and (expanded = which(exe)) expanded = "'#{expanded}'" if expanded.match(/\s/) expanded << " #{args}" if args return expanded end end
# File lib/facter/core/execution/posix.rb, line 5 def search_paths # Make sure facter is usable even for non-root users. Most commands # in /sbin (like ifconfig) can be run as non privileged users as # long as they do not modify anything - which we do not do with facter ENV['PATH'].split(File::PATH_SEPARATOR) + DEFAULT_SEARCH_PATHS end
Generated with the Darkfish Rdoc Generator 2.