# Make sure there are no `done_installing` hooks defined yet, so there is know # starting position. raise unless Gem.done_installing_hooks.empty? # Initialize the RubyGems RDoc hook. require "rubygems/rdoc" # Double check that there is only one `done_installing` hook loaded. raise unless Gem.done_installing_hooks.size == 1 # Subsequently drop the hook. Gem.done_installing_hooks.pop $LOAD_PATH.unshift __dir__ require 'fedora_darkfish' module Fedora module RDoc end end class Fedora::RDoc::RubyGemsHook < RDoc::RubygemsHook def self.generation_hook installer, specs super end def document generator, options, destination fedora_generator = "fedora::#{generator}" generator = fedora_generator if RDoc::RDoc::GENERATORS.include? fedora_generator super end end Gem.done_installing(&Fedora::RDoc::RubyGemsHook.method(:generation_hook))