summaryrefslogtreecommitdiff
path: root/lib/rubygems/rdoc.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <[email protected]>2024-12-23 21:02:37 +0100
committerHiroshi SHIBATA <[email protected]>2024-12-24 07:21:10 +0900
commit9e0eb9778d557ef59a541a65be658040951de5be (patch)
treeb8c9df921e85e7fd20c61e67b9099128213f32ec /lib/rubygems/rdoc.rb
parent527cc7328207de06750debf4c6bfce81a897957d (diff)
Merge RubyGems-3.6.2 and Bundler-2.6.2
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12444
Diffstat (limited to 'lib/rubygems/rdoc.rb')
-rw-r--r--lib/rubygems/rdoc.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/rubygems/rdoc.rb b/lib/rubygems/rdoc.rb
index 907dcd9431..977a51da01 100644
--- a/lib/rubygems/rdoc.rb
+++ b/lib/rubygems/rdoc.rb
@@ -6,8 +6,17 @@ 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
+ # supported Ruby ships with RDoc older than 6.9.0.
+
+ 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))
+ Gem.done_installing(&Gem::RDoc.method(:generation_hook)) unless Gem.rdoc_hooks_defined_via_plugin?
rescue LoadError
end