Fix CGI::Util method definition locations in core.rbs - #1060
Merged
Conversation
CGI::Util does not define these constants; they don't appear anywhere in the cgi gem's source.
escape, unescape, escapeURIComponent, unescapeURIComponent, escapeHTML, unescapeHTML, escapeElement, unescapeElement, and TABLE_FOR_ESCAPE_HTML__ are actually defined in CGI::Escape (lib/cgi/escape.rb), not CGI::Util. Add CGI::Escape and include/extend it on CGI, and add an empty CGI::EscapeExt as a placeholder for the internal C-accelerated implementation module.
lib/cgi/escape.rb defines `alias h escapeHTML`, but core.rbs was missing this alias entirely.
These module-level descriptions were not verified against actual rdoc output, so drop them rather than risk documentation that doesn't match the real rdoc.
|
@ksss Thanks for your contribution! Please follow the instructions below for each change. Available commandsYou can use the following commands by commenting on this PR.
|
Collaborator
Author
|
/merge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gems/cgi/0.5/core.rbsincorrectly places several escape-related methods and a constant underCGI::Util. Checking against the actualcgigem source (0.5.2) showsCGI::Utilonly definesprettyandrfc1123_date; everything else lives inCGI::Escape(withCGI::EscapeExtproviding an optional C-accelerated override for a subset of methods).escape,unescape,escapeURIComponent,unescapeURIComponent,escapeHTML,unescapeHTML,escapeElement,unescapeElement, andTABLE_FOR_ESCAPE_HTML__are defined inCGI::Escape(lib/cgi/escape.rb), notCGI::Util.CGI::EscapeExtis added as an empty module — it's an internal implementation detail whose public surface is already covered byCGI::Escape.RFC822_DAYSandRFC822_MONTHSdo not exist anywhere in the gem's source and are removed.h, an alias forescapeHTMLdefined inlib/cgi/escape.rb, was missing fromcore.rbsand is added.Verified method ownership directly against a locally installed
cgi0.5.2 viaCGI.instance_method(:escape).owneretc., and cross-checked the C extension (ext/cgi/escape/escape.c) for whatCGI::EscapeExtactually defines at runtime.Test plan
bin/test gems/cgi/0.5passes (rbs validate+steep check) after each commit