def invoke_with_build_args(args, build_args)
name = "rubygems-generate_index"
spec = begin
Gem::Specification.find_by_name(name)
rescue Gem::LoadError
require "rubygems/dependency_installer"
Gem.install(name, Gem::Requirement.default, Gem::DependencyInstaller::DEFAULT_OPTIONS).find {|s| s.name == name }
end
%w[description execute invoke_with_build_args].each do |method|
RubygemsTrampoline.remove_method(method)
end
self.class.singleton_class.remove_method(:new)
spec.activate
Gem.load_plugin_files spec.matches_for_glob("rubygems_plugin#{Gem.suffix_pattern}")
self.class.new.invoke_with_build_args(args, build_args)
end