lib/shaddox/installer.rb in shaddox-0.1.2 vs lib/shaddox/installer.rb in shaddox-0.1.3
- old
+ new
@@ -3,10 +3,11 @@
class Installer
def self.autodetect(pvr)
return AptInstaller.new(pvr) if pvr.availiable? "apt-get"
return BrewInstaller.new(pvr) if pvr.availiable? "brew"
return PacmanInstaller.new(pvr) if pvr.availiable? "pacman"
+ return YumInstaller.new(pvr) if pvr.availiable? "yum"
warn "Installer could not be automatically identified.", 1
require 'highline/import'
choose do |menu|
menu.prompt = "Please select a package manager to use:"
@@ -65,9 +66,17 @@
# @pvr.exec("pacman -Sy")
# end
def install(package)
return if installed?(package)
@pvr.exec("pacman -S #{package}")
+ raise "Could not install #{package}" unless installed?(package)
+ end
+ end
+
+ class YumInstaller < Installer
+ def install(package)
+ return if installed?(package)
+ @pvr.exec("yum install #{package}")
raise "Could not install #{package}" unless installed?(package)
end
end
end