From 3867e19593e1d6c7cb31b195ff5b437079e49998 Mon Sep 17 00:00:00 2001 From: ksss Date: Sun, 2 Aug 2026 15:04:50 +0900 Subject: [PATCH 1/5] Remove nonexistent RFC822_DAYS/RFC822_MONTHS from CGI::Util CGI::Util does not define these constants; they don't appear anywhere in the cgi gem's source. --- gems/cgi/0.5/core.rbs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/gems/cgi/0.5/core.rbs b/gems/cgi/0.5/core.rbs index 2c16f01e..9c0437f9 100644 --- a/gems/cgi/0.5/core.rbs +++ b/gems/cgi/0.5/core.rbs @@ -907,12 +907,6 @@ class CGI alias escape_element escapeElement alias unescape_element unescapeElement - # Abbreviated day-of-week names specified by RFC 822 - RFC822_DAYS: Array[String] - - # Abbreviated month names specified by RFC 822 - RFC822_MONTHS: Array[String] - # # The set of special characters and their escaped values # From 9aa123a6d08a96725e83ece4dbd020f24a8857ff Mon Sep 17 00:00:00 2001 From: ksss Date: Sun, 2 Aug 2026 15:05:34 +0900 Subject: [PATCH 2/5] Fix definition location of CGI escape-related methods 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. --- gems/cgi/0.5/core.rbs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/gems/cgi/0.5/core.rbs b/gems/cgi/0.5/core.rbs index 9c0437f9..e703b1c8 100644 --- a/gems/cgi/0.5/core.rbs +++ b/gems/cgi/0.5/core.rbs @@ -6,6 +6,10 @@ class CGI extend CGI::Util + include CGI::Escape + + extend CGI::Escape + # + # Escape/unescape for CGI, HTML, URI. + # + module Escape def escape: (String) -> String def unescape: (String, ?encoding: Encoding) -> String @@ -907,9 +916,17 @@ class CGI alias escape_element escapeElement alias unescape_element unescapeElement - # + # # The set of special characters and their escaped values # TABLE_FOR_ESCAPE_HTML__: Hash[String, String] end + + # + # Internal module that provides a C-accelerated implementation of some + # CGI::Escape methods. Left empty here since it is an implementation + # detail and its public interface is already covered by CGI::Escape. + # + module EscapeExt + end end From 13be357a9a0d09b1a15499b394923276ddd6babc Mon Sep 17 00:00:00 2001 From: ksss Date: Sun, 2 Aug 2026 15:05:56 +0900 Subject: [PATCH 3/5] Add missing h alias for CGI::Escape#escapeHTML lib/cgi/escape.rb defines `alias h escapeHTML`, but core.rbs was missing this alias entirely. --- gems/cgi/0.5/core.rbs | 1 + 1 file changed, 1 insertion(+) diff --git a/gems/cgi/0.5/core.rbs b/gems/cgi/0.5/core.rbs index e703b1c8..4e7433bc 100644 --- a/gems/cgi/0.5/core.rbs +++ b/gems/cgi/0.5/core.rbs @@ -908,6 +908,7 @@ class CGI def unescapeHTML: (String) -> String alias escape_html escapeHTML alias unescape_html unescapeHTML + alias h escapeHTML def escapeElement: (String, *String) -> String | (String, Array[String]) -> String From 5938399ec0f0977d31a9275834e734d675360e89 Mon Sep 17 00:00:00 2001 From: ksss Date: Sun, 2 Aug 2026 15:12:36 +0900 Subject: [PATCH 4/5] Remove speculative rdoc-style comments on Escape/EscapeExt 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. --- gems/cgi/0.5/core.rbs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/gems/cgi/0.5/core.rbs b/gems/cgi/0.5/core.rbs index 4e7433bc..5b4a8498 100644 --- a/gems/cgi/0.5/core.rbs +++ b/gems/cgi/0.5/core.rbs @@ -892,9 +892,6 @@ class CGI def rfc1123_date: (Time time) -> String end - # - # Escape/unescape for CGI, HTML, URI. - # module Escape def escape: (String) -> String def unescape: (String, ?encoding: Encoding) -> String @@ -923,11 +920,6 @@ class CGI TABLE_FOR_ESCAPE_HTML__: Hash[String, String] end - # - # Internal module that provides a C-accelerated implementation of some - # CGI::Escape methods. Left empty here since it is an implementation - # detail and its public interface is already covered by CGI::Escape. - # module EscapeExt end end From 745bb49d981a2eec7b840761e5b061c42475357d Mon Sep 17 00:00:00 2001 From: ksss Date: Sun, 2 Aug 2026 15:13:49 +0900 Subject: [PATCH 5/5] Add reviewer --- gems/cgi/_reviewers.yaml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 gems/cgi/_reviewers.yaml diff --git a/gems/cgi/_reviewers.yaml b/gems/cgi/_reviewers.yaml new file mode 100644 index 00000000..0b4d3b7e --- /dev/null +++ b/gems/cgi/_reviewers.yaml @@ -0,0 +1,2 @@ +reviewers: + - ksss