Sha256: f7f7723ac68476d8d34c818fc8f97978a53be643fee65148a78f1fe68cb6766d

Contents?: true

Size: 781 Bytes

Versions: 3

Compression:

Stored size: 781 Bytes

Contents

# Package, Yum capistrano helpers
module Capigen::Helpers::PackageHelper
  
  def setup_packager(packager)
    @packager = case packager.to_sym
    when :yum then Capigen::Packagers::Yum.new(self)
    end      
  end
  
  def ensure_packager    
    unless @packager
      logger.important "No packager defined, defaulting to yum." 
    
      # Currently only have 1 packager, so 
      setup_packager(:yum)
    end
  end
  
  def package_install(packages)
    ensure_packager
    @packager.install(packages)
  end
  
  def package_update(packages = [])
    ensure_packager
    @packager.update(packages)
  end
  
  def package_clean
    ensure_packager
    @packager.clean
  end
  
  def package_remove(packages)
    ensure_packager
    @packager.remove(packages)
  end
  
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
capigen-0.1.1 lib/capigen/helpers/package_helper.rb
capigen-0.1.3 lib/capigen/helpers/package_helper.rb
capigen-0.1.2 lib/capigen/helpers/package_helper.rb