decentworks-date-support 0.1.0

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 (142) hide show
  1. checksums.yaml +7 -0
  2. data/.gem_rbs_collection/actionpack/7.2/.rbs_meta.yaml +9 -0
  3. data/.gem_rbs_collection/actionpack/7.2/actioncontroller-7.2.rbs +14 -0
  4. data/.gem_rbs_collection/actionpack/7.2/actioncontroller.rbs +290 -0
  5. data/.gem_rbs_collection/actionpack/7.2/actiondispatch.rbs +349 -0
  6. data/.gem_rbs_collection/actionpack/7.2/actionpack-generated.rbs +11497 -0
  7. data/.gem_rbs_collection/actionpack/7.2/patch.rbs +77 -0
  8. data/.gem_rbs_collection/actionview/6.0/.rbs_meta.yaml +9 -0
  9. data/.gem_rbs_collection/actionview/6.0/actionview-generated.rbs +8976 -0
  10. data/.gem_rbs_collection/actionview/6.0/actionview.rbs +1940 -0
  11. data/.gem_rbs_collection/actionview/6.0/patch.rbs +57 -0
  12. data/.gem_rbs_collection/activesupport/7.0/.rbs_meta.yaml +9 -0
  13. data/.gem_rbs_collection/activesupport/7.0/activesupport-7.0.rbs +381 -0
  14. data/.gem_rbs_collection/activesupport/7.0/activesupport-generated.rbs +11633 -0
  15. data/.gem_rbs_collection/activesupport/7.0/activesupport.rbs +724 -0
  16. data/.gem_rbs_collection/activesupport/7.0/manifest.yaml +15 -0
  17. data/.gem_rbs_collection/activesupport/7.0/patch.rbs +55 -0
  18. data/.gem_rbs_collection/ast/2.4/.rbs_meta.yaml +9 -0
  19. data/.gem_rbs_collection/ast/2.4/ast.rbs +73 -0
  20. data/.gem_rbs_collection/cgi/0.5/.rbs_meta.yaml +9 -0
  21. data/.gem_rbs_collection/cgi/0.5/core.rbs +925 -0
  22. data/.gem_rbs_collection/cgi/0.5/manifest.yaml +3 -0
  23. data/.gem_rbs_collection/concurrent-ruby/1.1/.rbs_meta.yaml +9 -0
  24. data/.gem_rbs_collection/concurrent-ruby/1.1/array.rbs +4 -0
  25. data/.gem_rbs_collection/concurrent-ruby/1.1/atomic_reference.rbs +16 -0
  26. data/.gem_rbs_collection/concurrent-ruby/1.1/executor.rbs +96 -0
  27. data/.gem_rbs_collection/concurrent-ruby/1.1/hash.rbs +4 -0
  28. data/.gem_rbs_collection/concurrent-ruby/1.1/map.rbs +68 -0
  29. data/.gem_rbs_collection/concurrent-ruby/1.1/promises.rbs +249 -0
  30. data/.gem_rbs_collection/concurrent-ruby/1.1/set.rbs +4 -0
  31. data/.gem_rbs_collection/concurrent-ruby/1.1/timer_task.rbs +47 -0
  32. data/.gem_rbs_collection/concurrent-ruby/1.1/utility/processor_counter.rbs +5 -0
  33. data/.gem_rbs_collection/connection_pool/2.4/.rbs_meta.yaml +9 -0
  34. data/.gem_rbs_collection/connection_pool/2.4/connection_pool.rbs +34 -0
  35. data/.gem_rbs_collection/connection_pool/2.4/manifest.yaml +2 -0
  36. data/.gem_rbs_collection/diff-lcs/1.5/.rbs_meta.yaml +9 -0
  37. data/.gem_rbs_collection/diff-lcs/1.5/diff-lcs.rbs +11 -0
  38. data/.gem_rbs_collection/faker/3.4.2/.rbs_meta.yaml +9 -0
  39. data/.gem_rbs_collection/faker/3.4.2/faker-2.23.rbs +90 -0
  40. data/.gem_rbs_collection/faker/3.4.2/faker.rbs +18 -0
  41. data/.gem_rbs_collection/i18n/1.10/.rbs_meta.yaml +9 -0
  42. data/.gem_rbs_collection/i18n/1.10/backend.rbs +274 -0
  43. data/.gem_rbs_collection/i18n/1.10/i18n.rbs +116 -0
  44. data/.gem_rbs_collection/lint_roller/1.1/.rbs_meta.yaml +9 -0
  45. data/.gem_rbs_collection/lint_roller/1.1/lint_roller.rbs +48 -0
  46. data/.gem_rbs_collection/minitest/5.25/.rbs_meta.yaml +9 -0
  47. data/.gem_rbs_collection/minitest/5.25/minitest/abstract_reporter.rbs +52 -0
  48. data/.gem_rbs_collection/minitest/5.25/minitest/assertion.rbs +17 -0
  49. data/.gem_rbs_collection/minitest/5.25/minitest/assertions.rbs +590 -0
  50. data/.gem_rbs_collection/minitest/5.25/minitest/backtrace_filter.rbs +23 -0
  51. data/.gem_rbs_collection/minitest/5.25/minitest/bench_spec.rbs +102 -0
  52. data/.gem_rbs_collection/minitest/5.25/minitest/benchmark.rbs +259 -0
  53. data/.gem_rbs_collection/minitest/5.25/minitest/composite_reporter.rbs +25 -0
  54. data/.gem_rbs_collection/minitest/5.25/minitest/compress.rbs +13 -0
  55. data/.gem_rbs_collection/minitest/5.25/minitest/error_on_warning.rbs +3 -0
  56. data/.gem_rbs_collection/minitest/5.25/minitest/expectation.rbs +2 -0
  57. data/.gem_rbs_collection/minitest/5.25/minitest/expectations.rbs +21 -0
  58. data/.gem_rbs_collection/minitest/5.25/minitest/guard.rbs +64 -0
  59. data/.gem_rbs_collection/minitest/5.25/minitest/mock.rbs +64 -0
  60. data/.gem_rbs_collection/minitest/5.25/minitest/parallel/executor.rbs +46 -0
  61. data/.gem_rbs_collection/minitest/5.25/minitest/parallel/test/class_methods.rbs +5 -0
  62. data/.gem_rbs_collection/minitest/5.25/minitest/parallel/test.rbs +3 -0
  63. data/.gem_rbs_collection/minitest/5.25/minitest/parallel.rbs +2 -0
  64. data/.gem_rbs_collection/minitest/5.25/minitest/pride_io.rbs +62 -0
  65. data/.gem_rbs_collection/minitest/5.25/minitest/pride_lol.rbs +19 -0
  66. data/.gem_rbs_collection/minitest/5.25/minitest/progress_reporter.rbs +11 -0
  67. data/.gem_rbs_collection/minitest/5.25/minitest/reportable.rbs +53 -0
  68. data/.gem_rbs_collection/minitest/5.25/minitest/reporter.rbs +5 -0
  69. data/.gem_rbs_collection/minitest/5.25/minitest/result.rbs +28 -0
  70. data/.gem_rbs_collection/minitest/5.25/minitest/runnable.rbs +163 -0
  71. data/.gem_rbs_collection/minitest/5.25/minitest/skip.rbs +6 -0
  72. data/.gem_rbs_collection/minitest/5.25/minitest/spec/dsl/instance_methods.rbs +48 -0
  73. data/.gem_rbs_collection/minitest/5.25/minitest/spec/dsl.rbs +129 -0
  74. data/.gem_rbs_collection/minitest/5.25/minitest/spec.rbs +11 -0
  75. data/.gem_rbs_collection/minitest/5.25/minitest/statistics_reporter.rbs +81 -0
  76. data/.gem_rbs_collection/minitest/5.25/minitest/summary_reporter.rbs +18 -0
  77. data/.gem_rbs_collection/minitest/5.25/minitest/test/lifecycle_hooks.rbs +92 -0
  78. data/.gem_rbs_collection/minitest/5.25/minitest/test.rbs +69 -0
  79. data/.gem_rbs_collection/minitest/5.25/minitest/unexpected_error.rbs +12 -0
  80. data/.gem_rbs_collection/minitest/5.25/minitest/unexpected_warning.rbs +6 -0
  81. data/.gem_rbs_collection/minitest/5.25/minitest/unit/test_case.rbs +3 -0
  82. data/.gem_rbs_collection/minitest/5.25/minitest/unit.rbs +4 -0
  83. data/.gem_rbs_collection/minitest/5.25/minitest.rbs +115 -0
  84. data/.gem_rbs_collection/nokogiri/1.11/.rbs_meta.yaml +9 -0
  85. data/.gem_rbs_collection/nokogiri/1.11/nokogiri.rbs +2332 -0
  86. data/.gem_rbs_collection/nokogiri/1.11/patch.rbs +4 -0
  87. data/.gem_rbs_collection/parallel/1.20/.rbs_meta.yaml +9 -0
  88. data/.gem_rbs_collection/parallel/1.20/parallel.rbs +86 -0
  89. data/.gem_rbs_collection/parser/3.2/.rbs_meta.yaml +9 -0
  90. data/.gem_rbs_collection/parser/3.2/manifest.yaml +7 -0
  91. data/.gem_rbs_collection/parser/3.2/parser.rbs +194 -0
  92. data/.gem_rbs_collection/parser/3.2/polyfill.rbs +4 -0
  93. data/.gem_rbs_collection/rack/2.2/.rbs_meta.yaml +9 -0
  94. data/.gem_rbs_collection/rack/2.2/manifest.yaml +3 -0
  95. data/.gem_rbs_collection/rack/2.2/rack.rbs +1480 -0
  96. data/.gem_rbs_collection/rails-dom-testing/2.0/.rbs_meta.yaml +9 -0
  97. data/.gem_rbs_collection/rails-dom-testing/2.0/rails-dom-testing.rbs +51 -0
  98. data/.gem_rbs_collection/rails-html-sanitizer/1.6/.rbs_meta.yaml +9 -0
  99. data/.gem_rbs_collection/rails-html-sanitizer/1.6/rails-html-sanitizer.rbs +53 -0
  100. data/.gem_rbs_collection/railties/6.0/.rbs_meta.yaml +9 -0
  101. data/.gem_rbs_collection/railties/6.0/manifest.yaml +2 -0
  102. data/.gem_rbs_collection/railties/6.0/patch.rbs +17 -0
  103. data/.gem_rbs_collection/railties/6.0/railties-generated.rbs +4822 -0
  104. data/.gem_rbs_collection/railties/6.0/railties.rbs +44 -0
  105. data/.gem_rbs_collection/rainbow/3.0/.rbs_meta.yaml +9 -0
  106. data/.gem_rbs_collection/rainbow/3.0/global.rbs +7 -0
  107. data/.gem_rbs_collection/rainbow/3.0/presenter.rbs +209 -0
  108. data/.gem_rbs_collection/rainbow/3.0/rainbow.rbs +5 -0
  109. data/.gem_rbs_collection/rake/13.0/.rbs_meta.yaml +9 -0
  110. data/.gem_rbs_collection/rake/13.0/manifest.yaml +2 -0
  111. data/.gem_rbs_collection/rake/13.0/rake.rbs +39 -0
  112. data/.gem_rbs_collection/regexp_parser/2.8/.rbs_meta.yaml +9 -0
  113. data/.gem_rbs_collection/regexp_parser/2.8/regexp_parser.rbs +17 -0
  114. data/.gem_rbs_collection/rubocop/1.57/.rbs_meta.yaml +9 -0
  115. data/.gem_rbs_collection/rubocop/1.57/rubocop.rbs +208 -0
  116. data/.gem_rbs_collection/rubocop-ast/1.46/.rbs_meta.yaml +9 -0
  117. data/.gem_rbs_collection/rubocop-ast/1.46/rubocop-ast.rbs +903 -0
  118. data/.gem_rbs_collection/thor/1.2/.rbs_meta.yaml +9 -0
  119. data/.gem_rbs_collection/thor/1.2/thor.rbs +62 -0
  120. data/.gem_rbs_collection/tzinfo/2.0/.rbs_meta.yaml +9 -0
  121. data/.gem_rbs_collection/tzinfo/2.0/manifest.yaml +7 -0
  122. data/.gem_rbs_collection/tzinfo/2.0/tzinfo.rbs +600 -0
  123. data/.rspec +3 -0
  124. data/.rubocop.yml +8 -0
  125. data/.ruby-version +1 -0
  126. data/CHANGELOG.md +5 -0
  127. data/CODE_OF_CONDUCT.md +132 -0
  128. data/LICENSE +21 -0
  129. data/LICENSE.txt +21 -0
  130. data/README.md +54 -0
  131. data/Rakefile +12 -0
  132. data/Steepfile +43 -0
  133. data/lib/decentworks/active_support/time_with_zone_support.rb +327 -0
  134. data/lib/decentworks/date/support/version.rb +9 -0
  135. data/lib/decentworks/date_support.rb +323 -0
  136. data/lib/decentworks_date_support.rb +4 -0
  137. data/rbs_collection.lock.yaml +288 -0
  138. data/rbs_collection.yaml +41 -0
  139. data/sig/decentworks/active_support/time_with_zone_support.rbs +109 -0
  140. data/sig/decentworks/date/support.rbs +8 -0
  141. data/sig/decentworks/date_support.rbs +107 -0
  142. metadata +197 -0
@@ -0,0 +1,925 @@
1
+ # <!-- rdoc-file=lib/cgi/escape.rb -->
2
+ # :stopdoc
3
+ #
4
+ class CGI
5
+ include CGI::Util
6
+
7
+ extend CGI::Util
8
+
9
+ include CGI::Escape
10
+
11
+ extend CGI::Escape
12
+
13
+ # <!--
14
+ # rdoc-file=lib/cgi/core.rb
15
+ # - CGI.new(tag_maker) { block }
16
+ # - CGI.new(options_hash = {}) { block }
17
+ # -->
18
+ # Create a new CGI instance.
19
+ #
20
+ # `tag_maker`
21
+ # : This is the same as using the `options_hash` form with the value `{
22
+ # :tag_maker => tag_maker }` Note that it is recommended to use the
23
+ # `options_hash` form, since it also allows you specify the charset you will
24
+ # accept.
25
+ #
26
+ # `options_hash`
27
+ # : A Hash that recognizes three options:
28
+ #
29
+ # `:accept_charset`
30
+ # : specifies encoding of received query string. If omitted,
31
+ # `@@accept_charset` is used. If the encoding is not valid, a
32
+ # CGI::InvalidEncoding will be raised.
33
+ #
34
+ # Example. Suppose `@@accept_charset` is "UTF-8"
35
+ #
36
+ # when not specified:
37
+ #
38
+ # cgi=CGI.new # @accept_charset # => "UTF-8"
39
+ #
40
+ # when specified as "EUC-JP":
41
+ #
42
+ # cgi=CGI.new(:accept_charset => "EUC-JP") # => "EUC-JP"
43
+ #
44
+ #
45
+ # `:tag_maker`
46
+ # : String that specifies which version of the HTML generation methods to
47
+ # use. If not specified, no HTML generation methods will be loaded.
48
+ #
49
+ # The following values are supported:
50
+ #
51
+ # "html3"
52
+ # : HTML 3.x
53
+ #
54
+ # "html4"
55
+ # : HTML 4.0
56
+ #
57
+ # "html4Tr"
58
+ # : HTML 4.0 Transitional
59
+ #
60
+ # "html4Fr"
61
+ # : HTML 4.0 with Framesets
62
+ #
63
+ # "html5"
64
+ # : HTML 5
65
+ #
66
+ #
67
+ #
68
+ # `:max_multipart_length`
69
+ # : Specifies maximum length of multipart data. Can be an Integer scalar
70
+ # or a lambda, that will be evaluated when the request is parsed. This
71
+ # allows more complex logic to be set when determining whether to accept
72
+ # multipart data (e.g. consult a registered users upload allowance)
73
+ #
74
+ # Default is 128 * 1024 * 1024 bytes
75
+ #
76
+ # cgi=CGI.new(:max_multipart_length => 268435456) # simple scalar
77
+ #
78
+ # cgi=CGI.new(:max_multipart_length => -> {check_filesystem}) # lambda
79
+ #
80
+ #
81
+ #
82
+ # `block`
83
+ # : If provided, the block is called when an invalid encoding is encountered.
84
+ # For example:
85
+ #
86
+ # encoding_errors={}
87
+ # cgi=CGI.new(:accept_charset=>"EUC-JP") do |name,value|
88
+ # encoding_errors[name] = value
89
+ # end
90
+ #
91
+ #
92
+ # Finally, if the CGI object is not created in a standard CGI call environment
93
+ # (that is, it can't locate REQUEST_METHOD in its environment), then it will run
94
+ # in "offline" mode. In this mode, it reads its parameters from the command
95
+ # line or (failing that) from standard input. Otherwise, cookies and other
96
+ # parameters are parsed automatically from the standard CGI locations, which
97
+ # varies according to the REQUEST_METHOD.
98
+ #
99
+ def initialize: (?String tag_maker) ?{ (String name, String value) -> void } -> void
100
+ | (Hash[Symbol, untyped] options_hash) ?{ (String name, String value) -> void } -> void
101
+
102
+ # <!--
103
+ # rdoc-file=lib/cgi/core.rb
104
+ # - accept_charset()
105
+ # -->
106
+ # Return the accept character set for all new CGI instances.
107
+ #
108
+ def self.accept_charset: () -> encoding
109
+
110
+ # <!--
111
+ # rdoc-file=lib/cgi/core.rb
112
+ # - accept_charset=(accept_charset)
113
+ # -->
114
+ # Set the accept character set for all new CGI instances.
115
+ #
116
+ def self.accept_charset=: (encoding accept_charset) -> encoding
117
+
118
+ # <!--
119
+ # rdoc-file=lib/cgi/core.rb
120
+ # - parse(query)
121
+ # -->
122
+ # Parse an HTTP query string into a hash of key=>value pairs.
123
+ #
124
+ # params = CGI.parse("query_string")
125
+ # # {"name1" => ["value1", "value2", ...],
126
+ # # "name2" => ["value1", "value2", ...], ... }
127
+ #
128
+ def self.parse: (String query) -> Hash[String, Array[String]]
129
+
130
+ # <!-- rdoc-file=lib/cgi/core.rb -->
131
+ # Return the accept character set for this CGI instance.
132
+ #
133
+ attr_reader accept_charset: encoding
134
+
135
+ # <!-- rdoc-file=lib/cgi/core.rb -->
136
+ # This method is an alias for #http_header, when HTML5 tag maker is inactive.
137
+ #
138
+ # NOTE: use #http_header to create HTTP header blocks, this alias is only
139
+ # provided for backwards compatibility.
140
+ #
141
+ # Using #header with the HTML5 tag maker will create a <header> element.
142
+ #
143
+ alias header http_header
144
+
145
+ # <!--
146
+ # rdoc-file=lib/cgi/core.rb
147
+ # - http_header(content_type_string="text/html")
148
+ # - http_header(headers_hash)
149
+ # -->
150
+ # Create an HTTP header block as a string.
151
+ #
152
+ # Includes the empty line that ends the header block.
153
+ #
154
+ # `content_type_string`
155
+ # : If this form is used, this string is the `Content-Type`
156
+ #
157
+ # `headers_hash`
158
+ # : A Hash of header values. The following header keys are recognized:
159
+ #
160
+ # type
161
+ # : The Content-Type header. Defaults to "text/html"
162
+ #
163
+ # charset
164
+ # : The charset of the body, appended to the Content-Type header.
165
+ #
166
+ # nph
167
+ # : A boolean value. If true, prepend protocol string and status code,
168
+ # and date; and sets default values for "server" and "connection" if not
169
+ # explicitly set.
170
+ #
171
+ # status
172
+ # : The HTTP status code as a String, returned as the Status header. The
173
+ # values are:
174
+ #
175
+ # OK
176
+ # : 200 OK
177
+ #
178
+ # PARTIAL_CONTENT
179
+ # : 206 Partial Content
180
+ #
181
+ # MULTIPLE_CHOICES
182
+ # : 300 Multiple Choices
183
+ #
184
+ # MOVED
185
+ # : 301 Moved Permanently
186
+ #
187
+ # REDIRECT
188
+ # : 302 Found
189
+ #
190
+ # NOT_MODIFIED
191
+ # : 304 Not Modified
192
+ #
193
+ # BAD_REQUEST
194
+ # : 400 Bad Request
195
+ #
196
+ # AUTH_REQUIRED
197
+ # : 401 Authorization Required
198
+ #
199
+ # FORBIDDEN
200
+ # : 403 Forbidden
201
+ #
202
+ # NOT_FOUND
203
+ # : 404 Not Found
204
+ #
205
+ # METHOD_NOT_ALLOWED
206
+ # : 405 Method Not Allowed
207
+ #
208
+ # NOT_ACCEPTABLE
209
+ # : 406 Not Acceptable
210
+ #
211
+ # LENGTH_REQUIRED
212
+ # : 411 Length Required
213
+ #
214
+ # PRECONDITION_FAILED
215
+ # : 412 Precondition Failed
216
+ #
217
+ # SERVER_ERROR
218
+ # : 500 Internal Server Error
219
+ #
220
+ # NOT_IMPLEMENTED
221
+ # : 501 Method Not Implemented
222
+ #
223
+ # BAD_GATEWAY
224
+ # : 502 Bad Gateway
225
+ #
226
+ # VARIANT_ALSO_VARIES
227
+ # : 506 Variant Also Negotiates
228
+ #
229
+ #
230
+ #
231
+ # server
232
+ # : The server software, returned as the Server header.
233
+ #
234
+ # connection
235
+ # : The connection type, returned as the Connection header (for instance,
236
+ # "close".
237
+ #
238
+ # length
239
+ # : The length of the content that will be sent, returned as the
240
+ # Content-Length header.
241
+ #
242
+ # language
243
+ # : The language of the content, returned as the Content-Language header.
244
+ #
245
+ # expires
246
+ # : The time on which the current content expires, as a `Time` object,
247
+ # returned as the Expires header.
248
+ #
249
+ # cookie
250
+ # : A cookie or cookies, returned as one or more Set-Cookie headers. The
251
+ # value can be the literal string of the cookie; a CGI::Cookie object;
252
+ # an Array of literal cookie strings or Cookie objects; or a hash all of
253
+ # whose values are literal cookie strings or Cookie objects.
254
+ #
255
+ # These cookies are in addition to the cookies held in the
256
+ # @output_cookies field.
257
+ #
258
+ #
259
+ # Other headers can also be set; they are appended as key: value.
260
+ #
261
+ #
262
+ # Examples:
263
+ #
264
+ # http_header
265
+ # # Content-Type: text/html
266
+ #
267
+ # http_header("text/plain")
268
+ # # Content-Type: text/plain
269
+ #
270
+ # http_header("nph" => true,
271
+ # "status" => "OK", # == "200 OK"
272
+ # # "status" => "200 GOOD",
273
+ # "server" => ENV['SERVER_SOFTWARE'],
274
+ # "connection" => "close",
275
+ # "type" => "text/html",
276
+ # "charset" => "iso-2022-jp",
277
+ # # Content-Type: text/html; charset=iso-2022-jp
278
+ # "length" => 103,
279
+ # "language" => "ja",
280
+ # "expires" => Time.now + 30,
281
+ # "cookie" => [cookie1, cookie2],
282
+ # "my_header1" => "my_value",
283
+ # "my_header2" => "my_value")
284
+ #
285
+ # This method does not perform charset conversion.
286
+ #
287
+ def http_header: (?String options) -> String
288
+ | (?Hash[interned, untyped] header_hash) -> String
289
+
290
+ def nph?: () -> untyped
291
+
292
+ # <!--
293
+ # rdoc-file=lib/cgi/core.rb
294
+ # - cgi.out(content_type_string='text/html')
295
+ # - cgi.out(headers_hash)
296
+ # -->
297
+ # Print an HTTP header and body to $DEFAULT_OUTPUT ($>)
298
+ #
299
+ # `content_type_string`
300
+ # : If a string is passed, it is assumed to be the content type.
301
+ #
302
+ # `headers_hash`
303
+ # : This is a Hash of headers, similar to that used by #http_header.
304
+ #
305
+ # `block`
306
+ # : A block is required and should evaluate to the body of the response.
307
+ #
308
+ #
309
+ # `Content-Length` is automatically calculated from the size of the String
310
+ # returned by the content block.
311
+ #
312
+ # If `ENV['REQUEST_METHOD'] == "HEAD"`, then only the header is output (the
313
+ # content block is still required, but it is ignored).
314
+ #
315
+ # If the charset is "iso-2022-jp" or "euc-jp" or "shift_jis" then the content is
316
+ # converted to this charset, and the language is set to "ja".
317
+ #
318
+ # Example:
319
+ #
320
+ # cgi = CGI.new
321
+ # cgi.out{ "string" }
322
+ # # Content-Type: text/html
323
+ # # Content-Length: 6
324
+ # #
325
+ # # string
326
+ #
327
+ # cgi.out("text/plain") { "string" }
328
+ # # Content-Type: text/plain
329
+ # # Content-Length: 6
330
+ # #
331
+ # # string
332
+ #
333
+ # cgi.out("nph" => true,
334
+ # "status" => "OK", # == "200 OK"
335
+ # "server" => ENV['SERVER_SOFTWARE'],
336
+ # "connection" => "close",
337
+ # "type" => "text/html",
338
+ # "charset" => "iso-2022-jp",
339
+ # # Content-Type: text/html; charset=iso-2022-jp
340
+ # "language" => "ja",
341
+ # "expires" => Time.now + (3600 * 24 * 30),
342
+ # "cookie" => [cookie1, cookie2],
343
+ # "my_header1" => "my_value",
344
+ # "my_header2" => "my_value") { "string" }
345
+ # # HTTP/1.1 200 OK
346
+ # # Date: Sun, 15 May 2011 17:35:54 GMT
347
+ # # Server: Apache 2.2.0
348
+ # # Connection: close
349
+ # # Content-Type: text/html; charset=iso-2022-jp
350
+ # # Content-Length: 6
351
+ # # Content-Language: ja
352
+ # # Expires: Tue, 14 Jun 2011 17:35:54 GMT
353
+ # # Set-Cookie: foo
354
+ # # Set-Cookie: bar
355
+ # # my_header1: my_value
356
+ # # my_header2: my_value
357
+ # #
358
+ # # string
359
+ #
360
+ def out: (?String content_type_string) { () -> String } -> void
361
+ | (Hash[interned, untyped] headers_hash) { () -> String } -> void
362
+
363
+ # <!--
364
+ # rdoc-file=lib/cgi/core.rb
365
+ # - print(*options)
366
+ # -->
367
+ # Print an argument or list of arguments to the default output stream
368
+ #
369
+ # cgi = CGI.new
370
+ # cgi.print # default: cgi.print == $DEFAULT_OUTPUT.print
371
+ #
372
+ def print: (*String options) -> void
373
+
374
+ private
375
+
376
+ # <!--
377
+ # rdoc-file=lib/cgi/core.rb
378
+ # - stdinput()
379
+ # -->
380
+ # Synonym for $stdin.
381
+ #
382
+ def stdinput: () -> ::IO
383
+
384
+ # <!--
385
+ # rdoc-file=lib/cgi/core.rb
386
+ # - stdoutput()
387
+ # -->
388
+ # Synonym for $stdout.
389
+ #
390
+ def stdoutput: () -> ::IO
391
+
392
+ # <!-- rdoc-file=lib/cgi/core.rb -->
393
+ # String for carriage return
394
+ #
395
+ CR: String
396
+
397
+ # <!-- rdoc-file=lib/cgi/core.rb -->
398
+ # Standard internet newline sequence
399
+ #
400
+ EOL: String
401
+
402
+ # <!-- rdoc-file=lib/cgi/core.rb -->
403
+ # HTTP status codes.
404
+ #
405
+ HTTP_STATUS: Hash[String, String]
406
+
407
+ # <!-- rdoc-file=lib/cgi/core.rb -->
408
+ # String for linefeed
409
+ #
410
+ LF: String
411
+
412
+ # <!-- rdoc-file=lib/cgi/core.rb -->
413
+ # Maximum number of request parameters when multipart
414
+ #
415
+ MAX_MULTIPART_COUNT: Integer
416
+
417
+ # <!-- rdoc-file=lib/cgi/core.rb -->
418
+ # Whether processing will be required in binary vs text
419
+ #
420
+ NEEDS_BINMODE: bool
421
+
422
+ # <!-- rdoc-file=lib/cgi/core.rb -->
423
+ # Path separators in different environments.
424
+ #
425
+ PATH_SEPARATOR: Hash[String, String]
426
+
427
+ REVISION: String
428
+
429
+ VERSION: String
430
+
431
+ # <!-- rdoc-file=lib/cgi/cookie.rb -->
432
+ # Class representing an HTTP cookie.
433
+ #
434
+ # In addition to its specific fields and methods, a Cookie instance is a
435
+ # delegator to the array of its values.
436
+ #
437
+ # See RFC 2965.
438
+ #
439
+ # ## Examples of use
440
+ # cookie1 = CGI::Cookie.new("name", "value1", "value2", ...)
441
+ # cookie1 = CGI::Cookie.new("name" => "name", "value" => "value")
442
+ # cookie1 = CGI::Cookie.new('name' => 'name',
443
+ # 'value' => ['value1', 'value2', ...],
444
+ # 'path' => 'path', # optional
445
+ # 'domain' => 'domain', # optional
446
+ # 'expires' => Time.now, # optional
447
+ # 'secure' => true, # optional
448
+ # 'httponly' => true # optional
449
+ # )
450
+ #
451
+ # cgi.out("cookie" => [cookie1, cookie2]) { "string" }
452
+ #
453
+ # name = cookie1.name
454
+ # values = cookie1.value
455
+ # path = cookie1.path
456
+ # domain = cookie1.domain
457
+ # expires = cookie1.expires
458
+ # secure = cookie1.secure
459
+ # httponly = cookie1.httponly
460
+ #
461
+ # cookie1.name = 'name'
462
+ # cookie1.value = ['value1', 'value2', ...]
463
+ # cookie1.path = 'path'
464
+ # cookie1.domain = 'domain'
465
+ # cookie1.expires = Time.now + 30
466
+ # cookie1.secure = true
467
+ # cookie1.httponly = true
468
+ #
469
+ class Cookie < Array[String]
470
+ # <!--
471
+ # rdoc-file=lib/cgi/cookie.rb
472
+ # - parse(raw_cookie)
473
+ # -->
474
+ # Parse a raw cookie string into a hash of cookie-name=>Cookie pairs.
475
+ #
476
+ # cookies = CGI::Cookie.parse("raw_cookie_string")
477
+ # # { "name1" => cookie1, "name2" => cookie2, ... }
478
+ #
479
+ def self.parse: (String raw_cookie) -> Hash[String, instance]
480
+
481
+ # <!-- rdoc-file=lib/cgi/cookie.rb -->
482
+ # Domain for which this cookie applies, as a `String`
483
+ #
484
+ def domain: () -> String?
485
+
486
+ # <!--
487
+ # rdoc-file=lib/cgi/cookie.rb
488
+ # - domain=(str)
489
+ # -->
490
+ # Set domain for which this cookie applies
491
+ #
492
+ def domain=: (String domain) -> String
493
+
494
+ # <!-- rdoc-file=lib/cgi/cookie.rb -->
495
+ # Time at which this cookie expires, as a `Time`
496
+ #
497
+ def expires: () -> Time?
498
+
499
+ # <!-- rdoc-file=lib/cgi/cookie.rb -->
500
+ # Time at which this cookie expires, as a `Time`
501
+ #
502
+ def expires=: (Time time) -> Time
503
+
504
+ # <!-- rdoc-file=lib/cgi/cookie.rb -->
505
+ # True if this cookie is httponly; false otherwise
506
+ #
507
+ def httponly: () -> bool
508
+
509
+ # <!--
510
+ # rdoc-file=lib/cgi/cookie.rb
511
+ # - httponly=(val)
512
+ # -->
513
+ # Set whether the Cookie is a httponly cookie or not.
514
+ #
515
+ # `val` must be a boolean.
516
+ #
517
+ def httponly=: (boolish val) -> bool
518
+
519
+ # <!--
520
+ # rdoc-file=lib/cgi/cookie.rb
521
+ # - inspect()
522
+ # -->
523
+ # A summary of cookie string.
524
+ #
525
+ def inspect: () -> String
526
+
527
+ # <!-- rdoc-file=lib/cgi/cookie.rb -->
528
+ # Name of this cookie, as a `String`
529
+ #
530
+ def name: () -> String
531
+
532
+ # <!--
533
+ # rdoc-file=lib/cgi/cookie.rb
534
+ # - name=(str)
535
+ # -->
536
+ # Set name of this cookie
537
+ #
538
+ def name=: (String name) -> String
539
+
540
+ # <!-- rdoc-file=lib/cgi/cookie.rb -->
541
+ # Path for which this cookie applies, as a `String`
542
+ #
543
+ def path: () -> String?
544
+
545
+ # <!--
546
+ # rdoc-file=lib/cgi/cookie.rb
547
+ # - path=(str)
548
+ # -->
549
+ # Set path for which this cookie applies
550
+ #
551
+ def path=: (String path) -> String
552
+
553
+ # <!-- rdoc-file=lib/cgi/cookie.rb -->
554
+ # True if this cookie is secure; false otherwise
555
+ #
556
+ def secure: () -> bool
557
+
558
+ # <!--
559
+ # rdoc-file=lib/cgi/cookie.rb
560
+ # - secure=(val)
561
+ # -->
562
+ # Set whether the Cookie is a secure cookie or not.
563
+ #
564
+ # `val` must be a boolean.
565
+ #
566
+ def secure=: [A] (boolish val) -> A
567
+
568
+ # <!--
569
+ # rdoc-file=lib/cgi/cookie.rb
570
+ # - to_s()
571
+ # -->
572
+ # Convert the Cookie to its string representation.
573
+ #
574
+ def to_s: () -> String
575
+
576
+ # <!--
577
+ # rdoc-file=lib/cgi/cookie.rb
578
+ # - value()
579
+ # -->
580
+ # Returns the value or list of values for this cookie.
581
+ #
582
+ def value: () -> Array[String]
583
+
584
+ # <!--
585
+ # rdoc-file=lib/cgi/cookie.rb
586
+ # - value=(val)
587
+ # -->
588
+ # Replaces the value of this cookie with a new value or list of values.
589
+ #
590
+ def value=: (String val) -> String
591
+ | (Array[String] val) -> Array[String]
592
+
593
+ private
594
+
595
+ # <!--
596
+ # rdoc-file=lib/cgi/cookie.rb
597
+ # - Cookie.new(name_string,*value)
598
+ # - Cookie.new(options_hash)
599
+ # -->
600
+ # Create a new CGI::Cookie object.
601
+ #
602
+ # `name_string`
603
+ # : The name of the cookie; in this form, there is no #domain or #expiration.
604
+ # The #path is gleaned from the `SCRIPT_NAME` environment variable, and
605
+ # #secure is false.
606
+ #
607
+ # `*value`
608
+ # : value or list of values of the cookie
609
+ #
610
+ # `options_hash`
611
+ # : A Hash of options to initialize this Cookie. Possible options are:
612
+ #
613
+ # name
614
+ # : the name of the cookie. Required.
615
+ #
616
+ # value
617
+ # : the cookie's value or list of values.
618
+ #
619
+ # path
620
+ # : the path for which this cookie applies. Defaults to the value of the
621
+ # `SCRIPT_NAME` environment variable.
622
+ #
623
+ # domain
624
+ # : the domain for which this cookie applies.
625
+ #
626
+ # expires
627
+ # : the time at which this cookie expires, as a `Time` object.
628
+ #
629
+ # secure
630
+ # : whether this cookie is a secure cookie or not (default to false).
631
+ # Secure cookies are only transmitted to HTTPS servers.
632
+ #
633
+ # httponly
634
+ # : whether this cookie is a HttpOnly cookie or not (default to
635
+ #
636
+ # false). HttpOnly cookies are not available to javascript.
637
+ #
638
+ # These keywords correspond to attributes of the cookie object.
639
+ #
640
+ def initialize: (String name_string, *String value) -> void
641
+ | (Hash[String, untyped] options_hash) -> void
642
+ end
643
+
644
+ # <!-- rdoc-file=lib/cgi/core.rb -->
645
+ # Exception raised when there is an invalid encoding detected
646
+ #
647
+ class InvalidEncoding < Exception
648
+ end
649
+
650
+ # <!-- rdoc-file=lib/cgi/core.rb -->
651
+ # Mixin module that provides the following:
652
+ #
653
+ # 1. Access to the CGI environment variables as methods. See documentation to
654
+ # the CGI class for a list of these variables. The methods are exposed by
655
+ # removing the leading `HTTP_` (if it exists) and downcasing the name. For
656
+ # example, `auth_type` will return the environment variable `AUTH_TYPE`, and
657
+ # `accept` will return the value for `HTTP_ACCEPT`.
658
+ #
659
+ # 2. Access to cookies, including the cookies attribute.
660
+ #
661
+ # 3. Access to parameters, including the params attribute, and overloading #[]
662
+ # to perform parameter value lookup by key.
663
+ #
664
+ # 4. The initialize_query method, for initializing the above mechanisms,
665
+ # handling multipart forms, and allowing the class to be used in "offline"
666
+ # mode.
667
+ #
668
+ module QueryExtension
669
+ # <!--
670
+ # rdoc-file=lib/cgi/core.rb
671
+ # - [](key)
672
+ # -->
673
+ # Get the value for the parameter with a given key.
674
+ #
675
+ # If the parameter has multiple values, only the first will be retrieved; use
676
+ # #params to get the array of values.
677
+ #
678
+ def []: (String key) -> String?
679
+
680
+ def accept: () -> String?
681
+
682
+ def accept_charset: () -> String?
683
+
684
+ def accept_encoding: () -> String?
685
+
686
+ def accept_language: () -> String?
687
+
688
+ def auth_type: () -> String?
689
+
690
+ def cache_control: () -> String?
691
+
692
+ def content_length: () -> String?
693
+
694
+ def content_type: () -> String?
695
+
696
+ # <!-- rdoc-file=lib/cgi/core.rb -->
697
+ # Get the cookies as a hash of cookie-name=>Cookie pairs.
698
+ #
699
+ def cookies: () -> Hash[String, Cookie]
700
+
701
+ # <!-- rdoc-file=lib/cgi/core.rb -->
702
+ # Get the cookies as a hash of cookie-name=>Cookie pairs.
703
+ #
704
+ def cookies=: (Hash[String, Cookie] cookies) -> Hash[String, Cookie]
705
+
706
+ def create_body: (boolish is_large) -> (Tempfile | StringIO)
707
+
708
+ # <!-- rdoc-file=lib/cgi/core.rb -->
709
+ # Get the uploaded files as a hash of name=>values pairs
710
+ #
711
+ def files: () -> Hash[String, Tempfile | StringIO]
712
+
713
+ def from: () -> String?
714
+
715
+ def gateway_interface: () -> String?
716
+
717
+ # <!--
718
+ # rdoc-file=lib/cgi/core.rb
719
+ # - has_key?(*args)
720
+ # -->
721
+ # Returns true if a given query string parameter exists.
722
+ #
723
+ def has_key?: (String key) -> bool
724
+
725
+ def host: () -> String?
726
+
727
+ # <!--
728
+ # rdoc-file=lib/cgi/core.rb
729
+ # - include?(*args)
730
+ # -->
731
+ #
732
+ alias include? has_key?
733
+
734
+ # <!--
735
+ # rdoc-file=lib/cgi/core.rb
736
+ # - key?(*args)
737
+ # -->
738
+ #
739
+ alias key? has_key?
740
+
741
+ # <!--
742
+ # rdoc-file=lib/cgi/core.rb
743
+ # - keys(*args)
744
+ # -->
745
+ # Return all query parameter names as an array of String.
746
+ #
747
+ def keys: () -> Array[String]
748
+
749
+ # <!--
750
+ # rdoc-file=lib/cgi/core.rb
751
+ # - multipart?()
752
+ # -->
753
+ # Returns whether the form contained multipart/form-data
754
+ #
755
+ def multipart?: () -> bool
756
+
757
+ def negotiate: () -> String?
758
+
759
+ # <!-- rdoc-file=lib/cgi/core.rb -->
760
+ # Get the parameters as a hash of name=>values pairs, where values is an Array.
761
+ #
762
+ def params: () -> Hash[String, Array[String] | Tempfile | StringIO]
763
+
764
+ # <!--
765
+ # rdoc-file=lib/cgi/core.rb
766
+ # - params=(hash)
767
+ # -->
768
+ # Set all the parameters.
769
+ #
770
+ def params=: (Hash[String, Array[String] | Tempfile | StringIO] hash) -> Hash[String, Array[String] | Tempfile | StringIO]
771
+
772
+ def path_info: () -> String?
773
+
774
+ def path_translated: () -> String?
775
+
776
+ def pragma: () -> String?
777
+
778
+ def query_string: () -> String?
779
+
780
+ # <!--
781
+ # rdoc-file=lib/cgi/core.rb
782
+ # - raw_cookie()
783
+ # -->
784
+ # Get the raw cookies as a string.
785
+ #
786
+ def raw_cookie: () -> String?
787
+
788
+ # <!--
789
+ # rdoc-file=lib/cgi/core.rb
790
+ # - raw_cookie2()
791
+ # -->
792
+ # Get the raw RFC2965 cookies as a string.
793
+ #
794
+ def raw_cookie2: () -> String?
795
+
796
+ def referer: () -> String?
797
+
798
+ def remote_addr: () -> String?
799
+
800
+ def remote_host: () -> String?
801
+
802
+ def remote_ident: () -> String?
803
+
804
+ def remote_user: () -> String?
805
+
806
+ def request_method: () -> String?
807
+
808
+ def script_name: () -> String?
809
+
810
+ def server_name: () -> String?
811
+
812
+ def server_port: () -> String?
813
+
814
+ def server_protocol: () -> String?
815
+
816
+ def server_software: () -> String?
817
+
818
+ def unescape_filename?: () -> bool
819
+
820
+ def user_agent: () -> String?
821
+
822
+ private
823
+
824
+ # <!--
825
+ # rdoc-file=lib/cgi/core.rb
826
+ # - initialize_query()
827
+ # -->
828
+ # A wrapper class to use a StringIO object as the body and switch to a TempFile
829
+ # when the passed threshold is passed. Initialize the data from the query.
830
+ #
831
+ # Handles multipart forms (in particular, forms that involve file uploads).
832
+ # Reads query parameters in the @params field, and cookies into @cookies.
833
+ #
834
+ def initialize_query: () -> void
835
+
836
+ # <!--
837
+ # rdoc-file=lib/cgi/core.rb
838
+ # - read_from_cmdline()
839
+ # -->
840
+ # offline mode. read name=value pairs on standard input.
841
+ #
842
+ def read_from_cmdline: () -> String
843
+
844
+ # <!--
845
+ # rdoc-file=lib/cgi/core.rb
846
+ # - read_multipart(boundary, content_length)
847
+ # -->
848
+ # Parses multipart form elements according to
849
+ # http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.2
850
+ #
851
+ # Returns a hash of multipart form parameters with bodies of type StringIO or
852
+ # Tempfile depending on whether the multipart form element exceeds 10 KB
853
+ #
854
+ # params[name => body]
855
+ #
856
+ def read_multipart: (String boundary, Integer content_length) -> (Tempfile | StringIO)
857
+ end
858
+
859
+ module Util
860
+ # <!--
861
+ # rdoc-file=lib/cgi/util.rb
862
+ # - pretty(string, shift = " ")
863
+ # -->
864
+ # Prettify (indent) an HTML string.
865
+ #
866
+ # `string` is the HTML string to indent. `shift` is the indentation unit to
867
+ # use; it defaults to two spaces.
868
+ #
869
+ # print CGI.pretty("<HTML><BODY></BODY></HTML>")
870
+ # # <HTML>
871
+ # # <BODY>
872
+ # # </BODY>
873
+ # # </HTML>
874
+ #
875
+ # print CGI.pretty("<HTML><BODY></BODY></HTML>", "\t")
876
+ # # <HTML>
877
+ # # <BODY>
878
+ # # </BODY>
879
+ # # </HTML>
880
+ #
881
+ def pretty: (string string, ?String shift) -> String
882
+
883
+ # <!--
884
+ # rdoc-file=lib/cgi/util.rb
885
+ # - rfc1123_date(time)
886
+ # -->
887
+ # Format a `Time` object as a String using the format specified by RFC 1123.
888
+ #
889
+ # CGI.rfc1123_date(Time.now)
890
+ # # Sat, 01 Jan 2000 00:00:00 GMT
891
+ #
892
+ def rfc1123_date: (Time time) -> String
893
+ end
894
+
895
+ module Escape
896
+ def escape: (String) -> String
897
+ def unescape: (String, ?encoding: Encoding) -> String
898
+
899
+ def escapeURIComponent: (String) -> String
900
+ def unescapeURIComponent: (String, ?encoding: Encoding) -> String
901
+ alias escape_uri_component escapeURIComponent
902
+ alias unescape_uri_component unescapeURIComponent
903
+
904
+ def escapeHTML: (String) -> String
905
+ def unescapeHTML: (String) -> String
906
+ alias escape_html escapeHTML
907
+ alias unescape_html unescapeHTML
908
+ alias h escapeHTML
909
+
910
+ def escapeElement: (String, *String) -> String
911
+ | (String, Array[String]) -> String
912
+ def unescapeElement: (String, *String) -> String
913
+ | (String, Array[String]) -> String
914
+ alias escape_element escapeElement
915
+ alias unescape_element unescapeElement
916
+
917
+ # <!-- rdoc-file=lib/cgi/escape.rb -->
918
+ # The set of special characters and their escaped values
919
+ #
920
+ TABLE_FOR_ESCAPE_HTML__: Hash[String, String]
921
+ end
922
+
923
+ module EscapeExt
924
+ end
925
+ end