Class: Bwrap::Resolvers::Executable Private

Inherits:
Object
  • Object
show all
Defined in:
lib/bwrap/resolvers/executable.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Resolves for example symlinks and such stuff.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command = nil) ⇒ Executable

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Executable.

Parameters:

  • command (Array|String|nil) (defaults to: nil)

    The command given to Bwrap#run.



21
22
23
# File 'lib/bwrap/resolvers/executable.rb', line 21

def initialize command = nil
  self.command = command if command
end

Instance Attribute Details

#executablePathname|nil

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

May be either relative or absolute path. If relative, the path may be invalid.

Returns:

  • (Pathname|nil)

    The executable, without arguments



12
13
14
# File 'lib/bwrap/resolvers/executable.rb', line 12

def executable
  @executable
end

#executable_pathsHash<Pathname, :path|:symlink>|nil (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

If the executable is a symlink, contains each resolved symlink and the real target. Otherwise only contains the executable.

Returns:

  • (Hash<Pathname, :path|:symlink>|nil)

    Resolved paths to the command



18
19
20
# File 'lib/bwrap/resolvers/executable.rb', line 18

def executable_paths
  @executable_paths
end

Instance Method Details

#absolute_path?Bool

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns true if executable name parsed from command is absolute path, and not only the executable name.

Returns:

  • (Bool)

    true if path full path, false if it is only executable name



52
53
54
55
56
# File 'lib/bwrap/resolvers/executable.rb', line 52

def absolute_path?
  return false unless @executable

  @executable.absolute?
end

#command=(value) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The command given to Bwrap#run.



28
29
30
31
# File 'lib/bwrap/resolvers/executable.rb', line 28

def command= value
  self.executable = executable_from_command value
  @raw_command = value
end