Class: Dply::Yum
Instance Method Summary collapse
-
#initialize(pkgs, sudo: false) ⇒ Yum
constructor
A new instance of Yum.
- #install ⇒ Object
- #installed? ⇒ Boolean
Methods included from Helper
#cmd, #error, #git, #logger, #stringify_values!, #symlink
Constructor Details
#initialize(pkgs, sudo: false) ⇒ Yum
Returns a new instance of Yum.
8 9 10 11 |
# File 'lib/dply/yum.rb', line 8 def initialize(pkgs, sudo: false) @pkgs = pkgs @sudo = sudo end |
Instance Method Details
#install ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/dply/yum.rb', line 13 def install return if installed? command = "" command << "sudo -n " if @sudo command << "yum install -y #{not_installed_pkgs.join(' ')}" cmd command not_installed = query_not_installed if not_installed.size != 0 error "following pkgs not installed: #{not_installed.join(" ")}" end end |
#installed? ⇒ Boolean
25 26 27 |
# File 'lib/dply/yum.rb', line 25 def installed? not_installed_pkgs.size == 0 end |