Class: Plat4m::Sniffer::Linux::NixManager

Inherits:
PkgManager
  • Object
show all
Defined in:
lib/plat4m/sniff/linux.rb

Direct Known Subclasses

Apt, Dnf, Pacman, Zypper

Instance Method Summary collapse

Methods inherited from PkgManager

#available?, #has_sudo?, #install, #installed?, #select_available, #select_uninstalled, #uninstall

Constructor Details

#initialize(distro) ⇒ NixManager

Returns a new instance of NixManager.



97
98
99
100
101
# File 'lib/plat4m/sniff/linux.rb', line 97

def initialize(distro)
  super()
  @distro = distro
  @has_sudo = system('command -v sudo > /dev/null')
end

Instance Method Details

#make_install_command(*pkgs) ⇒ Object



103
104
105
# File 'lib/plat4m/sniff/linux.rb', line 103

def make_install_command(*pkgs)
  auth_cmd(get_install_command(*pkgs))
end

#make_uninstall_command(*pkgs) ⇒ Object



107
108
109
# File 'lib/plat4m/sniff/linux.rb', line 107

def make_uninstall_command(*pkgs)
  auth_cmd(get_uninstall_command(*pkgs))
end