Class: Sunshine::Yum
- Inherits:
-
Dependency
- Object
- Dependency
- Sunshine::Yum
- Defined in:
- lib/sunshine/package_managers/yum.rb
Overview
The Yum dependency class supports most of yum’s installation features:
dependency_lib.instance_eval do
yum "ruby", :version => '1.9',
:rel => 'release-num',
:arch => 'i386',
:epoch => 'some-epoch'
end
See the Dependency class for more info.
Instance Attribute Summary
Attributes inherited from Dependency
#children, #name, #parents, #pkg
Class Method Summary collapse
-
.system_manager?(shell = nil) ⇒ Boolean
Checks if dependency type is valid for a given shell.
Instance Method Summary collapse
-
#initialize(name, options = {}, &block) ⇒ Yum
constructor
A new instance of Yum.
Methods inherited from Dependency
#add_child, #check, #check_test, #child_dependencies, #install, #install!, #install_parents!, #installed?, #missing_parents?, #parent_dependencies, #requires, sudo, sudo=, #to_s, #uninstall, #uninstall!, #uninstall_children!
Constructor Details
#initialize(name, options = {}, &block) ⇒ Yum
Returns a new instance of Yum.
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/sunshine/package_managers/yum.rb', line 20 def initialize(name, ={}, &block) super(name, ) do pkg_name = build_pkg_name @pkg.dup, install "yum install -y #{pkg_name}" uninstall "yum remove -y #{pkg_name}" check_test "yum list installed #{pkg_name} | grep -c #{@pkg}", '-ge 1' instance_eval(&block) if block_given? end end |