Skip to content

Add attribute :force to RDoc::RubygemsHook just like RDoc::RubyGemsHook #1244

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 16, 2024

Conversation

tompng
Copy link
Member

@tompng tompng commented Dec 15, 2024

Rubygems creates an instance of RDoc::RubygemsHook, sets doc.force = overwrite, then calls doc.generate the document. RDoc::RubygemsHook needs attribute :force just like RDoc::RubyGemsHook.

Fixes #1243

Rubygems creates an instance of RDoc::RubygemsHook, sets `doc.force = overwrite`, then calls `doc.generate` the document.
RDoc::RubygemsHook needs attribute `:force` just like RDoc::RubyGemsHook.
@tompng tompng force-pushed the rubygems_hook_accessors branch from 08aec15 to 6f50059 Compare December 15, 2024 16:01
@@ -281,14 +281,17 @@ def initialize(spec, generate_rdoc = false, generate_ri = true)
@spec = spec
@generate_rdoc = generate_rdoc
@generate_ri = generate_ri
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking that we can initialize a RubyGemsHook here already, like

    def initialize(spec, generate_rdoc = false, generate_ri = true)
      @rubygems_hook = RubyGemsHook.new(spec, generate_rdoc, generate_ri)
    end

And then delegate methods to @rubygems_hook, which will handle more cases 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, implementing minimal things to clarify what method/attribute are needed in the compatibility layer is not a bad idea. I think it is the intention of the current implementation of RubygemsHook. (I', not sure)
This way, the new RubyGemsHook can easily change its method as long as RubygemsHook's methods works.

@st0012 st0012 added the bug label Dec 16, 2024
@st0012 st0012 merged commit 01bdbcd into ruby:master Dec 16, 2024
22 checks passed
matzbot pushed a commit to ruby/ruby that referenced this pull request Dec 16, 2024
RDoc::RubyGemsHook
(ruby/rdoc#1244)

Rubygems creates an instance of RDoc::RubygemsHook, sets `doc.force = overwrite`, then calls `doc.generate` the document.
RDoc::RubygemsHook needs attribute `:force` just like RDoc::RubyGemsHook.

ruby/rdoc@01bdbcdd4d
@tompng tompng deleted the rubygems_hook_accessors branch December 16, 2024 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gem rdoc gem_name fails with undefined method 'force=' for an instance of RDoc::RubygemsHook
2 participants