Skip to content

Conversation

@tompng
Copy link
Member

@tompng tompng commented Dec 20, 2025

Fixes #1014

Some aliased class/module document had wrong title.
Example: https://docs.ruby-lang.org/en/master/Net/HTTP.html
Title should be class Net::HTTP, Not class Net::HTTPSession.

# Source
module Net
  class HTTP
    ...
  end
  HTTPSession = HTTP
  deprecate_constant :HTTPSession
end

RDoc first generates Net/HTTP.html with the correct content, and then overwrite the same file with aliased-name content.

Fixes:

  • Stop aliased class/module document file overwrite original one.
  • Fix aliasing-to-toplevel check (because test failed with the above change).

Documents of ruby/ruby that will change:

DidYouMean/Formatter.html
  Title change from DidYouMean::VerboseFormatter
Net/HTTP.html
  Title change from Net::HTTPSession
Net/HTTPFound.html
  Title change from Net::HTTPMovedTemporarily
Net/HTTPPayloadTooLarge.html
  Title change from Net::HTTPRequestEntityTooLarge
Net/HTTPRangeNotSatisfiable.html
  Title change from Net::HTTPRequestedRangeNotSatisfiable
Net/HTTPRequestURITooLong.html
  Title was Net::HTTPRequestURITooLarge, file deleted
OpenSSL/PKey/PKeyError.html
  Title change from OpenSSL::PKey::RSAError
Prism/Translation/Parser33.html
  Title change from Prism::Translation::ParserCurrent

@tompng tompng temporarily deployed to fork-preview-protection December 20, 2025 21:39 — with GitHub Actions Inactive
@matzbot
Copy link
Collaborator

matzbot commented Dec 20, 2025

🚀 Preview deployment available at: https://fdc86876.rdoc-6cd.pages.dev (commit: dc4d1a1)

@tompng tompng force-pushed the class_module_alias_overwrite_fix branch from 4e58ee5 to cb5203f Compare December 20, 2025 21:43
@tompng tompng requested a deployment to fork-preview-protection December 20, 2025 21:43 — with GitHub Actions Waiting
assert_equal [@klass_alias, @ignored, @klass, @object],
assert_equal %w[Ignored Klass Klass::A Object],
[@ignored, @klass, @klass_alias, @object].map(&:full_name)
assert_equal [@ignored, @klass, @klass_alias, @object],
Copy link
Member

Choose a reason for hiding this comment

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

Can you add one of these tests to Aliki’s generator test as well?

cm_alias.parent = self
cm_alias.full_name = nil # force update for new parent
end
cm_alias.full_name = nil # force update for new parent
Copy link
Member

Choose a reason for hiding this comment

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

Can we have a ClassModule/CodeObject level test to prevent regression too?

@st0012 st0012 added the bug label Dec 20, 2025
Stop aliased class/module document file overwrite original one.
Fix aliasing-to-toplevel check.
@tompng tompng force-pushed the class_module_alias_overwrite_fix branch from cb5203f to dc4d1a1 Compare December 21, 2025 12:25
@tompng tompng deployed to fork-preview-protection December 21, 2025 12:25 — with GitHub Actions Active
@tompng tompng merged commit 09630a0 into ruby:master Dec 21, 2025
33 checks passed
@tompng tompng deleted the class_module_alias_overwrite_fix branch December 21, 2025 15:26
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.

Incorrect module aliasing

3 participants