1

We have a gem foo that used to have a dependency on another of our gems bar. But now we've pulled the bar code directly into foo.

Is it possible to have the bar gem removed the next time our users upgrade foo?

Fotios
  • 3,643
  • 1
  • 28
  • 30

1 Answers1

0

I seem to have found a quick and dirty solution, similar to adding conditional install time deps. Unfortunately, I haven't figured out how to tell the user, since gem squashes the extension output unless the user specifies verbose.

in the ext/mkrf_conf.rb, I added:

require 'rubygems'
require 'rubygems/uninstaller.rb'
begin
  gem = Gem::Specification.find_by_name('other_gem');
  Gem::Uninstaller.new('other_gem').uninstall
rescue Gem::LoadError
end
Community
  • 1
  • 1
Fotios
  • 3,643
  • 1
  • 28
  • 30