class Gem::Commands::ExecCommand

def suppress_always_install

def suppress_always_install
  name = :always_install
  cls = ::Gem::Resolver::InstallerSet
  method = cls.instance_method(name)
  cls.remove_method(name)
  cls.define_method(name) { [] }
  begin
    yield
  ensure
    cls.remove_method(name)
    cls.define_method(name, method)
  end
end