# Initialize the RubyGems RDoc hook. require "rubygems/rdoc" # Make sure there is only one `done_installing`, so we can assume it it the # RDod defined one. raise <<~ERR unless Gem.done_installing_hooks.size == 1 rdoc-generator-fedora-darkfish expects only one `Gem.done_installing_hooks` at this stage, but #{Gem.done_installing_hooks.size} are defined ERR # 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))