lib/rconf/support/package_installer.rb in rconf-0.6.33 vs lib/rconf/support/package_installer.rb in rconf-0.6.34
- old
+ new
@@ -56,11 +56,12 @@
#
# === Return
# true:: Always return true
def install_linux_ubuntu(packages, opts)
return if packages.nil?
- args = packages.dup
+ args = packages.compact.dup
+ return if args.empty?
args << opts if opts
Command.sudo('apt-get', 'install', '-y', *args)
end
alias :install_linux_debian :install_linux_ubuntu
@@ -68,11 +69,12 @@
#
# === Return
# true:: Always return true
def install_linux_centos(packages, opts)
return if packages.nil?
- args = packages.dup
+ args = packages.compact.dup
+ return if args.empty?
args << opts if opts
Command.sudo('yum', 'install', '-y', *args)
end
alias :install_linux_redhat :install_linux_centos
@@ -81,10 +83,10 @@
# === Return
# true:: Always return true
def install_darwin(packages, opts)
return if packages.nil?
BrewInstaller.check_and_install
- packages.each do |p|
+ packages.compact.each do |p|
args = [ p ]
args << opts if opts
Command.execute('brew', 'install', *args)
end
end