summaryrefslogtreecommitdiff
path: root/lib/rubygems/rdoc.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <[email protected]>2025-03-05 15:56:53 +0100
committerHiroshi SHIBATA <[email protected]>2025-03-10 12:43:36 +0900
commite21e5bc814484ea1f37c702404f434d72bd257c1 (patch)
treeaf776d3e5c7ff54e46e243589bfb24068624a50a /lib/rubygems/rdoc.rb
parent4323674fe4d697db48856292deb459f9ca923272 (diff)
[rubygems/rubygems] Fix `gem rdoc` not working with newer versions of rdoc
https://github.com/rubygems/rubygems/commit/369f9b9311
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12890
Diffstat (limited to 'lib/rubygems/rdoc.rb')
-rw-r--r--lib/rubygems/rdoc.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/rubygems/rdoc.rb b/lib/rubygems/rdoc.rb
index 977a51da01..3524b161b2 100644
--- a/lib/rubygems/rdoc.rb
+++ b/lib/rubygems/rdoc.rb
@@ -5,8 +5,6 @@ require_relative "../rubygems"
begin
require "rdoc/rubygems_hook"
module Gem
- RDoc = ::RDoc::RubygemsHook
-
##
# Returns whether RDoc defines its own install hooks through a RubyGems
# plugin. This and whatever is guarded by it can be removed once no
@@ -15,8 +13,14 @@ begin
def self.rdoc_hooks_defined_via_plugin?
Gem::Version.new(::RDoc::VERSION) >= Gem::Version.new("6.9.0")
end
- end
- Gem.done_installing(&Gem::RDoc.method(:generation_hook)) unless Gem.rdoc_hooks_defined_via_plugin?
+ if rdoc_hooks_defined_via_plugin?
+ RDoc = ::RDoc::RubyGemsHook
+ else
+ RDoc = ::RDoc::RubygemsHook
+
+ Gem.done_installing(&Gem::RDoc.method(:generation_hook))
+ end
+ end
rescue LoadError
end