class RDoc::RubygemsHook

def self.default_gem?

def self.default_gem?
  !File.exist?(File.join(__dir__, "..", "rubygems_plugin.rb"))
end

def self.generation_hook installer, specs

def self.generation_hook installer, specs
  # Do nothing if this is NOT a default gem.
  return unless default_gem?
  # Generate document for compatibility if this is a default gem.
  RubyGemsHook.generate(installer, specs)
end

def generate

def generate
  # Do nothing if this is NOT a default gem.
  return unless self.class.default_gem?
  # Generate document for compatibility if this is a default gem.
  hook = RubyGemsHook.new(@spec, @generate_rdoc, @generate_ri)
  hook.force = @force
  hook.generate
end

def initialize(spec, generate_rdoc = false, generate_ri = true)

def initialize(spec, generate_rdoc = false, generate_ri = true)
  @spec = spec
  @generate_rdoc = generate_rdoc
  @generate_ri   = generate_ri
  @force = false
end

def remove

def remove
  # Do nothing if this is NOT a default gem.
  return unless self.class.default_gem?
  # Remove generated document for compatibility if this is a
  # default gem.
  RubyGemsHook.new(@spec).remove
end