summaryrefslogtreecommitdiff
path: root/lib/rubygems/rdoc.rb
diff options
context:
space:
mode:
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