Skip to content

Fixed compatibility error with setup command and rdoc plugin on rubygems #1234

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading