Skip to content

Commit

Permalink
Remove deprecated command options
Browse files Browse the repository at this point in the history
Enable backwards compatibility for older rubygems versions
  • Loading branch information
jlindquist-godaddy committed Feb 12, 2020
1 parent 83b801c commit ba2b846
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/puppet/provider/rvm_gem/gem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit ba2b846

Please sign in to comment.