class Shaddox::Installer

Public Class Methods

autodetect(pvr) click to toggle source
# File lib/shaddox/installer.rb, line 4
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:"

    menu.choice(:manual) { return ManualInstaller.new(pvr) }
    menu.choice(:apt) { return AptInstaller.new(pvr) }
    menu.choice(:brew) { return BrewInstaller.new(pvr) }
  end
end
new(pvr) click to toggle source
# File lib/shaddox/installer.rb, line 19
def initialize(pvr)
  @pvr = pvr
end

Public Instance Methods

install(package) click to toggle source
# File lib/shaddox/installer.rb, line 22
def install(package)
  raise "This should be implemented by subclass."
end
installed?(cmd) click to toggle source
# File lib/shaddox/installer.rb, line 25
def installed?(cmd)
  @pvr.availiable?(cmd)
end