Skip to content

Commit

Permalink
Fixed compatibility error with setup command and rdoc plugin on rubygems
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Dec 13, 2024
1 parent f4e10f4 commit ffdbbcf
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lib/rdoc/rubygems_hook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,25 @@ def setup
# `rubygems/rdoc.rb`.
module RDoc
class RubygemsHook

attr_accessor :generate_rdoc, :generate_ri

def self.default_gem?
!File.exist?(File.join(__dir__, "..", "rubygems_plugin.rb"))
end

def initialize(spec)
def initialize(spec, generate_rdoc = false, generate_ri = true)
@spec = spec
@generate_rdoc = generate_rdoc
@generate_ri = generate_ri
end

def generate
# Do nothing if this is NOT a default gem.
return unless self.class.default_gem?

# Generate document for compatibility if this is a default gem.
RubyGemsHook.new(@spec, @generate_rdoc, @generate_ri).generate
end

def remove
Expand Down

0 comments on commit ffdbbcf

Please sign in to comment.