Skip to content

Commit dedd733

Browse files
committed
(PA-6881) Configure a default gem_uninstall command
With the addition logic in #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.
1 parent a1da62b commit dedd733

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: configs/components/_base-rubygem.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@
4141
# in its component file rubygem-<compoment>, before the instance_eval of this file.
4242
gem_install_options = settings["#{pkg.get_name}_gem_install_options".to_sym]
4343
remove_older_versions = settings["#{pkg.get_name}_remove_older_versions".to_sym]
44+
# Set a default gem_uninstall
45+
gem_uninstall = settings[:gem_uninstall] || "#{settings[:host_gem]} uninstall --all --ignore-dependencies"
4446
pkg.install do
4547
steps = []
46-
steps << "#{settings[:gem_uninstall]} #{name}" if remove_older_versions
48+
steps << "#{gem_uninstall} #{name}" if remove_older_versions
4749
steps << if gem_install_options.nil?
4850
"#{settings[:gem_install]} #{name}-#{version}.gem"
4951
else

0 commit comments

Comments
 (0)