[rubygems/rubygems] Fix gem rdoc
not working with newer versions of rdoc
https://github.com/rubygems/rubygems/commit/369f9b9311
This commit is contained in:
parent
4323674fe4
commit
e21e5bc814
Notes:
git
2025-03-10 03:43:59 +00:00
@ -5,8 +5,6 @@ require_relative "../rubygems"
|
|||||||
begin
|
begin
|
||||||
require "rdoc/rubygems_hook"
|
require "rdoc/rubygems_hook"
|
||||||
module Gem
|
module Gem
|
||||||
RDoc = ::RDoc::RubygemsHook
|
|
||||||
|
|
||||||
##
|
##
|
||||||
# Returns whether RDoc defines its own install hooks through a RubyGems
|
# Returns whether RDoc defines its own install hooks through a RubyGems
|
||||||
# plugin. This and whatever is guarded by it can be removed once no
|
# 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?
|
def self.rdoc_hooks_defined_via_plugin?
|
||||||
Gem::Version.new(::RDoc::VERSION) >= Gem::Version.new("6.9.0")
|
Gem::Version.new(::RDoc::VERSION) >= Gem::Version.new("6.9.0")
|
||||||
end
|
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
|
rescue LoadError
|
||||||
end
|
end
|
||||||
|
@ -18,19 +18,7 @@ class TestGemRDoc < Gem::TestCase
|
|||||||
|
|
||||||
install_gem @a
|
install_gem @a
|
||||||
|
|
||||||
hook_class = if defined?(RDoc::RubyGemsHook)
|
@hook = Gem::RDoc.new @a
|
||||||
RDoc::RubyGemsHook
|
|
||||||
else
|
|
||||||
Gem::RDoc
|
|
||||||
end
|
|
||||||
|
|
||||||
@hook = hook_class.new @a
|
|
||||||
|
|
||||||
begin
|
|
||||||
hook_class.load_rdoc
|
|
||||||
rescue Gem::DocumentError => e
|
|
||||||
pend e.message
|
|
||||||
end
|
|
||||||
|
|
||||||
Gem.configuration[:rdoc] = nil
|
Gem.configuration[:rdoc] = nil
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user