Skip to content

Commit

Permalink
(PA-6881) Configure a default gem_uninstall command
Browse files Browse the repository at this point in the history
With the addition logic in puppetlabs#901 for deduplicating rexml gems an inadvertant requirement was imposed on projects to define a `gem_uninstall` command. This command should be ubiquitous (especially with impending ruby 3 only streams)  so instead of requiring all projects to configure it a default is added. This setting is still configurable at a project level, but is not required.
  • Loading branch information
donoghuc committed Sep 6, 2024
1 parent a1da62b commit dedd733
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion configs/components/_base-rubygem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@
# in its component file rubygem-<compoment>, before the instance_eval of this file.
gem_install_options = settings["#{pkg.get_name}_gem_install_options".to_sym]
remove_older_versions = settings["#{pkg.get_name}_remove_older_versions".to_sym]
# Set a default gem_uninstall
gem_uninstall = settings[:gem_uninstall] || "#{settings[:host_gem]} uninstall --all --ignore-dependencies"
pkg.install do
steps = []
steps << "#{settings[:gem_uninstall]} #{name}" if remove_older_versions
steps << "#{gem_uninstall} #{name}" if remove_older_versions
steps << if gem_install_options.nil?
"#{settings[:gem_install]} #{name}-#{version}.gem"
else
Expand Down

0 comments on commit dedd733

Please sign in to comment.