Class: LoomExt::CoreMods::Package::AptAdapter

Inherits:
DpkgAdapter show all
Defined in:
lib/loomext/coremods/package/adapter.rb

Instance Attribute Summary

Attributes inherited from PkgAdapter

#loom

Instance Method Summary collapse

Methods inherited from DpkgAdapter

#installed?

Methods inherited from PkgAdapter

#ensure_installed, #initialize, #installed?

Constructor Details

This class inherits a constructor from LoomExt::CoreMods::Package::PkgAdapter

Instance Method Details

#install(pkg_name) ⇒ Object



56
57
58
59
# File 'lib/loomext/coremods/package/adapter.rb', line 56

def install(pkg_name)
  loom.x "apt-get", "-y", "install", pkg_name
#        loom.net.with_net { loom << "echo apt-get install #{pkg_name}" }
end

#uninstall(pkg_name) ⇒ Object



61
62
63
# File 'lib/loomext/coremods/package/adapter.rb', line 61

def uninstall(pkg_name)
  loom << "echo apt uninstall"
end

#update_cacheObject



65
66
67
68
# File 'lib/loomext/coremods/package/adapter.rb', line 65

def update_cache
#        loom.net.with_net { loom << "apt update" }
  loom.x "apt", "-y", "update"
end

#upgrade(pkg_name = nil) ⇒ Object



70
71
72
73
74
# File 'lib/loomext/coremods/package/adapter.rb', line 70

def upgrade(pkg_name = nil)
#        loom.net.with_net { loom << "apt upgrade" }
  args = ["apt-get", "-y", "upgrade", pkg_name].compact
  loom.x(*args)
end