From ba2b846cd6a67522a4940618ee98f6373c5fd7aa Mon Sep 17 00:00:00 2001 From: Jon-Paul Lindquist Date: Wed, 26 Jun 2019 12:46:35 -0700 Subject: [PATCH] Remove deprecated command options Enable backwards compatibility for older rubygems versions --- lib/puppet/provider/rvm_gem/gem.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/puppet/provider/rvm_gem/gem.rb b/lib/puppet/provider/rvm_gem/gem.rb index 49a1adbf..87babd11 100644 --- a/lib/puppet/provider/rvm_gem/gem.rb +++ b/lib/puppet/provider/rvm_gem/gem.rb @@ -14,6 +14,11 @@ def ruby_version resource[:ruby_version] end + def rubygems_version + command = gembinary + ['-v'] + execute(command) + end + def gembinary [command(:rvmcmd), ruby_version, 'do', 'gem'] end @@ -102,7 +107,11 @@ def install(useversion = true) command << '--source' << source.to_s << resource[:name] end else - command << '--no-rdoc' << '--no-ri' << resource[:name] + if Gem::Version.new(rubygems_version) < Gem::Version.new('3.0.0') + command << '--no-rdoc' << '--no-ri' << resource[:name] # Deprecated options (backwards compatible) + else + command << '--no-document' << resource[:name] + end end # makefile opts,