parking_ticket 1.0.46 → 1.0.49

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 (67) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +4 -0
  3. data/.vscode/settings.json +3 -0
  4. data/Gemfile +0 -15
  5. data/Gemfile.lock +72 -4
  6. data/Rakefile +2 -2
  7. data/bin/console +3 -3
  8. data/bin/tapioca +29 -0
  9. data/lib/clients/models/payment_method.rb +15 -0
  10. data/lib/clients/models/quote.rb +16 -0
  11. data/lib/clients/models/rate_option.rb +19 -0
  12. data/lib/clients/models/structuraly_comparable.rb +14 -0
  13. data/lib/clients/models/ticket.rb +19 -0
  14. data/lib/clients/models/vehicle.rb +17 -0
  15. data/lib/clients/pay_by_phone/adapter.rb +107 -53
  16. data/lib/clients/pay_by_phone/client.rb +101 -38
  17. data/lib/parking_ticket/configuration.rb +3 -0
  18. data/lib/parking_ticket/version.rb +2 -1
  19. data/lib/parking_ticket.rb +79 -54
  20. data/sorbet/config +4 -0
  21. data/sorbet/rbi/annotations/faraday.rbi +17 -0
  22. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  23. data/sorbet/rbi/annotations/webmock.rbi +9 -0
  24. data/sorbet/rbi/gems/addressable@2.8.1.rbi +2000 -0
  25. data/sorbet/rbi/gems/amazing_print@1.4.0.rbi +872 -0
  26. data/sorbet/rbi/gems/ast@2.4.2.rbi +584 -0
  27. data/sorbet/rbi/gems/crack@0.4.5.rbi +144 -0
  28. data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +1079 -0
  29. data/sorbet/rbi/gems/faraday-net_http@3.0.2.rbi +146 -0
  30. data/sorbet/rbi/gems/faraday@2.7.2.rbi +2518 -0
  31. data/sorbet/rbi/gems/hashdiff@1.0.1.rbi +350 -0
  32. data/sorbet/rbi/gems/json@2.6.3.rbi +1541 -0
  33. data/sorbet/rbi/gems/json_matchers@0.11.1.rbi +133 -0
  34. data/sorbet/rbi/gems/json_schema@0.21.0.rbi +1165 -0
  35. data/sorbet/rbi/gems/netrc@0.11.0.rbi +161 -0
  36. data/sorbet/rbi/gems/parallel@1.22.1.rbi +277 -0
  37. data/sorbet/rbi/gems/parser@3.2.2.0.rbi +7207 -0
  38. data/sorbet/rbi/gems/public_suffix@5.0.1.rbi +940 -0
  39. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +402 -0
  40. data/sorbet/rbi/gems/rake@13.0.6.rbi +2881 -0
  41. data/sorbet/rbi/gems/rbi@0.0.16.rbi +3008 -0
  42. data/sorbet/rbi/gems/regexp_parser@2.7.0.rbi +3600 -0
  43. data/sorbet/rbi/gems/rexml@3.2.5.rbi +4823 -0
  44. data/sorbet/rbi/gems/rspec-core@3.12.0.rbi +10826 -0
  45. data/sorbet/rbi/gems/rspec-expectations@3.12.1.rbi +8118 -0
  46. data/sorbet/rbi/gems/rspec-mocks@3.12.1.rbi +5300 -0
  47. data/sorbet/rbi/gems/rspec-support@3.12.0.rbi +1615 -0
  48. data/sorbet/rbi/gems/rspec@3.12.0.rbi +82 -0
  49. data/sorbet/rbi/gems/rubocop-ast@1.28.0.rbi +6985 -0
  50. data/sorbet/rbi/gems/rubocop-sorbet@0.7.0.rbi +1043 -0
  51. data/sorbet/rbi/gems/rubocop@1.48.1.rbi +54934 -0
  52. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1317 -0
  53. data/sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi +8 -0
  54. data/sorbet/rbi/gems/spoom@1.2.1.rbi +2503 -0
  55. data/sorbet/rbi/gems/tapioca@0.11.4.rbi +3212 -0
  56. data/sorbet/rbi/gems/thor@1.2.1.rbi +3956 -0
  57. data/sorbet/rbi/gems/unicode-display_width@2.4.2.rbi +65 -0
  58. data/sorbet/rbi/gems/unparser@0.6.7.rbi +4515 -0
  59. data/sorbet/rbi/gems/vcr@6.1.0.rbi +3023 -0
  60. data/sorbet/rbi/gems/webmock@3.18.1.rbi +1728 -0
  61. data/sorbet/rbi/gems/webrick@1.7.0.rbi +2584 -0
  62. data/sorbet/rbi/gems/yard-sorbet@0.8.0.rbi +441 -0
  63. data/sorbet/rbi/gems/yard@0.9.28.rbi +17802 -0
  64. data/sorbet/tapioca/config.yml +13 -0
  65. data/sorbet/tapioca/require.rb +4 -0
  66. metadata +241 -4
  67. data/lib/clients/adapter.rb +0 -75
@@ -0,0 +1,2584 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `webrick` gem.
5
+ # Please instead update this file by running `bin/tapioca gem webrick`.
6
+
7
+ # AccessLog provides logging to various files in various formats.
8
+ #
9
+ # Multiple logs may be written to at the same time:
10
+ #
11
+ # access_log = [
12
+ # [$stderr, WEBrick::AccessLog::COMMON_LOG_FORMAT],
13
+ # [$stderr, WEBrick::AccessLog::REFERER_LOG_FORMAT],
14
+ # ]
15
+ #
16
+ # server = WEBrick::HTTPServer.new :AccessLog => access_log
17
+ #
18
+ # Custom log formats may be defined. WEBrick::AccessLog provides a subset
19
+ # of the formatting from Apache's mod_log_config
20
+ # http://httpd.apache.org/docs/mod/mod_log_config.html#formats. See
21
+ # AccessLog::setup_params for a list of supported options
22
+ #
23
+ # source://webrick//lib/webrick/accesslog.rb#30
24
+ module WEBrick::AccessLog
25
+ private
26
+
27
+ # Escapes control characters in +data+
28
+ #
29
+ # source://webrick//lib/webrick/accesslog.rb#151
30
+ def escape(data); end
31
+
32
+ # Formats +params+ according to +format_string+ which is described in
33
+ # setup_params.
34
+ #
35
+ # source://webrick//lib/webrick/accesslog.rb#123
36
+ def format(format_string, params); end
37
+
38
+ # This format specification is a subset of mod_log_config of Apache:
39
+ #
40
+ # %a:: Remote IP address
41
+ # %b:: Total response size
42
+ # %e{variable}:: Given variable in ENV
43
+ # %f:: Response filename
44
+ # %h:: Remote host name
45
+ # %{header}i:: Given request header
46
+ # %l:: Remote logname, always "-"
47
+ # %m:: Request method
48
+ # %{attr}n:: Given request attribute from <tt>req.attributes</tt>
49
+ # %{header}o:: Given response header
50
+ # %p:: Server's request port
51
+ # %{format}p:: The canonical port of the server serving the request or the
52
+ # actual port or the client's actual port. Valid formats are
53
+ # canonical, local or remote.
54
+ # %q:: Request query string
55
+ # %r:: First line of the request
56
+ # %s:: Request status
57
+ # %t:: Time the request was received
58
+ # %T:: Time taken to process the request
59
+ # %u:: Remote user from auth
60
+ # %U:: Unparsed URI
61
+ # %%:: Literal %
62
+ #
63
+ # source://webrick//lib/webrick/accesslog.rb#95
64
+ def setup_params(config, req, res); end
65
+
66
+ class << self
67
+ # Escapes control characters in +data+
68
+ #
69
+ # source://webrick//lib/webrick/accesslog.rb#151
70
+ def escape(data); end
71
+
72
+ # Formats +params+ according to +format_string+ which is described in
73
+ # setup_params.
74
+ #
75
+ # source://webrick//lib/webrick/accesslog.rb#123
76
+ def format(format_string, params); end
77
+
78
+ # This format specification is a subset of mod_log_config of Apache:
79
+ #
80
+ # %a:: Remote IP address
81
+ # %b:: Total response size
82
+ # %e{variable}:: Given variable in ENV
83
+ # %f:: Response filename
84
+ # %h:: Remote host name
85
+ # %{header}i:: Given request header
86
+ # %l:: Remote logname, always "-"
87
+ # %m:: Request method
88
+ # %{attr}n:: Given request attribute from <tt>req.attributes</tt>
89
+ # %{header}o:: Given response header
90
+ # %p:: Server's request port
91
+ # %{format}p:: The canonical port of the server serving the request or the
92
+ # actual port or the client's actual port. Valid formats are
93
+ # canonical, local or remote.
94
+ # %q:: Request query string
95
+ # %r:: First line of the request
96
+ # %s:: Request status
97
+ # %t:: Time the request was received
98
+ # %T:: Time taken to process the request
99
+ # %u:: Remote user from auth
100
+ # %U:: Unparsed URI
101
+ # %%:: Literal %
102
+ #
103
+ # source://webrick//lib/webrick/accesslog.rb#95
104
+ def setup_params(config, req, res); end
105
+ end
106
+ end
107
+
108
+ # A generic logging class
109
+ #
110
+ # source://webrick//lib/webrick/log.rb#17
111
+ class WEBrick::BasicLog
112
+ # Initializes a new logger for +log_file+ that outputs messages at +level+
113
+ # or higher. +log_file+ can be a filename, an IO-like object that
114
+ # responds to #<< or nil which outputs to $stderr.
115
+ #
116
+ # If no level is given INFO is chosen by default
117
+ #
118
+ # @return [BasicLog] a new instance of BasicLog
119
+ #
120
+ # source://webrick//lib/webrick/log.rb#50
121
+ def initialize(log_file = T.unsafe(nil), level = T.unsafe(nil)); end
122
+
123
+ # Synonym for log(INFO, obj.to_s)
124
+ #
125
+ # source://webrick//lib/webrick/log.rb#84
126
+ def <<(obj); end
127
+
128
+ # Closes the logger (also closes the log device associated to the logger)
129
+ #
130
+ # source://webrick//lib/webrick/log.rb#66
131
+ def close; end
132
+
133
+ # Shortcut for logging a DEBUG message
134
+ #
135
+ # source://webrick//lib/webrick/log.rb#97
136
+ def debug(msg); end
137
+
138
+ # Will the logger output DEBUG messages?
139
+ #
140
+ # @return [Boolean]
141
+ #
142
+ # source://webrick//lib/webrick/log.rb#108
143
+ def debug?; end
144
+
145
+ # Shortcut for logging an ERROR message
146
+ #
147
+ # source://webrick//lib/webrick/log.rb#91
148
+ def error(msg); end
149
+
150
+ # Will the logger output ERROR messages?
151
+ #
152
+ # @return [Boolean]
153
+ #
154
+ # source://webrick//lib/webrick/log.rb#102
155
+ def error?; end
156
+
157
+ # Shortcut for logging a FATAL message
158
+ #
159
+ # source://webrick//lib/webrick/log.rb#89
160
+ def fatal(msg); end
161
+
162
+ # Will the logger output FATAL messages?
163
+ #
164
+ # @return [Boolean]
165
+ #
166
+ # source://webrick//lib/webrick/log.rb#100
167
+ def fatal?; end
168
+
169
+ # Shortcut for logging an INFO message
170
+ #
171
+ # source://webrick//lib/webrick/log.rb#95
172
+ def info(msg); end
173
+
174
+ # Will the logger output INFO messages?
175
+ #
176
+ # @return [Boolean]
177
+ #
178
+ # source://webrick//lib/webrick/log.rb#106
179
+ def info?; end
180
+
181
+ # log-level, messages above this level will be logged
182
+ #
183
+ # source://webrick//lib/webrick/log.rb#41
184
+ def level; end
185
+
186
+ # log-level, messages above this level will be logged
187
+ #
188
+ # source://webrick//lib/webrick/log.rb#41
189
+ def level=(_arg0); end
190
+
191
+ # Logs +data+ at +level+ if the given level is above the current log
192
+ # level.
193
+ #
194
+ # source://webrick//lib/webrick/log.rb#75
195
+ def log(level, data); end
196
+
197
+ # Shortcut for logging a WARN message
198
+ #
199
+ # source://webrick//lib/webrick/log.rb#93
200
+ def warn(msg); end
201
+
202
+ # Will the logger output WARN messages?
203
+ #
204
+ # @return [Boolean]
205
+ #
206
+ # source://webrick//lib/webrick/log.rb#104
207
+ def warn?; end
208
+
209
+ private
210
+
211
+ # Formats +arg+ for the logger
212
+ #
213
+ # * If +arg+ is an Exception, it will format the error message and
214
+ # the back trace.
215
+ # * If +arg+ responds to #to_str, it will return it.
216
+ # * Otherwise it will return +arg+.inspect.
217
+ #
218
+ # source://webrick//lib/webrick/log.rb#119
219
+ def format(arg); end
220
+ end
221
+
222
+ # --
223
+ # Updates WEBrick::GenericServer with SSL functionality
224
+ #
225
+ # source://webrick//lib/webrick/server.rb#56
226
+ class WEBrick::GenericServer
227
+ # Creates a new generic server from +config+. The default configuration
228
+ # comes from +default+.
229
+ #
230
+ # @return [GenericServer] a new instance of GenericServer
231
+ #
232
+ # source://webrick//lib/webrick/server.rb#88
233
+ def initialize(config = T.unsafe(nil), default = T.unsafe(nil)); end
234
+
235
+ # Retrieves +key+ from the configuration
236
+ #
237
+ # source://webrick//lib/webrick/server.rb#121
238
+ def [](key); end
239
+
240
+ # The server configuration
241
+ #
242
+ # source://webrick//lib/webrick/server.rb#66
243
+ def config; end
244
+
245
+ # Updates +listen+ to enable SSL when the SSL configuration is active.
246
+ #
247
+ # source://webrick//lib/webrick/server.rb#129
248
+ def listen(address, port); end
249
+
250
+ # Sockets listening for connections.
251
+ #
252
+ # source://webrick//lib/webrick/server.rb#82
253
+ def listeners; end
254
+
255
+ # The server logger. This is independent from the HTTP access log.
256
+ #
257
+ # source://webrick//lib/webrick/server.rb#71
258
+ def logger; end
259
+
260
+ # You must subclass GenericServer and implement \#run which accepts a TCP
261
+ # client socket
262
+ #
263
+ # source://webrick//lib/webrick/server.rb#244
264
+ def run(sock); end
265
+
266
+ # Shuts down the server and all listening sockets. New listeners must be
267
+ # provided to restart the server.
268
+ #
269
+ # source://webrick//lib/webrick/server.rb#234
270
+ def shutdown; end
271
+
272
+ # Starts the server and runs the +block+ for each connection. This method
273
+ # does not return until the server is stopped from a signal handler or
274
+ # another thread using #stop or #shutdown.
275
+ #
276
+ # If the block raises a subclass of StandardError the exception is logged
277
+ # and ignored. If an IOError or Errno::EBADF exception is raised the
278
+ # exception is ignored. If an Exception subclass is raised the exception
279
+ # is logged and re-raised which stops the server.
280
+ #
281
+ # To completely shut down a server call #shutdown from ensure:
282
+ #
283
+ # server = WEBrick::GenericServer.new
284
+ # # or WEBrick::HTTPServer.new
285
+ #
286
+ # begin
287
+ # server.start
288
+ # ensure
289
+ # server.shutdown
290
+ # end
291
+ #
292
+ # @raise [ServerError]
293
+ #
294
+ # source://webrick//lib/webrick/server.rb#154
295
+ def start(&block); end
296
+
297
+ # The server status. One of :Stop, :Running or :Shutdown
298
+ #
299
+ # source://webrick//lib/webrick/server.rb#61
300
+ def status; end
301
+
302
+ # Stops the server from accepting new connections.
303
+ #
304
+ # source://webrick//lib/webrick/server.rb#222
305
+ def stop; end
306
+
307
+ # Tokens control the number of outstanding clients. The
308
+ # <code>:MaxClients</code> configuration sets this.
309
+ #
310
+ # source://webrick//lib/webrick/server.rb#77
311
+ def tokens; end
312
+
313
+ private
314
+
315
+ # Accepts a TCP client socket from the TCP server socket +svr+ and returns
316
+ # the client socket.
317
+ #
318
+ # source://webrick//lib/webrick/server.rb#256
319
+ def accept_client(svr); end
320
+
321
+ # source://webrick//lib/webrick/server.rb#347
322
+ def alarm_shutdown_pipe; end
323
+
324
+ # Calls the callback +callback_name+ from the configuration with +args+
325
+ #
326
+ # source://webrick//lib/webrick/server.rb#334
327
+ def call_callback(callback_name, *args); end
328
+
329
+ # source://webrick//lib/webrick/server.rb#359
330
+ def cleanup_listener; end
331
+
332
+ # source://webrick//lib/webrick/server.rb#342
333
+ def cleanup_shutdown_pipe(shutdown_pipe); end
334
+
335
+ # source://webrick//lib/webrick/server.rb#338
336
+ def setup_shutdown_pipe; end
337
+
338
+ # Starts a server thread for the client socket +sock+ that runs the given
339
+ # +block+.
340
+ #
341
+ # Sets the socket to the <code>:WEBrickSocket</code> thread local variable
342
+ # in the thread.
343
+ #
344
+ # If any errors occur in the block they are logged and handled.
345
+ #
346
+ # source://webrick//lib/webrick/server.rb#288
347
+ def start_thread(sock, &block); end
348
+ end
349
+
350
+ # source://webrick//lib/webrick/htmlutils.rb#13
351
+ module WEBrick::HTMLUtils
352
+ private
353
+
354
+ # Escapes &, ", > and < in +string+
355
+ #
356
+ # source://webrick//lib/webrick/htmlutils.rb#18
357
+ def escape(string); end
358
+
359
+ class << self
360
+ # Escapes &, ", > and < in +string+
361
+ #
362
+ # source://webrick//lib/webrick/htmlutils.rb#18
363
+ def escape(string); end
364
+ end
365
+ end
366
+
367
+ # HTTPAuth provides both basic and digest authentication.
368
+ #
369
+ # To enable authentication for requests in WEBrick you will need a user
370
+ # database and an authenticator. To start, here's an Htpasswd database for
371
+ # use with a DigestAuth authenticator:
372
+ #
373
+ # config = { :Realm => 'DigestAuth example realm' }
374
+ #
375
+ # htpasswd = WEBrick::HTTPAuth::Htpasswd.new 'my_password_file'
376
+ # htpasswd.auth_type = WEBrick::HTTPAuth::DigestAuth
377
+ # htpasswd.set_passwd config[:Realm], 'username', 'password'
378
+ # htpasswd.flush
379
+ #
380
+ # The +:Realm+ is used to provide different access to different groups
381
+ # across several resources on a server. Typically you'll need only one
382
+ # realm for a server.
383
+ #
384
+ # This database can be used to create an authenticator:
385
+ #
386
+ # config[:UserDB] = htpasswd
387
+ #
388
+ # digest_auth = WEBrick::HTTPAuth::DigestAuth.new config
389
+ #
390
+ # To authenticate a request call #authenticate with a request and response
391
+ # object in a servlet:
392
+ #
393
+ # def do_GET req, res
394
+ # @authenticator.authenticate req, res
395
+ # end
396
+ #
397
+ # For digest authentication the authenticator must not be created every
398
+ # request, it must be passed in as an option via WEBrick::HTTPServer#mount.
399
+ #
400
+ # source://webrick//lib/webrick/httpauth/authenticator.rb#12
401
+ module WEBrick::HTTPAuth
402
+ private
403
+
404
+ # source://webrick//lib/webrick/httpauth.rb#57
405
+ def _basic_auth(req, res, realm, req_field, res_field, err_type, block); end
406
+
407
+ # Simple wrapper for providing basic authentication for a request. When
408
+ # called with a request +req+, response +res+, authentication +realm+ and
409
+ # +block+ the block will be called with a +username+ and +password+. If
410
+ # the block returns true the request is allowed to continue, otherwise an
411
+ # HTTPStatus::Unauthorized error is raised.
412
+ #
413
+ # source://webrick//lib/webrick/httpauth.rb#79
414
+ def basic_auth(req, res, realm, &block); end
415
+
416
+ # Simple wrapper for providing basic authentication for a proxied request.
417
+ # When called with a request +req+, response +res+, authentication +realm+
418
+ # and +block+ the block will be called with a +username+ and +password+.
419
+ # If the block returns true the request is allowed to continue, otherwise
420
+ # an HTTPStatus::ProxyAuthenticationRequired error is raised.
421
+ #
422
+ # source://webrick//lib/webrick/httpauth.rb#91
423
+ def proxy_basic_auth(req, res, realm, &block); end
424
+
425
+ class << self
426
+ # source://webrick//lib/webrick/httpauth.rb#57
427
+ def _basic_auth(req, res, realm, req_field, res_field, err_type, block); end
428
+
429
+ # Simple wrapper for providing basic authentication for a request. When
430
+ # called with a request +req+, response +res+, authentication +realm+ and
431
+ # +block+ the block will be called with a +username+ and +password+. If
432
+ # the block returns true the request is allowed to continue, otherwise an
433
+ # HTTPStatus::Unauthorized error is raised.
434
+ #
435
+ # source://webrick//lib/webrick/httpauth.rb#79
436
+ def basic_auth(req, res, realm, &block); end
437
+
438
+ # Simple wrapper for providing basic authentication for a proxied request.
439
+ # When called with a request +req+, response +res+, authentication +realm+
440
+ # and +block+ the block will be called with a +username+ and +password+.
441
+ # If the block returns true the request is allowed to continue, otherwise
442
+ # an HTTPStatus::ProxyAuthenticationRequired error is raised.
443
+ #
444
+ # source://webrick//lib/webrick/httpauth.rb#91
445
+ def proxy_basic_auth(req, res, realm, &block); end
446
+ end
447
+ end
448
+
449
+ # Module providing generic support for both Digest and Basic
450
+ # authentication schemes.
451
+ #
452
+ # source://webrick//lib/webrick/httpauth/authenticator.rb#18
453
+ module WEBrick::HTTPAuth::Authenticator
454
+ # The logger for this authenticator
455
+ #
456
+ # source://webrick//lib/webrick/httpauth/authenticator.rb#43
457
+ def logger; end
458
+
459
+ # The realm this authenticator covers
460
+ #
461
+ # source://webrick//lib/webrick/httpauth/authenticator.rb#33
462
+ def realm; end
463
+
464
+ # The user database for this authenticator
465
+ #
466
+ # source://webrick//lib/webrick/httpauth/authenticator.rb#38
467
+ def userdb; end
468
+
469
+ private
470
+
471
+ # Initializes the authenticator from +config+
472
+ #
473
+ # source://webrick//lib/webrick/httpauth/authenticator.rb#52
474
+ def check_init(config); end
475
+
476
+ # Ensures +req+ has credentials that can be authenticated.
477
+ #
478
+ # source://webrick//lib/webrick/httpauth/authenticator.rb#72
479
+ def check_scheme(req); end
480
+
481
+ # source://webrick//lib/webrick/httpauth/authenticator.rb#91
482
+ def error(fmt, *args); end
483
+
484
+ # source://webrick//lib/webrick/httpauth/authenticator.rb#97
485
+ def info(fmt, *args); end
486
+
487
+ # source://webrick//lib/webrick/httpauth/authenticator.rb#85
488
+ def log(meth, fmt, *args); end
489
+ end
490
+
491
+ # source://webrick//lib/webrick/httpauth/authenticator.rb#23
492
+ WEBrick::HTTPAuth::Authenticator::AuthException = WEBrick::HTTPStatus::Unauthorized
493
+
494
+ # Basic Authentication for WEBrick
495
+ #
496
+ # Use this class to add basic authentication to a WEBrick servlet.
497
+ #
498
+ # Here is an example of how to set up a BasicAuth:
499
+ #
500
+ # config = { :Realm => 'BasicAuth example realm' }
501
+ #
502
+ # htpasswd = WEBrick::HTTPAuth::Htpasswd.new 'my_password_file', password_hash: :bcrypt
503
+ # htpasswd.set_passwd config[:Realm], 'username', 'password'
504
+ # htpasswd.flush
505
+ #
506
+ # config[:UserDB] = htpasswd
507
+ #
508
+ # basic_auth = WEBrick::HTTPAuth::BasicAuth.new config
509
+ #
510
+ # source://webrick//lib/webrick/httpauth/basicauth.rb#35
511
+ class WEBrick::HTTPAuth::BasicAuth
512
+ include ::WEBrick::HTTPAuth::Authenticator
513
+
514
+ # Creates a new BasicAuth instance.
515
+ #
516
+ # See WEBrick::Config::BasicAuth for default configuration entries
517
+ #
518
+ # You must supply the following configuration entries:
519
+ #
520
+ # :Realm:: The name of the realm being protected.
521
+ # :UserDB:: A database of usernames and passwords.
522
+ # A WEBrick::HTTPAuth::Htpasswd instance should be used.
523
+ #
524
+ # @return [BasicAuth] a new instance of BasicAuth
525
+ #
526
+ # source://webrick//lib/webrick/httpauth/basicauth.rb#61
527
+ def initialize(config, default = T.unsafe(nil)); end
528
+
529
+ # Authenticates a +req+ and returns a 401 Unauthorized using +res+ if
530
+ # the authentication was not correct.
531
+ #
532
+ # source://webrick//lib/webrick/httpauth/basicauth.rb#70
533
+ def authenticate(req, res); end
534
+
535
+ # Returns a challenge response which asks for authentication information
536
+ #
537
+ # @raise [@auth_exception]
538
+ #
539
+ # source://webrick//lib/webrick/httpauth/basicauth.rb#103
540
+ def challenge(req, res); end
541
+
542
+ # Returns the value of attribute logger.
543
+ #
544
+ # source://webrick//lib/webrick/httpauth/basicauth.rb#48
545
+ def logger; end
546
+
547
+ # Returns the value of attribute realm.
548
+ #
549
+ # source://webrick//lib/webrick/httpauth/basicauth.rb#48
550
+ def realm; end
551
+
552
+ # Returns the value of attribute userdb.
553
+ #
554
+ # source://webrick//lib/webrick/httpauth/basicauth.rb#48
555
+ def userdb; end
556
+
557
+ class << self
558
+ # Used by UserDB to create a basic password entry
559
+ #
560
+ # source://webrick//lib/webrick/httpauth/basicauth.rb#43
561
+ def make_passwd(realm, user, pass); end
562
+ end
563
+ end
564
+
565
+ # RFC 2617 Digest Access Authentication for WEBrick
566
+ #
567
+ # Use this class to add digest authentication to a WEBrick servlet.
568
+ #
569
+ # Here is an example of how to set up DigestAuth:
570
+ #
571
+ # config = { :Realm => 'DigestAuth example realm' }
572
+ #
573
+ # htdigest = WEBrick::HTTPAuth::Htdigest.new 'my_password_file'
574
+ # htdigest.set_passwd config[:Realm], 'username', 'password'
575
+ # htdigest.flush
576
+ #
577
+ # config[:UserDB] = htdigest
578
+ #
579
+ # digest_auth = WEBrick::HTTPAuth::DigestAuth.new config
580
+ #
581
+ # When using this as with a servlet be sure not to create a new DigestAuth
582
+ # object in the servlet's #initialize. By default WEBrick creates a new
583
+ # servlet instance for every request and the DigestAuth object must be
584
+ # used across requests.
585
+ #
586
+ # source://webrick//lib/webrick/httpauth/digestauth.rb#46
587
+ class WEBrick::HTTPAuth::DigestAuth
588
+ include ::WEBrick::HTTPAuth::Authenticator
589
+
590
+ # Creates a new DigestAuth instance. Be sure to use the same DigestAuth
591
+ # instance for multiple requests as it saves state between requests in
592
+ # order to perform authentication.
593
+ #
594
+ # See WEBrick::Config::DigestAuth for default configuration entries
595
+ #
596
+ # You must supply the following configuration entries:
597
+ #
598
+ # :Realm:: The name of the realm being protected.
599
+ # :UserDB:: A database of usernames and passwords.
600
+ # A WEBrick::HTTPAuth::Htdigest instance should be used.
601
+ #
602
+ # @return [DigestAuth] a new instance of DigestAuth
603
+ #
604
+ # source://webrick//lib/webrick/httpauth/digestauth.rb#87
605
+ def initialize(config, default = T.unsafe(nil)); end
606
+
607
+ # Digest authentication algorithm
608
+ #
609
+ # source://webrick//lib/webrick/httpauth/digestauth.rb#59
610
+ def algorithm; end
611
+
612
+ # Authenticates a +req+ and returns a 401 Unauthorized using +res+ if
613
+ # the authentication was not correct.
614
+ #
615
+ # source://webrick//lib/webrick/httpauth/digestauth.rb#121
616
+ def authenticate(req, res); end
617
+
618
+ # Returns a challenge response which asks for authentication information
619
+ #
620
+ # @raise [@auth_exception]
621
+ #
622
+ # source://webrick//lib/webrick/httpauth/digestauth.rb#134
623
+ def challenge(req, res, stale = T.unsafe(nil)); end
624
+
625
+ # Quality of protection. RFC 2617 defines "auth" and "auth-int"
626
+ #
627
+ # source://webrick//lib/webrick/httpauth/digestauth.rb#64
628
+ def qop; end
629
+
630
+ private
631
+
632
+ # source://webrick//lib/webrick/httpauth/digestauth.rb#163
633
+ def _authenticate(req, res); end
634
+
635
+ # source://webrick//lib/webrick/httpauth/digestauth.rb#306
636
+ def check_nonce(req, auth_req); end
637
+
638
+ # source://webrick//lib/webrick/httpauth/digestauth.rb#349
639
+ def check_opaque(opaque_struct, req, auth_req); end
640
+
641
+ # source://webrick//lib/webrick/httpauth/digestauth.rb#365
642
+ def check_uri(req, auth_req); end
643
+
644
+ # source://webrick//lib/webrick/httpauth/digestauth.rb#299
645
+ def generate_next_nonce(req); end
646
+
647
+ # source://webrick//lib/webrick/httpauth/digestauth.rb#332
648
+ def generate_opaque(req); end
649
+
650
+ # source://webrick//lib/webrick/httpauth/digestauth.rb#376
651
+ def hexdigest(*args); end
652
+
653
+ # source://webrick//lib/webrick/httpauth/digestauth.rb#291
654
+ def split_param_value(string); end
655
+
656
+ class << self
657
+ # Used by UserDB to create a digest password entry
658
+ #
659
+ # source://webrick//lib/webrick/httpauth/digestauth.rb#69
660
+ def make_passwd(realm, user, pass); end
661
+ end
662
+ end
663
+
664
+ # Struct containing the opaque portion of the digest authentication
665
+ #
666
+ # source://webrick//lib/webrick/httpauth/digestauth.rb#54
667
+ class WEBrick::HTTPAuth::DigestAuth::OpaqueInfo < ::Struct
668
+ # Sets the attribute nc
669
+ #
670
+ # @param value [Object] the value to set the attribute nc to.
671
+ # @return [Object] the newly set value
672
+ #
673
+ # source://webrick//lib/webrick/httpauth/digestauth.rb#54
674
+ def nc=(_); end
675
+
676
+ # Sets the attribute nonce
677
+ #
678
+ # @param value [Object] the value to set the attribute nonce to.
679
+ # @return [Object] the newly set value
680
+ #
681
+ # source://webrick//lib/webrick/httpauth/digestauth.rb#54
682
+ def nonce=(_); end
683
+
684
+ # Sets the attribute time
685
+ #
686
+ # @param value [Object] the value to set the attribute time to.
687
+ # @return [Object] the newly set value
688
+ #
689
+ # source://webrick//lib/webrick/httpauth/digestauth.rb#54
690
+ def time=(_); end
691
+ end
692
+
693
+ # Htdigest accesses apache-compatible digest password files. Passwords are
694
+ # matched to a realm where they are valid. For security, the path for a
695
+ # digest password database should be stored outside of the paths available
696
+ # to the HTTP server.
697
+ #
698
+ # Htdigest is intended for use with WEBrick::HTTPAuth::DigestAuth and
699
+ # stores passwords using cryptographic hashes.
700
+ #
701
+ # htpasswd = WEBrick::HTTPAuth::Htdigest.new 'my_password_file'
702
+ # htpasswd.set_passwd 'my realm', 'username', 'password'
703
+ # htpasswd.flush
704
+ #
705
+ # source://webrick//lib/webrick/httpauth/htdigest.rb#31
706
+ class WEBrick::HTTPAuth::Htdigest
707
+ include ::WEBrick::HTTPAuth::UserDB
708
+
709
+ # Open a digest password database at +path+
710
+ #
711
+ # @return [Htdigest] a new instance of Htdigest
712
+ #
713
+ # source://webrick//lib/webrick/httpauth/htdigest.rb#37
714
+ def initialize(path); end
715
+
716
+ # Removes a password from the database for +user+ in +realm+.
717
+ #
718
+ # source://webrick//lib/webrick/httpauth/htdigest.rb#113
719
+ def delete_passwd(realm, user); end
720
+
721
+ # Iterate passwords in the database.
722
+ #
723
+ # source://webrick//lib/webrick/httpauth/htdigest.rb#122
724
+ def each; end
725
+
726
+ # Flush the password database. If +output+ is given the database will
727
+ # be written there instead of to the original path.
728
+ #
729
+ # source://webrick//lib/webrick/httpauth/htdigest.rb#72
730
+ def flush(output = T.unsafe(nil)); end
731
+
732
+ # Retrieves a password from the database for +user+ in +realm+. If
733
+ # +reload_db+ is true the database will be reloaded first.
734
+ #
735
+ # source://webrick//lib/webrick/httpauth/htdigest.rb#91
736
+ def get_passwd(realm, user, reload_db); end
737
+
738
+ # Reloads passwords from the database
739
+ #
740
+ # source://webrick//lib/webrick/httpauth/htdigest.rb#50
741
+ def reload; end
742
+
743
+ # Sets a password in the database for +user+ in +realm+ to +pass+.
744
+ #
745
+ # source://webrick//lib/webrick/httpauth/htdigest.rb#101
746
+ def set_passwd(realm, user, pass); end
747
+ end
748
+
749
+ # Htgroup accesses apache-compatible group files. Htgroup can be used to
750
+ # provide group-based authentication for users. Currently Htgroup is not
751
+ # directly integrated with any authenticators in WEBrick. For security,
752
+ # the path for a digest password database should be stored outside of the
753
+ # paths available to the HTTP server.
754
+ #
755
+ # Example:
756
+ #
757
+ # htgroup = WEBrick::HTTPAuth::Htgroup.new 'my_group_file'
758
+ # htgroup.add 'superheroes', %w[spiderman batman]
759
+ #
760
+ # htgroup.members('superheroes').include? 'magneto' # => false
761
+ #
762
+ # source://webrick//lib/webrick/httpauth/htgroup.rb#30
763
+ class WEBrick::HTTPAuth::Htgroup
764
+ # Open a group database at +path+
765
+ #
766
+ # @return [Htgroup] a new instance of Htgroup
767
+ #
768
+ # source://webrick//lib/webrick/httpauth/htgroup.rb#35
769
+ def initialize(path); end
770
+
771
+ # Add an Array of +members+ to +group+
772
+ #
773
+ # source://webrick//lib/webrick/httpauth/htgroup.rb#92
774
+ def add(group, members); end
775
+
776
+ # Flush the group database. If +output+ is given the database will be
777
+ # written there instead of to the original path.
778
+ #
779
+ # source://webrick//lib/webrick/httpauth/htgroup.rb#64
780
+ def flush(output = T.unsafe(nil)); end
781
+
782
+ # Retrieve the list of members from +group+
783
+ #
784
+ # source://webrick//lib/webrick/httpauth/htgroup.rb#84
785
+ def members(group); end
786
+
787
+ # Reload groups from the database
788
+ #
789
+ # source://webrick//lib/webrick/httpauth/htgroup.rb#46
790
+ def reload; end
791
+ end
792
+
793
+ # Htpasswd accesses apache-compatible password files. Passwords are
794
+ # matched to a realm where they are valid. For security, the path for a
795
+ # password database should be stored outside of the paths available to the
796
+ # HTTP server.
797
+ #
798
+ # Htpasswd is intended for use with WEBrick::HTTPAuth::BasicAuth.
799
+ #
800
+ # To create an Htpasswd database with a single user:
801
+ #
802
+ # htpasswd = WEBrick::HTTPAuth::Htpasswd.new 'my_password_file'
803
+ # htpasswd.set_passwd 'my realm', 'username', 'password'
804
+ # htpasswd.flush
805
+ #
806
+ # source://webrick//lib/webrick/httpauth/htpasswd.rb#32
807
+ class WEBrick::HTTPAuth::Htpasswd
808
+ include ::WEBrick::HTTPAuth::UserDB
809
+
810
+ # Open a password database at +path+
811
+ #
812
+ # @return [Htpasswd] a new instance of Htpasswd
813
+ #
814
+ # source://webrick//lib/webrick/httpauth/htpasswd.rb#38
815
+ def initialize(path, password_hash: T.unsafe(nil)); end
816
+
817
+ # Removes a password from the database for +user+ in +realm+.
818
+ #
819
+ # source://webrick//lib/webrick/httpauth/htpasswd.rb#144
820
+ def delete_passwd(realm, user); end
821
+
822
+ # Iterate passwords in the database.
823
+ #
824
+ # source://webrick//lib/webrick/httpauth/htpasswd.rb#151
825
+ def each; end
826
+
827
+ # Flush the password database. If +output+ is given the database will
828
+ # be written there instead of to the original path.
829
+ #
830
+ # source://webrick//lib/webrick/httpauth/htpasswd.rb#103
831
+ def flush(output = T.unsafe(nil)); end
832
+
833
+ # Retrieves a password from the database for +user+ in +realm+. If
834
+ # +reload_db+ is true the database will be reloaded first.
835
+ #
836
+ # source://webrick//lib/webrick/httpauth/htpasswd.rb#122
837
+ def get_passwd(realm, user, reload_db); end
838
+
839
+ # Reload passwords from the database
840
+ #
841
+ # source://webrick//lib/webrick/httpauth/htpasswd.rb#68
842
+ def reload; end
843
+
844
+ # Sets a password in the database for +user+ in +realm+ to +pass+.
845
+ #
846
+ # source://webrick//lib/webrick/httpauth/htpasswd.rb#130
847
+ def set_passwd(realm, user, pass); end
848
+ end
849
+
850
+ # source://webrick//lib/webrick/httpauth/authenticator.rb#114
851
+ WEBrick::HTTPAuth::ProxyAuthenticator::AuthException = WEBrick::HTTPStatus::ProxyAuthenticationRequired
852
+
853
+ # Basic authentication for proxy servers. See BasicAuth for details.
854
+ #
855
+ # source://webrick//lib/webrick/httpauth/basicauth.rb#112
856
+ class WEBrick::HTTPAuth::ProxyBasicAuth < ::WEBrick::HTTPAuth::BasicAuth
857
+ include ::WEBrick::HTTPAuth::ProxyAuthenticator
858
+ end
859
+
860
+ # Digest authentication for proxy servers. See DigestAuth for details.
861
+ #
862
+ # source://webrick//lib/webrick/httpauth/digestauth.rb#386
863
+ class WEBrick::HTTPAuth::ProxyDigestAuth < ::WEBrick::HTTPAuth::DigestAuth
864
+ include ::WEBrick::HTTPAuth::ProxyAuthenticator
865
+
866
+ private
867
+
868
+ # source://webrick//lib/webrick/httpauth/digestauth.rb#390
869
+ def check_uri(req, auth_req); end
870
+ end
871
+
872
+ # User database mixin for HTTPAuth. This mixin dispatches user record
873
+ # access to the underlying auth_type for this database.
874
+ #
875
+ # source://webrick//lib/webrick/httpauth/userdb.rb#18
876
+ module WEBrick::HTTPAuth::UserDB
877
+ # The authentication type.
878
+ #
879
+ # WEBrick::HTTPAuth::BasicAuth or WEBrick::HTTPAuth::DigestAuth are
880
+ # built-in.
881
+ #
882
+ # source://webrick//lib/webrick/httpauth/userdb.rb#26
883
+ def auth_type; end
884
+
885
+ # The authentication type.
886
+ #
887
+ # WEBrick::HTTPAuth::BasicAuth or WEBrick::HTTPAuth::DigestAuth are
888
+ # built-in.
889
+ #
890
+ # source://webrick//lib/webrick/httpauth/userdb.rb#26
891
+ def auth_type=(_arg0); end
892
+
893
+ # Retrieves a password in +realm+ for +user+ for the auth_type of this
894
+ # database. +reload_db+ is a dummy value.
895
+ #
896
+ # source://webrick//lib/webrick/httpauth/userdb.rb#48
897
+ def get_passwd(realm, user, reload_db = T.unsafe(nil)); end
898
+
899
+ # Creates an obscured password in +realm+ with +user+ and +password+
900
+ # using the auth_type of this database.
901
+ #
902
+ # source://webrick//lib/webrick/httpauth/userdb.rb#32
903
+ def make_passwd(realm, user, pass); end
904
+
905
+ # Sets a password in +realm+ with +user+ and +password+ for the
906
+ # auth_type of this database.
907
+ #
908
+ # source://webrick//lib/webrick/httpauth/userdb.rb#40
909
+ def set_passwd(realm, user, pass); end
910
+ end
911
+
912
+ # --
913
+ # Adds SSL functionality to WEBrick::HTTPRequest
914
+ #
915
+ # source://webrick//lib/webrick/httprequest.rb#25
916
+ class WEBrick::HTTPRequest
917
+ # Creates a new HTTP request. WEBrick::Config::HTTP is the default
918
+ # configuration.
919
+ #
920
+ # @return [HTTPRequest] a new instance of HTTPRequest
921
+ #
922
+ # source://webrick//lib/webrick/httprequest.rb#153
923
+ def initialize(config); end
924
+
925
+ # Retrieves +header_name+
926
+ #
927
+ # source://webrick//lib/webrick/httprequest.rb#318
928
+ def [](header_name); end
929
+
930
+ # The Accept header value
931
+ #
932
+ # source://webrick//lib/webrick/httprequest.rb#100
933
+ def accept; end
934
+
935
+ # The Accept-Charset header value
936
+ #
937
+ # source://webrick//lib/webrick/httprequest.rb#105
938
+ def accept_charset; end
939
+
940
+ # The Accept-Encoding header value
941
+ #
942
+ # source://webrick//lib/webrick/httprequest.rb#110
943
+ def accept_encoding; end
944
+
945
+ # The Accept-Language header value
946
+ #
947
+ # source://webrick//lib/webrick/httprequest.rb#115
948
+ def accept_language; end
949
+
950
+ # The socket address of the server
951
+ #
952
+ # source://webrick//lib/webrick/httprequest.rb#127
953
+ def addr; end
954
+
955
+ # Hash of request attributes
956
+ #
957
+ # source://webrick//lib/webrick/httprequest.rb#137
958
+ def attributes; end
959
+
960
+ # Returns the request body.
961
+ #
962
+ # source://webrick//lib/webrick/httprequest.rb#255
963
+ def body(&block); end
964
+
965
+ # Prepares the HTTPRequest object for use as the
966
+ # source for IO.copy_stream
967
+ #
968
+ # source://webrick//lib/webrick/httprequest.rb#265
969
+ def body_reader; end
970
+
971
+ # The content-length header
972
+ #
973
+ # source://webrick//lib/webrick/httprequest.rb#304
974
+ def content_length; end
975
+
976
+ # The content-type header
977
+ #
978
+ # source://webrick//lib/webrick/httprequest.rb#311
979
+ def content_type; end
980
+
981
+ # Generate HTTP/1.1 100 continue response if the client expects it,
982
+ # otherwise does nothing.
983
+ #
984
+ # source://webrick//lib/webrick/httprequest.rb#245
985
+ def continue; end
986
+
987
+ # The parsed request cookies
988
+ #
989
+ # source://webrick//lib/webrick/httprequest.rb#95
990
+ def cookies; end
991
+
992
+ # Iterates over the request headers
993
+ #
994
+ # source://webrick//lib/webrick/httprequest.rb#328
995
+ def each; end
996
+
997
+ # Consumes any remaining body and updates keep-alive status
998
+ #
999
+ # source://webrick//lib/webrick/httprequest.rb#390
1000
+ def fixup; end
1001
+
1002
+ # The parsed header of the request
1003
+ #
1004
+ # source://webrick//lib/webrick/httprequest.rb#90
1005
+ def header; end
1006
+
1007
+ # The host this request is for
1008
+ #
1009
+ # source://webrick//lib/webrick/httprequest.rb#340
1010
+ def host; end
1011
+
1012
+ # The HTTP version of the request
1013
+ #
1014
+ # source://webrick//lib/webrick/httprequest.rb#51
1015
+ def http_version; end
1016
+
1017
+ # Is this a keep-alive connection?
1018
+ #
1019
+ # source://webrick//lib/webrick/httprequest.rb#142
1020
+ def keep_alive; end
1021
+
1022
+ # Should the connection this request was made on be kept alive?
1023
+ #
1024
+ # @return [Boolean]
1025
+ #
1026
+ # source://webrick//lib/webrick/httprequest.rb#375
1027
+ def keep_alive?; end
1028
+
1029
+ # This method provides the metavariables defined by the revision 3
1030
+ # of "The WWW Common Gateway Interface Version 1.1"
1031
+ # To browse the current document of CGI Version 1.1, see below:
1032
+ # http://tools.ietf.org/html/rfc3875
1033
+ #
1034
+ # source://webrick//lib/webrick/httprequest.rb#407
1035
+ def meta_vars; end
1036
+
1037
+ # Parses a request from +socket+. This is called internally by
1038
+ # WEBrick::HTTPServer.
1039
+ #
1040
+ # source://webrick//lib/webrick/httprequest.rb#193
1041
+ def parse(socket = T.unsafe(nil)); end
1042
+
1043
+ # The request path
1044
+ #
1045
+ # source://webrick//lib/webrick/httprequest.rb#63
1046
+ def path; end
1047
+
1048
+ # The path info (CGI variable)
1049
+ #
1050
+ # source://webrick//lib/webrick/httprequest.rb#73
1051
+ def path_info; end
1052
+
1053
+ # The path info (CGI variable)
1054
+ #
1055
+ # source://webrick//lib/webrick/httprequest.rb#73
1056
+ def path_info=(_arg0); end
1057
+
1058
+ # The socket address of the client
1059
+ #
1060
+ # source://webrick//lib/webrick/httprequest.rb#132
1061
+ def peeraddr; end
1062
+
1063
+ # The port this request is for
1064
+ #
1065
+ # source://webrick//lib/webrick/httprequest.rb#347
1066
+ def port; end
1067
+
1068
+ # Request query as a Hash
1069
+ #
1070
+ # source://webrick//lib/webrick/httprequest.rb#294
1071
+ def query; end
1072
+
1073
+ # The query from the URI of the request
1074
+ #
1075
+ # source://webrick//lib/webrick/httprequest.rb#78
1076
+ def query_string; end
1077
+
1078
+ # The query from the URI of the request
1079
+ #
1080
+ # source://webrick//lib/webrick/httprequest.rb#78
1081
+ def query_string=(_arg0); end
1082
+
1083
+ # The raw header of the request
1084
+ #
1085
+ # source://webrick//lib/webrick/httprequest.rb#85
1086
+ def raw_header; end
1087
+
1088
+ # for IO.copy_stream.
1089
+ #
1090
+ # source://webrick//lib/webrick/httprequest.rb#278
1091
+ def readpartial(size, buf = T.unsafe(nil)); end
1092
+
1093
+ # The client's IP address
1094
+ #
1095
+ # source://webrick//lib/webrick/httprequest.rb#361
1096
+ def remote_ip; end
1097
+
1098
+ # The complete request line such as:
1099
+ #
1100
+ # GET / HTTP/1.1
1101
+ #
1102
+ # source://webrick//lib/webrick/httprequest.rb#36
1103
+ def request_line; end
1104
+
1105
+ # The request method, GET, POST, PUT, etc.
1106
+ #
1107
+ # source://webrick//lib/webrick/httprequest.rb#41
1108
+ def request_method; end
1109
+
1110
+ # The local time this request was received
1111
+ #
1112
+ # source://webrick//lib/webrick/httprequest.rb#147
1113
+ def request_time; end
1114
+
1115
+ # The parsed URI of the request
1116
+ #
1117
+ # source://webrick//lib/webrick/httprequest.rb#58
1118
+ def request_uri; end
1119
+
1120
+ # The script name (CGI variable)
1121
+ #
1122
+ # source://webrick//lib/webrick/httprequest.rb#68
1123
+ def script_name; end
1124
+
1125
+ # The script name (CGI variable)
1126
+ #
1127
+ # source://webrick//lib/webrick/httprequest.rb#68
1128
+ def script_name=(_arg0); end
1129
+
1130
+ # The server name this request is for
1131
+ #
1132
+ # source://webrick//lib/webrick/httprequest.rb#354
1133
+ def server_name; end
1134
+
1135
+ # Is this an SSL request?
1136
+ #
1137
+ # @return [Boolean]
1138
+ #
1139
+ # source://webrick//lib/webrick/httprequest.rb#368
1140
+ def ssl?; end
1141
+
1142
+ # source://webrick//lib/webrick/httprequest.rb#379
1143
+ def to_s; end
1144
+
1145
+ # The unparsed URI of the request
1146
+ #
1147
+ # source://webrick//lib/webrick/httprequest.rb#46
1148
+ def unparsed_uri; end
1149
+
1150
+ # The remote user (CGI variable)
1151
+ #
1152
+ # source://webrick//lib/webrick/httprequest.rb#122
1153
+ def user; end
1154
+
1155
+ # The remote user (CGI variable)
1156
+ #
1157
+ # source://webrick//lib/webrick/httprequest.rb#122
1158
+ def user=(_arg0); end
1159
+
1160
+ private
1161
+
1162
+ # source://webrick//lib/webrick/httprequest.rb#562
1163
+ def _read_data(io, method, *arg); end
1164
+
1165
+ # source://webrick//lib/webrick/httprequest.rb#582
1166
+ def parse_query; end
1167
+
1168
+ # source://webrick//lib/webrick/httprequest.rb#484
1169
+ def parse_uri(str, scheme = T.unsafe(nil)); end
1170
+
1171
+ # source://webrick//lib/webrick/httprequest.rb#507
1172
+ def read_body(socket, block); end
1173
+
1174
+ # source://webrick//lib/webrick/httprequest.rb#531
1175
+ def read_chunk_size(socket); end
1176
+
1177
+ # source://webrick//lib/webrick/httprequest.rb#542
1178
+ def read_chunked(socket, block); end
1179
+
1180
+ # source://webrick//lib/webrick/httprequest.rb#578
1181
+ def read_data(io, size); end
1182
+
1183
+ # source://webrick//lib/webrick/httprequest.rb#471
1184
+ def read_header(socket); end
1185
+
1186
+ # source://webrick//lib/webrick/httprequest.rb#574
1187
+ def read_line(io, size = T.unsafe(nil)); end
1188
+
1189
+ # @raise [HTTPStatus::EOFError]
1190
+ #
1191
+ # source://webrick//lib/webrick/httprequest.rb#451
1192
+ def read_request_line(socket); end
1193
+
1194
+ # It's said that all X-Forwarded-* headers will contain more than one
1195
+ # (comma-separated) value if the original request already contained one of
1196
+ # these headers. Since we could use these values as Host header, we choose
1197
+ # the initial(first) value. (apr_table_mergen() adds new value after the
1198
+ # existing value with ", " prefix)
1199
+ #
1200
+ # source://webrick//lib/webrick/httprequest.rb#610
1201
+ def setup_forwarded_info; end
1202
+ end
1203
+
1204
+ # same as Mongrel, Thin and Puma
1205
+ #
1206
+ # source://webrick//lib/webrick/httprequest.rb#449
1207
+ WEBrick::HTTPRequest::MAX_HEADER_LENGTH = T.let(T.unsafe(nil), Integer)
1208
+
1209
+ # An HTTP response. This is filled in by the service or do_* methods of a
1210
+ # WEBrick HTTP Servlet.
1211
+ #
1212
+ # source://webrick//lib/webrick/httpresponse.rb#24
1213
+ class WEBrick::HTTPResponse
1214
+ # Creates a new HTTP response object. WEBrick::Config::HTTP is the
1215
+ # default configuration.
1216
+ #
1217
+ # @return [HTTPResponse] a new instance of HTTPResponse
1218
+ #
1219
+ # source://webrick//lib/webrick/httpresponse.rb#112
1220
+ def initialize(config); end
1221
+
1222
+ # Retrieves the response header +field+
1223
+ #
1224
+ # source://webrick//lib/webrick/httpresponse.rb#150
1225
+ def [](field); end
1226
+
1227
+ # Sets the response header +field+ to +value+
1228
+ #
1229
+ # source://webrick//lib/webrick/httpresponse.rb#157
1230
+ def []=(field, value); end
1231
+
1232
+ # Body may be:
1233
+ # * a String;
1234
+ # * an IO-like object that responds to +#read+ and +#readpartial+;
1235
+ # * a Proc-like object that responds to +#call+.
1236
+ #
1237
+ # In the latter case, either #chunked= should be set to +true+,
1238
+ # or <code>header['content-length']</code> explicitly provided.
1239
+ # Example:
1240
+ #
1241
+ # server.mount_proc '/' do |req, res|
1242
+ # res.chunked = true
1243
+ # # or
1244
+ # # res.header['content-length'] = 10
1245
+ # res.body = proc { |out| out.write(Time.now.to_s) }
1246
+ # end
1247
+ #
1248
+ # source://webrick//lib/webrick/httpresponse.rb#70
1249
+ def body; end
1250
+
1251
+ # Body may be:
1252
+ # * a String;
1253
+ # * an IO-like object that responds to +#read+ and +#readpartial+;
1254
+ # * a Proc-like object that responds to +#call+.
1255
+ #
1256
+ # In the latter case, either #chunked= should be set to +true+,
1257
+ # or <code>header['content-length']</code> explicitly provided.
1258
+ # Example:
1259
+ #
1260
+ # server.mount_proc '/' do |req, res|
1261
+ # res.chunked = true
1262
+ # # or
1263
+ # # res.header['content-length'] = 10
1264
+ # res.body = proc { |out| out.write(Time.now.to_s) }
1265
+ # end
1266
+ #
1267
+ # source://webrick//lib/webrick/httpresponse.rb#70
1268
+ def body=(_arg0); end
1269
+
1270
+ # Enables chunked transfer encoding.
1271
+ #
1272
+ # source://webrick//lib/webrick/httpresponse.rb#209
1273
+ def chunked=(val); end
1274
+
1275
+ # Will this response body be returned using chunked transfer-encoding?
1276
+ #
1277
+ # @return [Boolean]
1278
+ #
1279
+ # source://webrick//lib/webrick/httpresponse.rb#202
1280
+ def chunked?; end
1281
+
1282
+ # Configuration for this response
1283
+ #
1284
+ # source://webrick//lib/webrick/httpresponse.rb#101
1285
+ def config; end
1286
+
1287
+ # The content-length header
1288
+ #
1289
+ # source://webrick//lib/webrick/httpresponse.rb#165
1290
+ def content_length; end
1291
+
1292
+ # Sets the content-length header to +len+
1293
+ #
1294
+ # source://webrick//lib/webrick/httpresponse.rb#174
1295
+ def content_length=(len); end
1296
+
1297
+ # The content-type header
1298
+ #
1299
+ # source://webrick//lib/webrick/httpresponse.rb#181
1300
+ def content_type; end
1301
+
1302
+ # Sets the content-type header to +type+
1303
+ #
1304
+ # source://webrick//lib/webrick/httpresponse.rb#188
1305
+ def content_type=(type); end
1306
+
1307
+ # Response cookies
1308
+ #
1309
+ # source://webrick//lib/webrick/httpresponse.rb#46
1310
+ def cookies; end
1311
+
1312
+ # Iterates over each header in the response
1313
+ #
1314
+ # source://webrick//lib/webrick/httpresponse.rb#195
1315
+ def each; end
1316
+
1317
+ # Filename of the static file in this response. Only used by the
1318
+ # FileHandler servlet.
1319
+ #
1320
+ # source://webrick//lib/webrick/httpresponse.rb#91
1321
+ def filename; end
1322
+
1323
+ # Filename of the static file in this response. Only used by the
1324
+ # FileHandler servlet.
1325
+ #
1326
+ # source://webrick//lib/webrick/httpresponse.rb#91
1327
+ def filename=(_arg0); end
1328
+
1329
+ # Response header
1330
+ #
1331
+ # source://webrick//lib/webrick/httpresponse.rb#41
1332
+ def header; end
1333
+
1334
+ # HTTP Response version
1335
+ #
1336
+ # source://webrick//lib/webrick/httpresponse.rb#31
1337
+ def http_version; end
1338
+
1339
+ # Is this a keep-alive response?
1340
+ #
1341
+ # source://webrick//lib/webrick/httpresponse.rb#96
1342
+ def keep_alive; end
1343
+
1344
+ # Is this a keep-alive response?
1345
+ #
1346
+ # source://webrick//lib/webrick/httpresponse.rb#96
1347
+ def keep_alive=(_arg0); end
1348
+
1349
+ # Will this response's connection be kept alive?
1350
+ #
1351
+ # @return [Boolean]
1352
+ #
1353
+ # source://webrick//lib/webrick/httpresponse.rb#216
1354
+ def keep_alive?; end
1355
+
1356
+ # source://webrick//lib/webrick/httpresponse.rb#303
1357
+ def make_body_tempfile; end
1358
+
1359
+ # Response reason phrase ("OK")
1360
+ #
1361
+ # source://webrick//lib/webrick/httpresponse.rb#51
1362
+ def reason_phrase; end
1363
+
1364
+ # Response reason phrase ("OK")
1365
+ #
1366
+ # source://webrick//lib/webrick/httpresponse.rb#51
1367
+ def reason_phrase=(_arg0); end
1368
+
1369
+ # source://webrick//lib/webrick/httpresponse.rb#321
1370
+ def remove_body_tempfile; end
1371
+
1372
+ # Request HTTP version for this response
1373
+ #
1374
+ # source://webrick//lib/webrick/httpresponse.rb#85
1375
+ def request_http_version; end
1376
+
1377
+ # Request HTTP version for this response
1378
+ #
1379
+ # source://webrick//lib/webrick/httpresponse.rb#85
1380
+ def request_http_version=(_arg0); end
1381
+
1382
+ # Request method for this response
1383
+ #
1384
+ # source://webrick//lib/webrick/httpresponse.rb#75
1385
+ def request_method; end
1386
+
1387
+ # Request method for this response
1388
+ #
1389
+ # source://webrick//lib/webrick/httpresponse.rb#75
1390
+ def request_method=(_arg0); end
1391
+
1392
+ # Request URI for this response
1393
+ #
1394
+ # source://webrick//lib/webrick/httpresponse.rb#80
1395
+ def request_uri; end
1396
+
1397
+ # Request URI for this response
1398
+ #
1399
+ # source://webrick//lib/webrick/httpresponse.rb#80
1400
+ def request_uri=(_arg0); end
1401
+
1402
+ # Sends the body on +socket+
1403
+ #
1404
+ # source://webrick//lib/webrick/httpresponse.rb#356
1405
+ def send_body(socket); end
1406
+
1407
+ # Sends the headers on +socket+
1408
+ #
1409
+ # source://webrick//lib/webrick/httpresponse.rb#333
1410
+ def send_header(socket); end
1411
+
1412
+ # Sends the response on +socket+
1413
+ #
1414
+ # source://webrick//lib/webrick/httpresponse.rb#223
1415
+ def send_response(socket); end
1416
+
1417
+ # Bytes sent in this response
1418
+ #
1419
+ # source://webrick//lib/webrick/httpresponse.rb#106
1420
+ def sent_size; end
1421
+
1422
+ # Creates an error page for exception +ex+ with an optional +backtrace+
1423
+ #
1424
+ # source://webrick//lib/webrick/httpresponse.rb#383
1425
+ def set_error(ex, backtrace = T.unsafe(nil)); end
1426
+
1427
+ # Redirects to +url+ with a WEBrick::HTTPStatus::Redirect +status+.
1428
+ #
1429
+ # Example:
1430
+ #
1431
+ # res.set_redirect WEBrick::HTTPStatus::TemporaryRedirect
1432
+ #
1433
+ # source://webrick//lib/webrick/httpresponse.rb#373
1434
+ def set_redirect(status, url); end
1435
+
1436
+ # Sets up the headers for sending
1437
+ #
1438
+ # source://webrick//lib/webrick/httpresponse.rb#240
1439
+ def setup_header; end
1440
+
1441
+ # Response status code (200)
1442
+ #
1443
+ # source://webrick//lib/webrick/httpresponse.rb#36
1444
+ def status; end
1445
+
1446
+ # Sets the response's status to the +status+ code
1447
+ #
1448
+ # source://webrick//lib/webrick/httpresponse.rb#142
1449
+ def status=(status); end
1450
+
1451
+ # The response's HTTP status line
1452
+ #
1453
+ # source://webrick//lib/webrick/httpresponse.rb#135
1454
+ def status_line; end
1455
+
1456
+ private
1457
+
1458
+ # preserved for compatibility with some 3rd-party handlers
1459
+ #
1460
+ # source://webrick//lib/webrick/httpresponse.rb#557
1461
+ def _write_data(socket, data); end
1462
+
1463
+ # source://webrick//lib/webrick/httpresponse.rb#410
1464
+ def check_header(header_value); end
1465
+
1466
+ # :stopdoc:
1467
+ #
1468
+ # source://webrick//lib/webrick/httpresponse.rb#421
1469
+ def error_body(backtrace, ex, host, port); end
1470
+
1471
+ # source://webrick//lib/webrick/httpresponse.rb#451
1472
+ def send_body_io(socket); end
1473
+
1474
+ # source://webrick//lib/webrick/httpresponse.rb#513
1475
+ def send_body_proc(socket); end
1476
+
1477
+ # source://webrick//lib/webrick/httpresponse.rb#491
1478
+ def send_body_string(socket); end
1479
+ end
1480
+
1481
+ # source://webrick//lib/webrick/httpresponse.rb#531
1482
+ class WEBrick::HTTPResponse::ChunkedWrapper
1483
+ # @return [ChunkedWrapper] a new instance of ChunkedWrapper
1484
+ #
1485
+ # source://webrick//lib/webrick/httpresponse.rb#532
1486
+ def initialize(socket, resp); end
1487
+
1488
+ # source://webrick//lib/webrick/httpresponse.rb#550
1489
+ def <<(*buf); end
1490
+
1491
+ # source://webrick//lib/webrick/httpresponse.rb#537
1492
+ def write(buf); end
1493
+ end
1494
+
1495
+ # An HTTP Server
1496
+ #
1497
+ # source://webrick//lib/webrick/httpserver.rb#44
1498
+ class WEBrick::HTTPServer < ::WEBrick::GenericServer
1499
+ # Creates a new HTTP server according to +config+
1500
+ #
1501
+ # An HTTP server uses the following attributes:
1502
+ #
1503
+ # :AccessLog:: An array of access logs. See WEBrick::AccessLog
1504
+ # :BindAddress:: Local address for the server to bind to
1505
+ # :DocumentRoot:: Root path to serve files from
1506
+ # :DocumentRootOptions:: Options for the default HTTPServlet::FileHandler
1507
+ # :HTTPVersion:: The HTTP version of this server
1508
+ # :Port:: Port to listen on
1509
+ # :RequestCallback:: Called with a request and response before each
1510
+ # request is serviced.
1511
+ # :RequestTimeout:: Maximum time to wait between requests
1512
+ # :ServerAlias:: Array of alternate names for this server for virtual
1513
+ # hosting
1514
+ # :ServerName:: Name for this server for virtual hosting
1515
+ #
1516
+ # @return [HTTPServer] a new instance of HTTPServer
1517
+ #
1518
+ # source://webrick//lib/webrick/httpserver.rb#46
1519
+ def initialize(config = T.unsafe(nil), default = T.unsafe(nil)); end
1520
+
1521
+ # Logs +req+ and +res+ in the access logs. +config+ is used for the
1522
+ # server name.
1523
+ #
1524
+ # source://webrick//lib/webrick/httpserver.rb#220
1525
+ def access_log(config, req, res); end
1526
+
1527
+ # Creates the HTTPRequest used when handling the HTTP
1528
+ # request. Can be overridden by subclasses.
1529
+ #
1530
+ # source://webrick//lib/webrick/httpserver.rb#230
1531
+ def create_request(with_webrick_config); end
1532
+
1533
+ # Creates the HTTPResponse used when handling the HTTP
1534
+ # request. Can be overridden by subclasses.
1535
+ #
1536
+ # source://webrick//lib/webrick/httpserver.rb#237
1537
+ def create_response(with_webrick_config); end
1538
+
1539
+ # The default OPTIONS request handler says GET, HEAD, POST and OPTIONS
1540
+ # requests are allowed.
1541
+ #
1542
+ # source://webrick//lib/webrick/httpserver.rb#147
1543
+ def do_OPTIONS(req, res); end
1544
+
1545
+ # Finds the appropriate virtual host to handle +req+
1546
+ #
1547
+ # source://webrick//lib/webrick/httpserver.rb#207
1548
+ def lookup_server(req); end
1549
+
1550
+ # Mounts +servlet+ on +dir+ passing +options+ to the servlet at creation
1551
+ # time
1552
+ #
1553
+ # source://webrick//lib/webrick/httpserver.rb#155
1554
+ def mount(dir, servlet, *options); end
1555
+
1556
+ # Mounts +proc+ or +block+ on +dir+ and calls it with a
1557
+ # WEBrick::HTTPRequest and WEBrick::HTTPResponse
1558
+ #
1559
+ # @raise [HTTPServerError]
1560
+ #
1561
+ # source://webrick//lib/webrick/httpserver.rb#164
1562
+ def mount_proc(dir, proc = T.unsafe(nil), &block); end
1563
+
1564
+ # Processes requests on +sock+
1565
+ #
1566
+ # source://webrick//lib/webrick/httpserver.rb#69
1567
+ def run(sock); end
1568
+
1569
+ # Finds a servlet for +path+
1570
+ #
1571
+ # source://webrick//lib/webrick/httpserver.rb#182
1572
+ def search_servlet(path); end
1573
+
1574
+ # Services +req+ and fills in +res+
1575
+ #
1576
+ # @raise [HTTPStatus::NotFound]
1577
+ #
1578
+ # source://webrick//lib/webrick/httpserver.rb#125
1579
+ def service(req, res); end
1580
+
1581
+ # Unmounts +dir+
1582
+ #
1583
+ # source://webrick//lib/webrick/httpserver.rb#173
1584
+ def umount(dir); end
1585
+
1586
+ # Unmounts +dir+
1587
+ #
1588
+ # source://webrick//lib/webrick/httpserver.rb#173
1589
+ def unmount(dir); end
1590
+
1591
+ # Adds +server+ as a virtual host.
1592
+ #
1593
+ # source://webrick//lib/webrick/httpserver.rb#193
1594
+ def virtual_host(server); end
1595
+ end
1596
+
1597
+ # Mount table for the path a servlet is mounted on in the directory space
1598
+ # of the server. Users of WEBrick can only access this indirectly via
1599
+ # WEBrick::HTTPServer#mount, WEBrick::HTTPServer#unmount and
1600
+ # WEBrick::HTTPServer#search_servlet
1601
+ #
1602
+ # source://webrick//lib/webrick/httpserver.rb#247
1603
+ class WEBrick::HTTPServer::MountTable
1604
+ # @return [MountTable] a new instance of MountTable
1605
+ #
1606
+ # source://webrick//lib/webrick/httpserver.rb#248
1607
+ def initialize; end
1608
+
1609
+ # source://webrick//lib/webrick/httpserver.rb#253
1610
+ def [](dir); end
1611
+
1612
+ # source://webrick//lib/webrick/httpserver.rb#258
1613
+ def []=(dir, val); end
1614
+
1615
+ # source://webrick//lib/webrick/httpserver.rb#265
1616
+ def delete(dir); end
1617
+
1618
+ # source://webrick//lib/webrick/httpserver.rb#272
1619
+ def scan(path); end
1620
+
1621
+ private
1622
+
1623
+ # source://webrick//lib/webrick/httpserver.rb#279
1624
+ def compile; end
1625
+
1626
+ # source://webrick//lib/webrick/httpserver.rb#287
1627
+ def normalize(dir); end
1628
+ end
1629
+
1630
+ # AbstractServlet allows HTTP server modules to be reused across multiple
1631
+ # servers and allows encapsulation of functionality.
1632
+ #
1633
+ # By default a servlet will respond to GET, HEAD (through an alias to GET)
1634
+ # and OPTIONS requests.
1635
+ #
1636
+ # By default a new servlet is initialized for every request. A servlet
1637
+ # instance can be reused by overriding ::get_instance in the
1638
+ # AbstractServlet subclass.
1639
+ #
1640
+ # == A Simple Servlet
1641
+ #
1642
+ # class Simple < WEBrick::HTTPServlet::AbstractServlet
1643
+ # def do_GET request, response
1644
+ # status, content_type, body = do_stuff_with request
1645
+ #
1646
+ # response.status = status
1647
+ # response['Content-Type'] = content_type
1648
+ # response.body = body
1649
+ # end
1650
+ #
1651
+ # def do_stuff_with request
1652
+ # return 200, 'text/plain', 'you got a page'
1653
+ # end
1654
+ # end
1655
+ #
1656
+ # This servlet can be mounted on a server at a given path:
1657
+ #
1658
+ # server.mount '/simple', Simple
1659
+ #
1660
+ # == Servlet Configuration
1661
+ #
1662
+ # Servlets can be configured via initialize. The first argument is the
1663
+ # HTTP server the servlet is being initialized for.
1664
+ #
1665
+ # class Configurable < Simple
1666
+ # def initialize server, color, size
1667
+ # super server
1668
+ # @color = color
1669
+ # @size = size
1670
+ # end
1671
+ #
1672
+ # def do_stuff_with request
1673
+ # content = "<p " \
1674
+ # %q{style="color: #{@color}; font-size: #{@size}"} \
1675
+ # ">Hello, World!"
1676
+ #
1677
+ # return 200, "text/html", content
1678
+ # end
1679
+ # end
1680
+ #
1681
+ # This servlet must be provided two arguments at mount time:
1682
+ #
1683
+ # server.mount '/configurable', Configurable, 'red', '2em'
1684
+ #
1685
+ # source://webrick//lib/webrick/httpservlet/abstract.rb#76
1686
+ class WEBrick::HTTPServlet::AbstractServlet
1687
+ # Initializes a new servlet for +server+ using +options+ which are
1688
+ # stored as-is in +@options+. +@logger+ is also provided.
1689
+ #
1690
+ # @return [AbstractServlet] a new instance of AbstractServlet
1691
+ #
1692
+ # source://webrick//lib/webrick/httpservlet/abstract.rb#91
1693
+ def initialize(server, *options); end
1694
+
1695
+ # Raises a NotFound exception
1696
+ #
1697
+ # @raise [HTTPStatus::NotFound]
1698
+ #
1699
+ # source://webrick//lib/webrick/httpservlet/abstract.rb#115
1700
+ def do_GET(req, res); end
1701
+
1702
+ # Dispatches to do_GET
1703
+ #
1704
+ # source://webrick//lib/webrick/httpservlet/abstract.rb#122
1705
+ def do_HEAD(req, res); end
1706
+
1707
+ # Returns the allowed HTTP request methods
1708
+ #
1709
+ # source://webrick//lib/webrick/httpservlet/abstract.rb#129
1710
+ def do_OPTIONS(req, res); end
1711
+
1712
+ # Dispatches to a +do_+ method based on +req+ if such a method is
1713
+ # available. (+do_GET+ for a GET request). Raises a MethodNotAllowed
1714
+ # exception if the method is not implemented.
1715
+ #
1716
+ # source://webrick//lib/webrick/httpservlet/abstract.rb#102
1717
+ def service(req, res); end
1718
+
1719
+ private
1720
+
1721
+ # Redirects to a path ending in /
1722
+ #
1723
+ # source://webrick//lib/webrick/httpservlet/abstract.rb#140
1724
+ def redirect_to_directory_uri(req, res); end
1725
+
1726
+ class << self
1727
+ # Factory for servlet instances that will handle a request from +server+
1728
+ # using +options+ from the mount point. By default a new servlet
1729
+ # instance is created for every call.
1730
+ #
1731
+ # source://webrick//lib/webrick/httpservlet/abstract.rb#83
1732
+ def get_instance(server, *options); end
1733
+ end
1734
+ end
1735
+
1736
+ # Servlet for handling CGI scripts
1737
+ #
1738
+ # Example:
1739
+ #
1740
+ # server.mount('/cgi/my_script', WEBrick::HTTPServlet::CGIHandler,
1741
+ # '/path/to/my_script')
1742
+ #
1743
+ # source://webrick//lib/webrick/httpservlet/cgihandler.rb#28
1744
+ class WEBrick::HTTPServlet::CGIHandler < ::WEBrick::HTTPServlet::AbstractServlet
1745
+ # Creates a new CGI script servlet for the script at +name+
1746
+ #
1747
+ # @return [CGIHandler] a new instance of CGIHandler
1748
+ #
1749
+ # source://webrick//lib/webrick/httpservlet/cgihandler.rb#36
1750
+ def initialize(server, name); end
1751
+
1752
+ # :stopdoc:
1753
+ #
1754
+ # @raise [HTTPStatus::InternalServerError]
1755
+ #
1756
+ # source://webrick//lib/webrick/httpservlet/cgihandler.rb#50
1757
+ def do_GET(req, res); end
1758
+
1759
+ # :stopdoc:
1760
+ #
1761
+ # @raise [HTTPStatus::InternalServerError]
1762
+ #
1763
+ # source://webrick//lib/webrick/httpservlet/cgihandler.rb#50
1764
+ def do_POST(req, res); end
1765
+ end
1766
+
1767
+ # source://webrick//lib/webrick/httpservlet/cgihandler.rb#31
1768
+ WEBrick::HTTPServlet::CGIHandler::CGIRunnerArray = T.let(T.unsafe(nil), Array)
1769
+
1770
+ # Servlet for serving a single file. You probably want to use the
1771
+ # FileHandler servlet instead as it handles directories and fancy indexes.
1772
+ #
1773
+ # Example:
1774
+ #
1775
+ # server.mount('/my_page.txt', WEBrick::HTTPServlet::DefaultFileHandler,
1776
+ # '/path/to/my_page.txt')
1777
+ #
1778
+ # This servlet handles If-Modified-Since and Range requests.
1779
+ #
1780
+ # source://webrick//lib/webrick/httpservlet/filehandler.rb#32
1781
+ class WEBrick::HTTPServlet::DefaultFileHandler < ::WEBrick::HTTPServlet::AbstractServlet
1782
+ # Creates a DefaultFileHandler instance for the file at +local_path+.
1783
+ #
1784
+ # @return [DefaultFileHandler] a new instance of DefaultFileHandler
1785
+ #
1786
+ # source://webrick//lib/webrick/httpservlet/filehandler.rb#37
1787
+ def initialize(server, local_path); end
1788
+
1789
+ # :stopdoc:
1790
+ #
1791
+ # source://webrick//lib/webrick/httpservlet/filehandler.rb#44
1792
+ def do_GET(req, res); end
1793
+
1794
+ # source://webrick//lib/webrick/httpservlet/filehandler.rb#118
1795
+ def make_partial_content(req, res, filename, filesize); end
1796
+
1797
+ # returns a lambda for webrick/httpresponse.rb send_body_proc
1798
+ #
1799
+ # source://webrick//lib/webrick/httpservlet/filehandler.rb#90
1800
+ def multipart_body(body, parts, boundary, mtype, filesize); end
1801
+
1802
+ # @return [Boolean]
1803
+ #
1804
+ # source://webrick//lib/webrick/httpservlet/filehandler.rb#64
1805
+ def not_modified?(req, res, mtime, etag); end
1806
+
1807
+ # source://webrick//lib/webrick/httpservlet/filehandler.rb#155
1808
+ def prepare_range(range, filesize); end
1809
+ end
1810
+
1811
+ # ERBHandler evaluates an ERB file and returns the result. This handler
1812
+ # is automatically used if there are .rhtml files in a directory served by
1813
+ # the FileHandler.
1814
+ #
1815
+ # ERBHandler supports GET and POST methods.
1816
+ #
1817
+ # The ERB file is evaluated with the local variables +servlet_request+ and
1818
+ # +servlet_response+ which are a WEBrick::HTTPRequest and
1819
+ # WEBrick::HTTPResponse respectively.
1820
+ #
1821
+ # Example .rhtml file:
1822
+ #
1823
+ # Request to <%= servlet_request.request_uri %>
1824
+ #
1825
+ # Query params <%= servlet_request.query.inspect %>
1826
+ #
1827
+ # source://webrick//lib/webrick/httpservlet/erbhandler.rb#36
1828
+ class WEBrick::HTTPServlet::ERBHandler < ::WEBrick::HTTPServlet::AbstractServlet
1829
+ # Creates a new ERBHandler on +server+ that will evaluate and serve the
1830
+ # ERB file +name+
1831
+ #
1832
+ # @return [ERBHandler] a new instance of ERBHandler
1833
+ #
1834
+ # source://webrick//lib/webrick/httpservlet/erbhandler.rb#42
1835
+ def initialize(server, name); end
1836
+
1837
+ # Handles GET requests
1838
+ #
1839
+ # source://webrick//lib/webrick/httpservlet/erbhandler.rb#50
1840
+ def do_GET(req, res); end
1841
+
1842
+ # Handles GET requests
1843
+ #
1844
+ # Handles POST requests
1845
+ #
1846
+ # source://webrick//lib/webrick/httpservlet/erbhandler.rb#50
1847
+ def do_POST(req, res); end
1848
+
1849
+ private
1850
+
1851
+ # Evaluates +erb+ providing +servlet_request+ and +servlet_response+ as
1852
+ # local variables.
1853
+ #
1854
+ # source://webrick//lib/webrick/httpservlet/erbhandler.rb#79
1855
+ def evaluate(erb, servlet_request, servlet_response); end
1856
+ end
1857
+
1858
+ # Serves a directory including fancy indexing and a variety of other
1859
+ # options.
1860
+ #
1861
+ # Example:
1862
+ #
1863
+ # server.mount('/assets', WEBrick::HTTPServlet::FileHandler,
1864
+ # '/path/to/assets')
1865
+ #
1866
+ # source://webrick//lib/webrick/httpservlet/filehandler.rb#175
1867
+ class WEBrick::HTTPServlet::FileHandler < ::WEBrick::HTTPServlet::AbstractServlet
1868
+ # Creates a FileHandler servlet on +server+ that serves files starting
1869
+ # at directory +root+
1870
+ #
1871
+ # +options+ may be a Hash containing keys from
1872
+ # WEBrick::Config::FileHandler or +true+ or +false+.
1873
+ #
1874
+ # If +options+ is true or false then +:FancyIndexing+ is enabled or
1875
+ # disabled respectively.
1876
+ #
1877
+ # @return [FileHandler] a new instance of FileHandler
1878
+ #
1879
+ # source://webrick//lib/webrick/httpservlet/filehandler.rb#203
1880
+ def initialize(server, root, options = T.unsafe(nil), default = T.unsafe(nil)); end
1881
+
1882
+ # source://webrick//lib/webrick/httpservlet/filehandler.rb#245
1883
+ def do_GET(req, res); end
1884
+
1885
+ # source://webrick//lib/webrick/httpservlet/filehandler.rb#257
1886
+ def do_OPTIONS(req, res); end
1887
+
1888
+ # source://webrick//lib/webrick/httpservlet/filehandler.rb#251
1889
+ def do_POST(req, res); end
1890
+
1891
+ # source://webrick//lib/webrick/httpservlet/filehandler.rb#224
1892
+ def service(req, res); end
1893
+
1894
+ # :stopdoc:
1895
+ #
1896
+ # source://webrick//lib/webrick/httpservlet/filehandler.rb#215
1897
+ def set_filesystem_encoding(str); end
1898
+
1899
+ private
1900
+
1901
+ # source://webrick//lib/webrick/httpservlet/filehandler.rb#416
1902
+ def call_callback(callback_name, req, res); end
1903
+
1904
+ # source://webrick//lib/webrick/httpservlet/filehandler.rb#369
1905
+ def check_filename(req, res, name); end
1906
+
1907
+ # @raise [HTTPStatus::NotFound]
1908
+ #
1909
+ # source://webrick//lib/webrick/httpservlet/filehandler.rb#309
1910
+ def exec_handler(req, res); end
1911
+
1912
+ # source://webrick//lib/webrick/httpservlet/filehandler.rb#322
1913
+ def get_handler(req, res); end
1914
+
1915
+ # @return [Boolean]
1916
+ #
1917
+ # source://webrick//lib/webrick/httpservlet/filehandler.rb#428
1918
+ def nondisclosure_name?(name); end
1919
+
1920
+ # source://webrick//lib/webrick/httpservlet/filehandler.rb#286
1921
+ def prevent_directory_traversal(req, res); end
1922
+
1923
+ # source://webrick//lib/webrick/httpservlet/filehandler.rb#394
1924
+ def search_file(req, res, basename); end
1925
+
1926
+ # source://webrick//lib/webrick/httpservlet/filehandler.rb#385
1927
+ def search_index_file(req, res); end
1928
+
1929
+ # source://webrick//lib/webrick/httpservlet/filehandler.rb#437
1930
+ def set_dir_list(req, res); end
1931
+
1932
+ # source://webrick//lib/webrick/httpservlet/filehandler.rb#335
1933
+ def set_filename(req, res); end
1934
+
1935
+ # source://webrick//lib/webrick/httpservlet/filehandler.rb#376
1936
+ def shift_path_info(req, res, path_info, base = T.unsafe(nil)); end
1937
+
1938
+ # @return [Boolean]
1939
+ #
1940
+ # source://webrick//lib/webrick/httpservlet/filehandler.rb#277
1941
+ def trailing_pathsep?(path); end
1942
+
1943
+ # @return [Boolean]
1944
+ #
1945
+ # source://webrick//lib/webrick/httpservlet/filehandler.rb#422
1946
+ def windows_ambiguous_name?(name); end
1947
+
1948
+ class << self
1949
+ # Allow custom handling of requests for files with +suffix+ by class
1950
+ # +handler+
1951
+ #
1952
+ # source://webrick//lib/webrick/httpservlet/filehandler.rb#182
1953
+ def add_handler(suffix, handler); end
1954
+
1955
+ # Remove custom handling of requests for files with +suffix+
1956
+ #
1957
+ # source://webrick//lib/webrick/httpservlet/filehandler.rb#189
1958
+ def remove_handler(suffix); end
1959
+ end
1960
+ end
1961
+
1962
+ # This module is used to manager HTTP status codes.
1963
+ #
1964
+ # See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html for more
1965
+ # information.
1966
+ #
1967
+ # source://webrick//lib/webrick/httpstatus.rb#21
1968
+ module WEBrick::HTTPStatus
1969
+ private
1970
+
1971
+ # Is +code+ a client error status?
1972
+ #
1973
+ # @return [Boolean]
1974
+ #
1975
+ # source://webrick//lib/webrick/httpstatus.rb#170
1976
+ def client_error?(code); end
1977
+
1978
+ # Is +code+ an error status?
1979
+ #
1980
+ # @return [Boolean]
1981
+ #
1982
+ # source://webrick//lib/webrick/httpstatus.rb#164
1983
+ def error?(code); end
1984
+
1985
+ # Is +code+ an informational status?
1986
+ #
1987
+ # @return [Boolean]
1988
+ #
1989
+ # source://webrick//lib/webrick/httpstatus.rb#146
1990
+ def info?(code); end
1991
+
1992
+ # Returns the description corresponding to the HTTP status +code+
1993
+ #
1994
+ # WEBrick::HTTPStatus.reason_phrase 404
1995
+ # => "Not Found"
1996
+ #
1997
+ # source://webrick//lib/webrick/httpstatus.rb#140
1998
+ def reason_phrase(code); end
1999
+
2000
+ # Is +code+ a redirection status?
2001
+ #
2002
+ # @return [Boolean]
2003
+ #
2004
+ # source://webrick//lib/webrick/httpstatus.rb#158
2005
+ def redirect?(code); end
2006
+
2007
+ # Is +code+ a server error status?
2008
+ #
2009
+ # @return [Boolean]
2010
+ #
2011
+ # source://webrick//lib/webrick/httpstatus.rb#176
2012
+ def server_error?(code); end
2013
+
2014
+ # Is +code+ a successful status?
2015
+ #
2016
+ # @return [Boolean]
2017
+ #
2018
+ # source://webrick//lib/webrick/httpstatus.rb#152
2019
+ def success?(code); end
2020
+
2021
+ class << self
2022
+ # Returns the status class corresponding to +code+
2023
+ #
2024
+ # WEBrick::HTTPStatus[302]
2025
+ # => WEBrick::HTTPStatus::NotFound
2026
+ #
2027
+ # source://webrick//lib/webrick/httpstatus.rb#186
2028
+ def [](code); end
2029
+
2030
+ # Is +code+ a client error status?
2031
+ #
2032
+ # @return [Boolean]
2033
+ #
2034
+ # source://webrick//lib/webrick/httpstatus.rb#170
2035
+ def client_error?(code); end
2036
+
2037
+ # Is +code+ an error status?
2038
+ #
2039
+ # @return [Boolean]
2040
+ #
2041
+ # source://webrick//lib/webrick/httpstatus.rb#164
2042
+ def error?(code); end
2043
+
2044
+ # Is +code+ an informational status?
2045
+ #
2046
+ # @return [Boolean]
2047
+ #
2048
+ # source://webrick//lib/webrick/httpstatus.rb#146
2049
+ def info?(code); end
2050
+
2051
+ # Returns the description corresponding to the HTTP status +code+
2052
+ #
2053
+ # WEBrick::HTTPStatus.reason_phrase 404
2054
+ # => "Not Found"
2055
+ #
2056
+ # source://webrick//lib/webrick/httpstatus.rb#140
2057
+ def reason_phrase(code); end
2058
+
2059
+ # Is +code+ a redirection status?
2060
+ #
2061
+ # @return [Boolean]
2062
+ #
2063
+ # source://webrick//lib/webrick/httpstatus.rb#158
2064
+ def redirect?(code); end
2065
+
2066
+ # Is +code+ a server error status?
2067
+ #
2068
+ # @return [Boolean]
2069
+ #
2070
+ # source://webrick//lib/webrick/httpstatus.rb#176
2071
+ def server_error?(code); end
2072
+
2073
+ # Is +code+ a successful status?
2074
+ #
2075
+ # @return [Boolean]
2076
+ #
2077
+ # source://webrick//lib/webrick/httpstatus.rb#152
2078
+ def success?(code); end
2079
+ end
2080
+ end
2081
+
2082
+ # Root of the HTTP status class hierarchy
2083
+ #
2084
+ # source://webrick//lib/webrick/httpstatus.rb#25
2085
+ class WEBrick::HTTPStatus::Status < ::StandardError
2086
+ # Returns the HTTP status code
2087
+ #
2088
+ # source://webrick//lib/webrick/httpstatus.rb#31
2089
+ def code; end
2090
+
2091
+ # Returns the HTTP status description
2092
+ #
2093
+ # source://webrick//lib/webrick/httpstatus.rb#34
2094
+ def reason_phrase; end
2095
+
2096
+ # Returns the HTTP status code
2097
+ #
2098
+ # source://webrick//lib/webrick/httpstatus.rb#31
2099
+ def to_i; end
2100
+
2101
+ class << self
2102
+ # source://webrick//lib/webrick/httpstatus.rb#27
2103
+ def code; end
2104
+
2105
+ # source://webrick//lib/webrick/httpstatus.rb#27
2106
+ def reason_phrase; end
2107
+ end
2108
+ end
2109
+
2110
+ # HTTPUtils provides utility methods for working with the HTTP protocol.
2111
+ #
2112
+ # This module is generally used internally by WEBrick
2113
+ #
2114
+ # source://webrick//lib/webrick/httputils.rb#25
2115
+ module WEBrick::HTTPUtils
2116
+ private
2117
+
2118
+ # source://webrick//lib/webrick/httputils.rb#443
2119
+ def _escape(str, regex); end
2120
+
2121
+ # :stopdoc:
2122
+ #
2123
+ # source://webrick//lib/webrick/httputils.rb#441
2124
+ def _make_regex(str); end
2125
+
2126
+ # source://webrick//lib/webrick/httputils.rb#442
2127
+ def _make_regex!(str); end
2128
+
2129
+ # source://webrick//lib/webrick/httputils.rb#449
2130
+ def _unescape(str, regex); end
2131
+
2132
+ # Removes quotes and escapes from +str+
2133
+ #
2134
+ # source://webrick//lib/webrick/httputils.rb#223
2135
+ def dequote(str); end
2136
+
2137
+ # Escapes HTTP reserved and unwise characters in +str+
2138
+ #
2139
+ # source://webrick//lib/webrick/httputils.rb#467
2140
+ def escape(str); end
2141
+
2142
+ # Escapes 8 bit characters in +str+
2143
+ #
2144
+ # source://webrick//lib/webrick/httputils.rb#508
2145
+ def escape8bit(str); end
2146
+
2147
+ # Escapes form reserved characters in +str+
2148
+ #
2149
+ # source://webrick//lib/webrick/httputils.rb#481
2150
+ def escape_form(str); end
2151
+
2152
+ # Escapes path +str+
2153
+ #
2154
+ # source://webrick//lib/webrick/httputils.rb#497
2155
+ def escape_path(str); end
2156
+
2157
+ # Loads Apache-compatible mime.types in +file+.
2158
+ #
2159
+ # source://webrick//lib/webrick/httputils.rb#112
2160
+ def load_mime_types(file); end
2161
+
2162
+ # Returns the mime type of +filename+ from the list in +mime_tab+. If no
2163
+ # mime type was found application/octet-stream is returned.
2164
+ #
2165
+ # source://webrick//lib/webrick/httputils.rb#134
2166
+ def mime_type(filename, mime_tab); end
2167
+
2168
+ # Normalizes a request path. Raises an exception if the path cannot be
2169
+ # normalized.
2170
+ #
2171
+ # source://webrick//lib/webrick/httputils.rb#31
2172
+ def normalize_path(path); end
2173
+
2174
+ # Parses form data in +io+ with the given +boundary+
2175
+ #
2176
+ # source://webrick//lib/webrick/httputils.rb#395
2177
+ def parse_form_data(io, boundary); end
2178
+
2179
+ # Parses an HTTP header +raw+ into a hash of header fields with an Array
2180
+ # of values.
2181
+ #
2182
+ # source://webrick//lib/webrick/httputils.rb#145
2183
+ def parse_header(raw); end
2184
+
2185
+ # Parses the query component of a URI in +str+
2186
+ #
2187
+ # source://webrick//lib/webrick/httputils.rb#371
2188
+ def parse_query(str); end
2189
+
2190
+ # Parses q values in +value+ as used in Accept headers.
2191
+ #
2192
+ # source://webrick//lib/webrick/httputils.rb#202
2193
+ def parse_qvalues(value); end
2194
+
2195
+ # Parses a Range header value +ranges_specifier+
2196
+ #
2197
+ # source://webrick//lib/webrick/httputils.rb#184
2198
+ def parse_range_header(ranges_specifier); end
2199
+
2200
+ # Quotes and escapes quotes in +str+
2201
+ #
2202
+ # source://webrick//lib/webrick/httputils.rb#233
2203
+ def quote(str); end
2204
+
2205
+ # Splits a header value +str+ according to HTTP specification.
2206
+ #
2207
+ # source://webrick//lib/webrick/httputils.rb#175
2208
+ def split_header_value(str); end
2209
+
2210
+ # Unescapes HTTP reserved and unwise characters in +str+
2211
+ #
2212
+ # source://webrick//lib/webrick/httputils.rb#474
2213
+ def unescape(str); end
2214
+
2215
+ # Unescapes form reserved characters in +str+
2216
+ #
2217
+ # source://webrick//lib/webrick/httputils.rb#490
2218
+ def unescape_form(str); end
2219
+
2220
+ class << self
2221
+ # source://webrick//lib/webrick/httputils.rb#443
2222
+ def _escape(str, regex); end
2223
+
2224
+ # :stopdoc:
2225
+ #
2226
+ # source://webrick//lib/webrick/httputils.rb#441
2227
+ def _make_regex(str); end
2228
+
2229
+ # source://webrick//lib/webrick/httputils.rb#442
2230
+ def _make_regex!(str); end
2231
+
2232
+ # source://webrick//lib/webrick/httputils.rb#449
2233
+ def _unescape(str, regex); end
2234
+
2235
+ # Removes quotes and escapes from +str+
2236
+ #
2237
+ # source://webrick//lib/webrick/httputils.rb#223
2238
+ def dequote(str); end
2239
+
2240
+ # Escapes HTTP reserved and unwise characters in +str+
2241
+ #
2242
+ # source://webrick//lib/webrick/httputils.rb#467
2243
+ def escape(str); end
2244
+
2245
+ # Escapes 8 bit characters in +str+
2246
+ #
2247
+ # source://webrick//lib/webrick/httputils.rb#508
2248
+ def escape8bit(str); end
2249
+
2250
+ # Escapes form reserved characters in +str+
2251
+ #
2252
+ # source://webrick//lib/webrick/httputils.rb#481
2253
+ def escape_form(str); end
2254
+
2255
+ # Escapes path +str+
2256
+ #
2257
+ # source://webrick//lib/webrick/httputils.rb#497
2258
+ def escape_path(str); end
2259
+
2260
+ # Loads Apache-compatible mime.types in +file+.
2261
+ #
2262
+ # source://webrick//lib/webrick/httputils.rb#112
2263
+ def load_mime_types(file); end
2264
+
2265
+ # Returns the mime type of +filename+ from the list in +mime_tab+. If no
2266
+ # mime type was found application/octet-stream is returned.
2267
+ #
2268
+ # source://webrick//lib/webrick/httputils.rb#134
2269
+ def mime_type(filename, mime_tab); end
2270
+
2271
+ # Normalizes a request path. Raises an exception if the path cannot be
2272
+ # normalized.
2273
+ #
2274
+ # source://webrick//lib/webrick/httputils.rb#31
2275
+ def normalize_path(path); end
2276
+
2277
+ # Parses form data in +io+ with the given +boundary+
2278
+ #
2279
+ # source://webrick//lib/webrick/httputils.rb#395
2280
+ def parse_form_data(io, boundary); end
2281
+
2282
+ # Parses an HTTP header +raw+ into a hash of header fields with an Array
2283
+ # of values.
2284
+ #
2285
+ # source://webrick//lib/webrick/httputils.rb#145
2286
+ def parse_header(raw); end
2287
+
2288
+ # Parses the query component of a URI in +str+
2289
+ #
2290
+ # source://webrick//lib/webrick/httputils.rb#371
2291
+ def parse_query(str); end
2292
+
2293
+ # Parses q values in +value+ as used in Accept headers.
2294
+ #
2295
+ # source://webrick//lib/webrick/httputils.rb#202
2296
+ def parse_qvalues(value); end
2297
+
2298
+ # Parses a Range header value +ranges_specifier+
2299
+ #
2300
+ # source://webrick//lib/webrick/httputils.rb#184
2301
+ def parse_range_header(ranges_specifier); end
2302
+
2303
+ # Quotes and escapes quotes in +str+
2304
+ #
2305
+ # source://webrick//lib/webrick/httputils.rb#233
2306
+ def quote(str); end
2307
+
2308
+ # Splits a header value +str+ according to HTTP specification.
2309
+ #
2310
+ # source://webrick//lib/webrick/httputils.rb#175
2311
+ def split_header_value(str); end
2312
+
2313
+ # Unescapes HTTP reserved and unwise characters in +str+
2314
+ #
2315
+ # source://webrick//lib/webrick/httputils.rb#474
2316
+ def unescape(str); end
2317
+
2318
+ # Unescapes form reserved characters in +str+
2319
+ #
2320
+ # source://webrick//lib/webrick/httputils.rb#490
2321
+ def unescape_form(str); end
2322
+ end
2323
+ end
2324
+
2325
+ # Stores multipart form data. FormData objects are created when
2326
+ # WEBrick::HTTPUtils.parse_form_data is called.
2327
+ #
2328
+ # source://webrick//lib/webrick/httputils.rb#242
2329
+ class WEBrick::HTTPUtils::FormData < ::String
2330
+ # Creates a new FormData object.
2331
+ #
2332
+ # +args+ is an Array of form data entries. One FormData will be created
2333
+ # for each entry.
2334
+ #
2335
+ # This is called by WEBrick::HTTPUtils.parse_form_data for you
2336
+ #
2337
+ # @return [FormData] a new instance of FormData
2338
+ #
2339
+ # source://webrick//lib/webrick/httputils.rb#267
2340
+ def initialize(*args); end
2341
+
2342
+ # Adds +str+ to this FormData which may be the body, a header or a
2343
+ # header entry.
2344
+ #
2345
+ # This is called by WEBrick::HTTPUtils.parse_form_data for you
2346
+ #
2347
+ # source://webrick//lib/webrick/httputils.rb#300
2348
+ def <<(str); end
2349
+
2350
+ # Retrieves the header at the first entry in +key+
2351
+ #
2352
+ # source://webrick//lib/webrick/httputils.rb#286
2353
+ def [](*key); end
2354
+
2355
+ # Adds +data+ at the end of the chain of entries
2356
+ #
2357
+ # This is called by WEBrick::HTTPUtils.parse_form_data for you.
2358
+ #
2359
+ # source://webrick//lib/webrick/httputils.rb#320
2360
+ def append_data(data); end
2361
+
2362
+ # Yields each entry in this FormData
2363
+ #
2364
+ # source://webrick//lib/webrick/httputils.rb#335
2365
+ def each_data; end
2366
+
2367
+ # The filename of the form data part
2368
+ #
2369
+ # source://webrick//lib/webrick/httputils.rb#254
2370
+ def filename; end
2371
+
2372
+ # The filename of the form data part
2373
+ #
2374
+ # source://webrick//lib/webrick/httputils.rb#254
2375
+ def filename=(_arg0); end
2376
+
2377
+ # Returns all the FormData as an Array
2378
+ #
2379
+ # source://webrick//lib/webrick/httputils.rb#347
2380
+ def list; end
2381
+
2382
+ # The name of the form data part
2383
+ #
2384
+ # source://webrick//lib/webrick/httputils.rb#249
2385
+ def name; end
2386
+
2387
+ # The name of the form data part
2388
+ #
2389
+ # source://webrick//lib/webrick/httputils.rb#249
2390
+ def name=(_arg0); end
2391
+
2392
+ # source://webrick//lib/webrick/httputils.rb#256
2393
+ def next_data=(_arg0); end
2394
+
2395
+ # Returns all the FormData as an Array
2396
+ #
2397
+ # A FormData will behave like an Array
2398
+ #
2399
+ # source://webrick//lib/webrick/httputils.rb#347
2400
+ def to_ary; end
2401
+
2402
+ # This FormData's body
2403
+ #
2404
+ # source://webrick//lib/webrick/httputils.rb#363
2405
+ def to_s; end
2406
+
2407
+ protected
2408
+
2409
+ # source://webrick//lib/webrick/httputils.rb#256
2410
+ def next_data; end
2411
+ end
2412
+
2413
+ # source://webrick//lib/webrick/utils.rb#17
2414
+ module WEBrick::Utils
2415
+ private
2416
+
2417
+ # Creates TCP server sockets bound to +address+:+port+ and returns them.
2418
+ #
2419
+ # It will create IPV4 and IPV6 sockets on all interfaces.
2420
+ #
2421
+ # source://webrick//lib/webrick/utils.rb#56
2422
+ def create_listeners(address, port); end
2423
+
2424
+ # The server hostname
2425
+ #
2426
+ # source://webrick//lib/webrick/utils.rb#47
2427
+ def getservername; end
2428
+
2429
+ # Generates a random string of length +len+
2430
+ #
2431
+ # source://webrick//lib/webrick/utils.rb#79
2432
+ def random_string(len); end
2433
+
2434
+ # Sets the close on exec flag for +io+
2435
+ #
2436
+ # source://webrick//lib/webrick/utils.rb#27
2437
+ def set_close_on_exec(io); end
2438
+
2439
+ # Sets IO operations on +io+ to be non-blocking
2440
+ #
2441
+ # source://webrick//lib/webrick/utils.rb#20
2442
+ def set_non_blocking(io); end
2443
+
2444
+ # Changes the process's uid and gid to the ones of +user+
2445
+ #
2446
+ # source://webrick//lib/webrick/utils.rb#34
2447
+ def su(user); end
2448
+
2449
+ # Executes the passed block and raises +exception+ if execution takes more
2450
+ # than +seconds+.
2451
+ #
2452
+ # If +seconds+ is zero or nil, simply executes the block
2453
+ #
2454
+ # source://webrick//lib/webrick/utils.rb#253
2455
+ def timeout(seconds, exception = T.unsafe(nil)); end
2456
+
2457
+ class << self
2458
+ # Creates TCP server sockets bound to +address+:+port+ and returns them.
2459
+ #
2460
+ # It will create IPV4 and IPV6 sockets on all interfaces.
2461
+ #
2462
+ # source://webrick//lib/webrick/utils.rb#56
2463
+ def create_listeners(address, port); end
2464
+
2465
+ # The server hostname
2466
+ #
2467
+ # source://webrick//lib/webrick/utils.rb#47
2468
+ def getservername; end
2469
+
2470
+ # Generates a random string of length +len+
2471
+ #
2472
+ # source://webrick//lib/webrick/utils.rb#79
2473
+ def random_string(len); end
2474
+
2475
+ # Sets the close on exec flag for +io+
2476
+ #
2477
+ # source://webrick//lib/webrick/utils.rb#27
2478
+ def set_close_on_exec(io); end
2479
+
2480
+ # Sets IO operations on +io+ to be non-blocking
2481
+ #
2482
+ # source://webrick//lib/webrick/utils.rb#20
2483
+ def set_non_blocking(io); end
2484
+
2485
+ # Changes the process's uid and gid to the ones of +user+
2486
+ #
2487
+ # source://webrick//lib/webrick/utils.rb#34
2488
+ def su(user); end
2489
+
2490
+ # Executes the passed block and raises +exception+ if execution takes more
2491
+ # than +seconds+.
2492
+ #
2493
+ # If +seconds+ is zero or nil, simply executes the block
2494
+ #
2495
+ # source://webrick//lib/webrick/utils.rb#253
2496
+ def timeout(seconds, exception = T.unsafe(nil)); end
2497
+ end
2498
+ end
2499
+
2500
+ # Class used to manage timeout handlers across multiple threads.
2501
+ #
2502
+ # Timeout handlers should be managed by using the class methods which are
2503
+ # synchronized.
2504
+ #
2505
+ # id = TimeoutHandler.register(10, Timeout::Error)
2506
+ # begin
2507
+ # sleep 20
2508
+ # puts 'foo'
2509
+ # ensure
2510
+ # TimeoutHandler.cancel(id)
2511
+ # end
2512
+ #
2513
+ # will raise Timeout::Error
2514
+ #
2515
+ # id = TimeoutHandler.register(10, Timeout::Error)
2516
+ # begin
2517
+ # sleep 5
2518
+ # puts 'foo'
2519
+ # ensure
2520
+ # TimeoutHandler.cancel(id)
2521
+ # end
2522
+ #
2523
+ # will print 'foo'
2524
+ #
2525
+ # source://webrick//lib/webrick/utils.rb#118
2526
+ class WEBrick::Utils::TimeoutHandler
2527
+ include ::Singleton
2528
+ extend ::Singleton::SingletonClassMethods
2529
+
2530
+ # Creates a new TimeoutHandler. You should use ::register and ::cancel
2531
+ # instead of creating the timeout handler directly.
2532
+ #
2533
+ # @return [TimeoutHandler] a new instance of TimeoutHandler
2534
+ #
2535
+ # source://webrick//lib/webrick/utils.rb#148
2536
+ def initialize; end
2537
+
2538
+ # Cancels the timeout handler +id+
2539
+ #
2540
+ # source://webrick//lib/webrick/utils.rb#226
2541
+ def cancel(thread, id); end
2542
+
2543
+ # Interrupts the timeout handler +id+ and raises +exception+
2544
+ #
2545
+ # source://webrick//lib/webrick/utils.rb#203
2546
+ def interrupt(thread, id, exception); end
2547
+
2548
+ # Registers a new timeout handler
2549
+ #
2550
+ # +time+:: Timeout in seconds
2551
+ # +exception+:: Exception to raise when timeout elapsed
2552
+ #
2553
+ # source://webrick//lib/webrick/utils.rb#214
2554
+ def register(thread, time, exception); end
2555
+
2556
+ # source://webrick//lib/webrick/utils.rb#240
2557
+ def terminate; end
2558
+
2559
+ private
2560
+
2561
+ # source://webrick//lib/webrick/utils.rb#158
2562
+ def watch; end
2563
+
2564
+ # source://webrick//lib/webrick/utils.rb#193
2565
+ def watcher; end
2566
+
2567
+ class << self
2568
+ # Cancels the timeout handler +id+
2569
+ #
2570
+ # source://webrick//lib/webrick/utils.rb#137
2571
+ def cancel(id); end
2572
+
2573
+ # Registers a new timeout handler
2574
+ #
2575
+ # +time+:: Timeout in seconds
2576
+ # +exception+:: Exception to raise when timeout elapsed
2577
+ #
2578
+ # source://webrick//lib/webrick/utils.rb#130
2579
+ def register(seconds, exception); end
2580
+
2581
+ # source://webrick//lib/webrick/utils.rb#141
2582
+ def terminate; end
2583
+ end
2584
+ end