rbs 3.10.2 → 4.0.0.dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/comments.yml +2 -2
  3. data/.github/workflows/ruby.yml +24 -34
  4. data/.github/workflows/typecheck.yml +3 -1
  5. data/.github/workflows/windows.yml +2 -2
  6. data/.gitignore +0 -4
  7. data/CHANGELOG.md +0 -107
  8. data/README.md +1 -38
  9. data/Rakefile +20 -142
  10. data/Steepfile +1 -0
  11. data/config.yml +43 -1
  12. data/core/array.rbs +46 -96
  13. data/core/comparable.rbs +6 -13
  14. data/core/complex.rbs +25 -40
  15. data/core/dir.rbs +4 -4
  16. data/core/encoding.rbs +9 -6
  17. data/core/enumerable.rbs +3 -90
  18. data/core/enumerator.rbs +1 -43
  19. data/core/errno.rbs +0 -8
  20. data/core/errors.rbs +1 -28
  21. data/core/exception.rbs +2 -2
  22. data/core/fiber.rbs +20 -29
  23. data/core/file.rbs +19 -49
  24. data/core/file_test.rbs +1 -1
  25. data/core/float.rbs +33 -224
  26. data/core/gc.rbs +281 -417
  27. data/core/hash.rbs +727 -1023
  28. data/core/integer.rbs +63 -104
  29. data/core/io/buffer.rbs +10 -21
  30. data/core/io/wait.rbs +33 -11
  31. data/core/io.rbs +12 -14
  32. data/core/kernel.rbs +51 -61
  33. data/core/marshal.rbs +1 -1
  34. data/core/match_data.rbs +1 -1
  35. data/core/math.rbs +3 -42
  36. data/core/method.rbs +25 -63
  37. data/core/module.rbs +23 -101
  38. data/core/nil_class.rbs +3 -3
  39. data/core/numeric.rbs +17 -25
  40. data/core/object.rbs +3 -3
  41. data/core/object_space.rbs +15 -21
  42. data/core/proc.rbs +24 -30
  43. data/core/process.rbs +2 -2
  44. data/core/ractor.rbs +509 -361
  45. data/core/range.rbs +8 -7
  46. data/core/rational.rbs +34 -56
  47. data/core/rbs/unnamed/argf.rbs +2 -2
  48. data/core/rbs/unnamed/env_class.rbs +1 -1
  49. data/core/rbs/unnamed/random.rbs +2 -4
  50. data/core/regexp.rbs +20 -25
  51. data/core/ruby_vm.rbs +4 -6
  52. data/core/rubygems/errors.rbs +70 -3
  53. data/core/rubygems/rubygems.rbs +79 -11
  54. data/core/rubygems/version.rbs +3 -2
  55. data/core/set.rbs +359 -488
  56. data/core/signal.rbs +14 -24
  57. data/core/string.rbs +1236 -3165
  58. data/core/struct.rbs +1 -1
  59. data/core/symbol.rbs +11 -17
  60. data/core/thread.rbs +33 -95
  61. data/core/time.rbs +9 -35
  62. data/core/trace_point.rbs +4 -7
  63. data/core/unbound_method.rbs +6 -14
  64. data/docs/collection.md +2 -2
  65. data/docs/gem.md +1 -0
  66. data/docs/sigs.md +3 -3
  67. data/ext/rbs_extension/ast_translation.c +1077 -944
  68. data/ext/rbs_extension/ast_translation.h +0 -7
  69. data/ext/rbs_extension/class_constants.c +83 -71
  70. data/ext/rbs_extension/class_constants.h +7 -4
  71. data/ext/rbs_extension/extconf.rb +2 -24
  72. data/ext/rbs_extension/legacy_location.c +172 -173
  73. data/ext/rbs_extension/legacy_location.h +3 -8
  74. data/ext/rbs_extension/main.c +289 -239
  75. data/ext/rbs_extension/rbs_extension.h +0 -3
  76. data/ext/rbs_extension/rbs_string_bridging.h +0 -4
  77. data/include/rbs/ast.h +98 -37
  78. data/include/rbs/defines.h +12 -38
  79. data/include/rbs/lexer.h +114 -126
  80. data/include/rbs/location.h +14 -14
  81. data/include/rbs/parser.h +37 -21
  82. data/include/rbs/string.h +5 -3
  83. data/include/rbs/util/rbs_allocator.h +19 -40
  84. data/include/rbs/util/rbs_assert.h +1 -12
  85. data/include/rbs/util/rbs_constant_pool.h +3 -3
  86. data/include/rbs/util/rbs_encoding.h +1 -3
  87. data/include/rbs/util/rbs_unescape.h +1 -2
  88. data/lib/rbs/ast/ruby/annotations.rb +119 -0
  89. data/lib/rbs/ast/ruby/comment_block.rb +221 -0
  90. data/lib/rbs/ast/ruby/declarations.rb +86 -0
  91. data/lib/rbs/ast/ruby/helpers/constant_helper.rb +24 -0
  92. data/lib/rbs/ast/ruby/helpers/location_helper.rb +15 -0
  93. data/lib/rbs/ast/ruby/members.rb +213 -0
  94. data/lib/rbs/buffer.rb +104 -24
  95. data/lib/rbs/cli/validate.rb +40 -35
  96. data/lib/rbs/cli.rb +5 -6
  97. data/lib/rbs/collection/config/lockfile_generator.rb +0 -8
  98. data/lib/rbs/collection.rb +0 -1
  99. data/lib/rbs/definition.rb +6 -1
  100. data/lib/rbs/definition_builder/ancestor_builder.rb +65 -62
  101. data/lib/rbs/definition_builder/method_builder.rb +45 -30
  102. data/lib/rbs/definition_builder.rb +44 -9
  103. data/lib/rbs/environment/class_entry.rb +69 -0
  104. data/lib/rbs/environment/module_entry.rb +66 -0
  105. data/lib/rbs/environment.rb +244 -218
  106. data/lib/rbs/environment_loader.rb +8 -2
  107. data/lib/rbs/errors.rb +5 -4
  108. data/lib/rbs/inline_parser/comment_association.rb +117 -0
  109. data/lib/rbs/inline_parser.rb +206 -0
  110. data/lib/rbs/location_aux.rb +35 -3
  111. data/lib/rbs/parser_aux.rb +11 -6
  112. data/lib/rbs/prototype/runtime.rb +2 -2
  113. data/lib/rbs/resolver/constant_resolver.rb +2 -2
  114. data/lib/rbs/resolver/type_name_resolver.rb +38 -124
  115. data/lib/rbs/source.rb +99 -0
  116. data/lib/rbs/subtractor.rb +5 -6
  117. data/lib/rbs/test/type_check.rb +0 -14
  118. data/lib/rbs/types.rb +1 -3
  119. data/lib/rbs/version.rb +1 -1
  120. data/lib/rbs.rb +13 -1
  121. data/lib/rdoc/discover.rb +1 -1
  122. data/lib/rdoc_plugin/parser.rb +1 -1
  123. data/rbs.gemspec +1 -0
  124. data/sig/ancestor_builder.rbs +1 -1
  125. data/sig/ast/ruby/annotations.rbs +110 -0
  126. data/sig/ast/ruby/comment_block.rbs +119 -0
  127. data/sig/ast/ruby/declarations.rbs +60 -0
  128. data/sig/ast/ruby/helpers/constant_helper.rbs +11 -0
  129. data/sig/ast/ruby/helpers/location_helper.rbs +15 -0
  130. data/sig/ast/ruby/members.rbs +72 -0
  131. data/sig/buffer.rbs +63 -5
  132. data/sig/definition.rbs +1 -0
  133. data/sig/definition_builder.rbs +1 -1
  134. data/sig/environment/class_entry.rbs +50 -0
  135. data/sig/environment/module_entry.rbs +50 -0
  136. data/sig/environment.rbs +28 -133
  137. data/sig/errors.rbs +13 -6
  138. data/sig/inline_parser/comment_association.rbs +71 -0
  139. data/sig/inline_parser.rbs +87 -0
  140. data/sig/location.rbs +32 -7
  141. data/sig/manifest.yaml +1 -0
  142. data/sig/method_builder.rbs +7 -4
  143. data/sig/parser.rbs +16 -20
  144. data/sig/resolver/type_name_resolver.rbs +7 -38
  145. data/sig/source.rbs +48 -0
  146. data/sig/types.rbs +1 -4
  147. data/src/ast.c +290 -201
  148. data/src/lexer.c +2813 -2902
  149. data/src/lexer.re +4 -0
  150. data/src/lexstate.c +155 -169
  151. data/src/location.c +40 -40
  152. data/src/parser.c +2665 -2433
  153. data/src/string.c +48 -0
  154. data/src/util/rbs_allocator.c +76 -92
  155. data/src/util/rbs_assert.c +10 -10
  156. data/src/util/rbs_buffer.c +2 -2
  157. data/src/util/rbs_constant_pool.c +15 -13
  158. data/src/util/rbs_encoding.c +4062 -20097
  159. data/src/util/rbs_unescape.c +48 -85
  160. data/stdlib/bigdecimal/0/big_decimal.rbs +82 -100
  161. data/stdlib/bigdecimal-math/0/big_math.rbs +8 -169
  162. data/stdlib/cgi/0/core.rbs +393 -9
  163. data/stdlib/cgi/0/manifest.yaml +0 -1
  164. data/stdlib/coverage/0/coverage.rbs +1 -3
  165. data/stdlib/date/0/date.rbs +59 -67
  166. data/stdlib/date/0/date_time.rbs +1 -1
  167. data/stdlib/delegate/0/delegator.rbs +7 -10
  168. data/stdlib/erb/0/erb.rbs +347 -737
  169. data/stdlib/fileutils/0/fileutils.rbs +13 -18
  170. data/stdlib/forwardable/0/forwardable.rbs +0 -3
  171. data/stdlib/json/0/json.rbs +48 -68
  172. data/stdlib/net-http/0/net-http.rbs +0 -3
  173. data/stdlib/objspace/0/objspace.rbs +4 -9
  174. data/stdlib/open-uri/0/open-uri.rbs +0 -40
  175. data/stdlib/openssl/0/openssl.rbs +228 -331
  176. data/stdlib/optparse/0/optparse.rbs +3 -3
  177. data/stdlib/pathname/0/pathname.rbs +1380 -10
  178. data/stdlib/psych/0/psych.rbs +3 -3
  179. data/stdlib/rdoc/0/rdoc.rbs +1 -1
  180. data/stdlib/resolv/0/resolv.rbs +68 -25
  181. data/stdlib/ripper/0/ripper.rbs +2 -5
  182. data/stdlib/singleton/0/singleton.rbs +0 -3
  183. data/stdlib/socket/0/socket.rbs +1 -13
  184. data/stdlib/socket/0/tcp_socket.rbs +2 -10
  185. data/stdlib/stringio/0/stringio.rbs +85 -1176
  186. data/stdlib/strscan/0/string_scanner.rbs +31 -31
  187. data/stdlib/tempfile/0/tempfile.rbs +3 -3
  188. data/stdlib/time/0/time.rbs +1 -1
  189. data/stdlib/timeout/0/timeout.rbs +7 -63
  190. data/stdlib/tsort/0/cyclic.rbs +0 -3
  191. data/stdlib/uri/0/common.rbs +2 -11
  192. data/stdlib/uri/0/file.rbs +1 -1
  193. data/stdlib/uri/0/generic.rbs +16 -17
  194. data/stdlib/uri/0/rfc2396_parser.rbs +7 -6
  195. data/stdlib/zlib/0/zstream.rbs +0 -1
  196. metadata +39 -12
  197. data/.clang-format +0 -74
  198. data/.clangd +0 -2
  199. data/.github/workflows/c-check.yml +0 -54
  200. data/core/pathname.rbs +0 -1272
  201. data/core/ruby.rbs +0 -53
  202. data/docs/aliases.md +0 -79
  203. data/docs/encoding.md +0 -56
  204. data/ext/rbs_extension/compat.h +0 -10
  205. data/stdlib/cgi-escape/0/escape.rbs +0 -171
data/core/ruby.rbs DELETED
@@ -1,53 +0,0 @@
1
- # <!-- rdoc-file=version.c -->
2
- # The [Ruby](rdoc-ref:Ruby) module that contains portable information among
3
- # implementations.
4
- #
5
- # The constants defined here are aliased in the toplevel with `RUBY_` prefix.
6
- #
7
- module Ruby
8
- # <!-- rdoc-file=version.c -->
9
- # The copyright string for ruby
10
- #
11
- COPYRIGHT: ::String
12
-
13
- # <!-- rdoc-file=version.c -->
14
- # The full ruby version string, like `ruby -v` prints
15
- #
16
- DESCRIPTION: ::String
17
-
18
- # <!-- rdoc-file=version.c -->
19
- # The engine or interpreter this ruby uses.
20
- #
21
- ENGINE: ::String
22
-
23
- # <!-- rdoc-file=version.c -->
24
- # The version of the engine or interpreter this ruby uses.
25
- #
26
- ENGINE_VERSION: ::String
27
-
28
- # <!-- rdoc-file=version.c -->
29
- # The patchlevel for this ruby. If this is a development build of ruby the
30
- # patchlevel will be -1
31
- #
32
- PATCHLEVEL: ::Integer
33
-
34
- # <!-- rdoc-file=version.c -->
35
- # The platform for this ruby
36
- #
37
- PLATFORM: ::String
38
-
39
- # <!-- rdoc-file=version.c -->
40
- # The date this ruby was released
41
- #
42
- RELEASE_DATE: ::String
43
-
44
- # <!-- rdoc-file=version.c -->
45
- # The GIT commit hash for this ruby.
46
- #
47
- REVISION: ::String
48
-
49
- # <!-- rdoc-file=version.c -->
50
- # The running version of ruby
51
- #
52
- VERSION: ::String
53
- end
data/docs/aliases.md DELETED
@@ -1,79 +0,0 @@
1
- # Aliases
2
-
3
- This document explains module/class aliases and type aliases.
4
-
5
- ## Module/class alias
6
-
7
- Module/class aliases give another name to a module/class.
8
- This is useful for some syntaxes that has lexical constraints.
9
-
10
- ```rbs
11
- class C
12
- end
13
-
14
- class D = C # ::D is an alias for ::C
15
-
16
- class E < D # ::E inherits from ::D, which is actually ::C
17
- end
18
- ```
19
-
20
- Note that module/class aliases cannot be recursive.
21
-
22
- So, we can define a *normalization* of aliased module/class names.
23
- Normalization follows the chain of alias definitions and resolves them to the original module/class defined with `module`/`class` syntax.
24
-
25
- ```rbs
26
- class C
27
- end
28
-
29
- class D = C
30
- class E = D
31
- ```
32
-
33
- `::E` is defined as an alias, and it can be normalized to `::C`.
34
-
35
- ## Type alias
36
-
37
- The biggest difference from module/class alias is that type alias can be recursive.
38
-
39
- ```rbs
40
- # cons_cell type is defined recursively
41
- type cons_cell = nil
42
- | [Integer, cons_cell]
43
- ```
44
-
45
- This means type aliases *cannot be* normalized generally.
46
- So, we provide another operation for type alias, `DefinitionBuilder#expand_alias` and its family.
47
- It substitutes with the immediate right hand side of a type alias.
48
-
49
- ```
50
- cons_cell ===> nil | [Integer, cons_cell] (expand 1 step)
51
- ===> nil | [Integer, nil | [Integer, cons_cell]] (expand 2 steps)
52
- ===> ... (expand will go infinitely)
53
- ```
54
-
55
- Note that the namespace of a type alias *can be* normalized, because they are module names.
56
-
57
- ```rbs
58
- module M
59
- type t = String
60
- end
61
-
62
- module N = M
63
- ```
64
-
65
- With the type definition above, a type `::N::t` can be normalized to `::M::t`.
66
- And then it can be expanded to `::String`.
67
-
68
- > [!NOTE]
69
- > This is something like an *unfold* operation in type theory.
70
-
71
- ## Type name resolution
72
-
73
- Type name resolution in RBS usually rewrites *relative* type names to *absolute* type names.
74
- `Environment#resolve_type_names` converts all type names in the RBS type definitions, and returns a new `Environment` object.
75
-
76
- It also *normalizes* modules names in type names.
77
-
78
- - If the type name can be resolved and normalized successfully, the AST has *absolute* type names.
79
- - If the type name resolution/normalization fails, the AST has *relative* type names.
data/docs/encoding.md DELETED
@@ -1,56 +0,0 @@
1
- # RBS File Encoding
2
-
3
- ## Best Practice
4
-
5
- **Use UTF-8** for both file encoding and your system locale.
6
-
7
- ## Supported Encodings
8
-
9
- RBS parser supports ASCII-compatible encodings (similar to Ruby's script encoding support).
10
-
11
- **Examples**: UTF-8, US-ASCII, Shift JIS, EUC-JP, ...
12
-
13
- ## Unicode Codepoint Symbols
14
-
15
- String literal types in RBS can contain Unicode codepoint escape sequences (`\uXXXX`).
16
-
17
- When the file encoding is UTF-8, the parser translates Unicode codepoint symbols:
18
-
19
- ```rbs
20
- # In UTF-8 encoded files
21
-
22
- type t = "\u0123" # Translated to the actual Unicode character ģ
23
- type s = "\u3042" # Translated to the actual Unicode character あ
24
- ```
25
-
26
- When the file encoding is not UTF-8, Unicode escape sequences are interpreted literally as the string `\uXXXX`:
27
-
28
- ```rbs
29
- # In non-UTF-8 encoded files
30
-
31
- type t = "\u0123" # Remains as the literal string "\u0123"
32
- ```
33
-
34
- ## Implementation
35
-
36
- RBS gem currently doesn't do anything for file encoding. It relies on Ruby's encoding handling, specifically `Encoding.default_external` and `Encoding.default_internal`.
37
-
38
- `Encoding.default_external` is the encoding Ruby assumes when it reads external resources like files. The Ruby interpreter sets it based on the locale. `Encoding.default_internal` is the encoding Ruby converts the external resources to. The default is `nil` (no conversion.)
39
-
40
- When your locale is set to use `UTF-8` encoding, `default_external` is `Encoding::UTF_8`. So the RBS file content read from the disk will have UTF-8 encoding.
41
-
42
- ### Parsing non UTF-8 RBS source text
43
-
44
- If you want to work with another encoding, ensure the source string has ASCII compatible encoding.
45
-
46
- ```ruby
47
- source = '"日本語"'
48
- RBS::Parser.parse_type(source.encode(Encoding::EUC_JP)) # => Parses successfully
49
- RBS::Parser.parse_type(source.encode(Encoding::UTF_32)) # => Returns `nil` since UTF-32 is not ASCII compatible
50
- ```
51
-
52
- ### Specifying file encoding
53
-
54
- Currently, RBS doesn't support specifying file encoding directly.
55
-
56
- You can use `Encoding.default_external` while the gem loads RBS files from the storage.
@@ -1,10 +0,0 @@
1
- #ifdef __clang__
2
- #define SUPPRESS_RUBY_HEADER_DIAGNOSTICS_BEGIN \
3
- _Pragma("clang diagnostic push") \
4
- _Pragma("clang diagnostic ignored \"-Wc2x-extensions\"")
5
- #define SUPPRESS_RUBY_HEADER_DIAGNOSTICS_END \
6
- _Pragma("clang diagnostic pop")
7
- #else
8
- #define SUPPRESS_RUBY_HEADER_DIAGNOSTICS_BEGIN
9
- #define SUPPRESS_RUBY_HEADER_DIAGNOSTICS_END
10
- #endif
@@ -1,171 +0,0 @@
1
- # <!-- rdoc-file=lib/cgi/escape.rb -->
2
- # Since Ruby 4.0, CGI is a small holder for various escaping methods, included
3
- # from CGI::Escape
4
- #
5
- # require 'cgi/escape'
6
- #
7
- # CGI.escape("Ruby programming language")
8
- # #=> "Ruby+programming+language"
9
- # CGI.escapeURIComponent("Ruby programming language")
10
- # #=> "Ruby%20programming%20language"
11
- #
12
- # See CGI::Escape module for methods list and their description.
13
- #
14
- class CGI
15
- include Escape
16
-
17
- extend Escape
18
-
19
- # <!-- rdoc-file=lib/cgi/escape.rb -->
20
- # Web-related escape/unescape functionality.
21
- #
22
- module Escape
23
- # <!--
24
- # rdoc-file=lib/cgi/escape.rb
25
- # - escape(string)
26
- # -->
27
- # URL-encode a string into application/x-www-form-urlencoded. Space characters
28
- # (`" "`) are encoded with plus signs (`"+"`)
29
- # url_encoded_string = CGI.escape("'Stop!' said Fred")
30
- # # => "%27Stop%21%27+said+Fred"
31
- #
32
- def escape: (string str) -> String
33
-
34
- # <!--
35
- # rdoc-file=lib/cgi/escape.rb
36
- # - escapeElement(string, *elements)
37
- # -->
38
- # Escape only the tags of certain HTML elements in `string`.
39
- #
40
- # Takes an element or elements or array of elements. Each element is specified
41
- # by the name of the element, without angle brackets. This matches both the
42
- # start and the end tag of that element. The attribute list of the open tag will
43
- # also be escaped (for instance, the double-quotes surrounding attribute
44
- # values).
45
- #
46
- # print CGI.escapeElement('<BR><A HREF="url"></A>', "A", "IMG")
47
- # # "<BR>&lt;A HREF=&quot;url&quot;&gt;&lt;/A&gt"
48
- #
49
- # print CGI.escapeElement('<BR><A HREF="url"></A>', ["A", "IMG"])
50
- # # "<BR>&lt;A HREF=&quot;url&quot;&gt;&lt;/A&gt"
51
- #
52
- def escapeElement: (string string, *String | Array[String] elements) -> String
53
-
54
- # <!--
55
- # rdoc-file=lib/cgi/escape.rb
56
- # - escapeHTML(string)
57
- # -->
58
- # Escape special characters in HTML, namely `'&\"<>`
59
- # CGI.escapeHTML('Usage: foo "bar" <baz>')
60
- # # => "Usage: foo &quot;bar&quot; &lt;baz&gt;"
61
- #
62
- def escapeHTML: (string str) -> String
63
-
64
- # <!--
65
- # rdoc-file=lib/cgi/escape.rb
66
- # - escapeURIComponent(string)
67
- # -->
68
- # URL-encode a string following RFC 3986 Space characters (`" "`) are encoded
69
- # with (`"%20"`)
70
- # url_encoded_string = CGI.escapeURIComponent("'Stop!' said Fred")
71
- # # => "%27Stop%21%27%20said%20Fred"
72
- #
73
- def escapeURIComponent: (string) -> String
74
-
75
- # <!--
76
- # rdoc-file=lib/cgi/escape.rb
77
- # - escape_element(string, *elements)
78
- # -->
79
- #
80
- alias escape_element escapeElement
81
-
82
- # <!--
83
- # rdoc-file=lib/cgi/escape.rb
84
- # - escape_html(string)
85
- # -->
86
- #
87
- alias escape_html escapeHTML
88
-
89
- # <!--
90
- # rdoc-file=lib/cgi/escape.rb
91
- # - escape_uri_component(string)
92
- # -->
93
- #
94
- alias escape_uri_component escapeURIComponent
95
-
96
- # <!--
97
- # rdoc-file=lib/cgi/escape.rb
98
- # - h(string)
99
- # -->
100
- #
101
- alias h escapeHTML
102
-
103
- # <!--
104
- # rdoc-file=lib/cgi/escape.rb
105
- # - unescape(string, encoding = @@accept_charset)
106
- # -->
107
- # URL-decode an application/x-www-form-urlencoded string with
108
- # encoding(optional).
109
- # string = CGI.unescape("%27Stop%21%27+said+Fred")
110
- # # => "'Stop!' said Fred"
111
- #
112
- def unescape: (string str, ?encoding encoding) -> String
113
-
114
- # <!--
115
- # rdoc-file=lib/cgi/escape.rb
116
- # - unescapeElement(string, *elements)
117
- # -->
118
- # Undo escaping such as that done by CGI.escapeElement
119
- #
120
- # print CGI.unescapeElement(
121
- # CGI.escapeHTML('<BR><A HREF="url"></A>'), "A", "IMG")
122
- # # "&lt;BR&gt;<A HREF="url"></A>"
123
- #
124
- # print CGI.unescapeElement(
125
- # CGI.escapeHTML('<BR><A HREF="url"></A>'), ["A", "IMG"])
126
- # # "&lt;BR&gt;<A HREF="url"></A>"
127
- #
128
- def unescapeElement: (string string, *String | Array[String] elements) -> String
129
-
130
- # <!--
131
- # rdoc-file=lib/cgi/escape.rb
132
- # - unescapeHTML(string)
133
- # -->
134
- # Unescape a string that has been HTML-escaped
135
- # CGI.unescapeHTML("Usage: foo &quot;bar&quot; &lt;baz&gt;")
136
- # # => "Usage: foo \"bar\" <baz>"
137
- #
138
- def unescapeHTML: (string str) -> String
139
-
140
- # <!--
141
- # rdoc-file=lib/cgi/escape.rb
142
- # - unescapeURIComponent(string, encoding = @@accept_charset)
143
- # -->
144
- # URL-decode a string following RFC 3986 with encoding(optional).
145
- # string = CGI.unescapeURIComponent("%27Stop%21%27+said%20Fred")
146
- # # => "'Stop!'+said Fred"
147
- #
148
- def unescapeURIComponent: (string) -> String
149
-
150
- # <!--
151
- # rdoc-file=lib/cgi/escape.rb
152
- # - unescape_element(string, *elements)
153
- # -->
154
- #
155
- alias unescape_element unescapeElement
156
-
157
- # <!--
158
- # rdoc-file=lib/cgi/escape.rb
159
- # - unescape_html(string)
160
- # -->
161
- #
162
- alias unescape_html unescapeHTML
163
-
164
- # <!--
165
- # rdoc-file=lib/cgi/escape.rb
166
- # - unescape_uri_component(string, encoding = @@accept_charset)
167
- # -->
168
- #
169
- alias unescape_uri_component unescapeURIComponent
170
- end
171
- end