mootool 0.1.2 → 0.2.2

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