webrick 1.8.1 → 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +4 -0
- data/README.md +2 -0
- data/Rakefile +0 -7
- data/lib/webrick/httprequest.rb +37 -9
- data/lib/webrick/httputils.rb +32 -12
- data/lib/webrick/version.rb +1 -1
- data/sig/accesslog.rbs +24 -0
- data/sig/cgi.rbs +92 -0
- data/sig/compat.rbs +18 -0
- data/sig/config.rbs +17 -0
- data/sig/cookie.rbs +37 -0
- data/sig/htmlutils.rbs +5 -0
- data/sig/httpauth/authenticator.rbs +55 -0
- data/sig/httpauth/basicauth.rbs +29 -0
- data/sig/httpauth/digestauth.rbs +85 -0
- data/sig/httpauth/htdigest.rbs +31 -0
- data/sig/httpauth/htgroup.rbs +21 -0
- data/sig/httpauth/htpasswd.rbs +31 -0
- data/sig/httpauth/userdb.rbs +13 -0
- data/sig/httpauth.rbs +13 -0
- data/sig/httpproxy.rbs +61 -0
- data/sig/httprequest.rbs +169 -0
- data/sig/httpresponse.rbs +117 -0
- data/sig/https.rbs +49 -0
- data/sig/httpserver.rbs +71 -0
- data/sig/httpservlet/abstract.rbs +36 -0
- data/sig/httpservlet/cgi_runner.rbs +3 -0
- data/sig/httpservlet/cgihandler.rbs +23 -0
- data/sig/httpservlet/erbhandler.rbs +17 -0
- data/sig/httpservlet/filehandler.rbs +76 -0
- data/sig/httpservlet/prochandler.rbs +21 -0
- data/sig/httpservlet.rbs +4 -0
- data/sig/httpstatus.rbs +255 -0
- data/sig/httputils.rbs +116 -0
- data/sig/httpversion.rbs +17 -0
- data/sig/log.rbs +93 -0
- data/sig/manifest.yaml +8 -0
- data/sig/server.rbs +57 -0
- data/sig/ssl.rbs +19 -0
- data/sig/utils.rbs +122 -0
- data/sig/version.rbs +3 -0
- data/webrick.gemspec +35 -0
- metadata +43 -8
data/sig/utils.rbs
ADDED
@@ -0,0 +1,122 @@
|
|
1
|
+
module WEBrick
|
2
|
+
module Utils
|
3
|
+
#
|
4
|
+
# Sets IO operations on +io+ to be non-blocking
|
5
|
+
def self?.set_non_blocking: (IO io) -> void
|
6
|
+
|
7
|
+
#
|
8
|
+
# Sets the close on exec flag for +io+
|
9
|
+
def self?.set_close_on_exec: (IO io) -> void
|
10
|
+
|
11
|
+
#
|
12
|
+
# Changes the process's uid and gid to the ones of +user+
|
13
|
+
def self?.su: (String user) -> void
|
14
|
+
|
15
|
+
#
|
16
|
+
# The server hostname
|
17
|
+
def self?.getservername: () -> String
|
18
|
+
|
19
|
+
#
|
20
|
+
# Creates TCP server sockets bound to +address+:+port+ and returns them.
|
21
|
+
#
|
22
|
+
# It will create IPV4 and IPV6 sockets on all interfaces.
|
23
|
+
def self?.create_listeners: (String host, Integer port) -> Array[TCPServer]
|
24
|
+
|
25
|
+
#
|
26
|
+
# Characters used to generate random strings
|
27
|
+
RAND_CHARS: String
|
28
|
+
|
29
|
+
#
|
30
|
+
# Generates a random string of length +len+
|
31
|
+
def self?.random_string: (Integer len) -> String
|
32
|
+
|
33
|
+
#
|
34
|
+
# Class used to manage timeout handlers across multiple threads.
|
35
|
+
#
|
36
|
+
# Timeout handlers should be managed by using the class methods which are
|
37
|
+
# synchronized.
|
38
|
+
#
|
39
|
+
# id = TimeoutHandler.register(10, Timeout::Error)
|
40
|
+
# begin
|
41
|
+
# sleep 20
|
42
|
+
# puts 'foo'
|
43
|
+
# ensure
|
44
|
+
# TimeoutHandler.cancel(id)
|
45
|
+
# end
|
46
|
+
#
|
47
|
+
# will raise Timeout::Error
|
48
|
+
#
|
49
|
+
# id = TimeoutHandler.register(10, Timeout::Error)
|
50
|
+
# begin
|
51
|
+
# sleep 5
|
52
|
+
# puts 'foo'
|
53
|
+
# ensure
|
54
|
+
# TimeoutHandler.cancel(id)
|
55
|
+
# end
|
56
|
+
#
|
57
|
+
# will print 'foo'
|
58
|
+
#
|
59
|
+
class TimeoutHandler
|
60
|
+
@queue: Thread::Queue
|
61
|
+
|
62
|
+
@watcher: Thread?
|
63
|
+
|
64
|
+
include Singleton
|
65
|
+
|
66
|
+
#
|
67
|
+
# Mutex used to synchronize access across threads
|
68
|
+
TimeoutMutex: Thread::Mutex
|
69
|
+
|
70
|
+
#
|
71
|
+
# Registers a new timeout handler
|
72
|
+
#
|
73
|
+
# +time+:: Timeout in seconds
|
74
|
+
# +exception+:: Exception to raise when timeout elapsed
|
75
|
+
def self.register: (Numeric seconds, singleton(Exception) exception) -> Integer
|
76
|
+
|
77
|
+
#
|
78
|
+
# Cancels the timeout handler +id+
|
79
|
+
def self.cancel: (Integer id) -> bool
|
80
|
+
|
81
|
+
def self.terminate: () -> Thread?
|
82
|
+
|
83
|
+
#
|
84
|
+
# Creates a new TimeoutHandler. You should use ::register and ::cancel
|
85
|
+
# instead of creating the timeout handler directly.
|
86
|
+
def initialize: () -> void
|
87
|
+
|
88
|
+
private
|
89
|
+
|
90
|
+
def watch: () -> bot
|
91
|
+
|
92
|
+
def watcher: () -> Thread
|
93
|
+
|
94
|
+
public
|
95
|
+
|
96
|
+
#
|
97
|
+
# Interrupts the timeout handler +id+ and raises +exception+
|
98
|
+
def interrupt: (Thread thread, Integer id, singleton(Exception) exception) -> nil
|
99
|
+
|
100
|
+
#
|
101
|
+
# Registers a new timeout handler
|
102
|
+
#
|
103
|
+
# +time+:: Timeout in seconds
|
104
|
+
# +exception+:: Exception to raise when timeout elapsed
|
105
|
+
def register: (Thread thread, Numeric time, singleton(Exception) exception) -> Integer
|
106
|
+
|
107
|
+
#
|
108
|
+
# Cancels the timeout handler +id+
|
109
|
+
def cancel: (Thread thread, Integer id) -> bool
|
110
|
+
|
111
|
+
#
|
112
|
+
def terminate: () -> Thread?
|
113
|
+
end
|
114
|
+
|
115
|
+
#
|
116
|
+
# Executes the passed block and raises +exception+ if execution takes more
|
117
|
+
# than +seconds+.
|
118
|
+
#
|
119
|
+
# If +seconds+ is zero or nil, simply executes the block
|
120
|
+
def self?.timeout: [T] (Numeric? seconds, ?singleton(Exception) exception) { (?Numeric) -> T } -> T
|
121
|
+
end
|
122
|
+
end
|
data/sig/version.rbs
ADDED
data/webrick.gemspec
CHANGED
@@ -53,6 +53,41 @@ Gem::Specification.new do |s|
|
|
53
53
|
"lib/webrick/ssl.rb",
|
54
54
|
"lib/webrick/utils.rb",
|
55
55
|
"lib/webrick/version.rb",
|
56
|
+
"sig/accesslog.rbs",
|
57
|
+
"sig/cgi.rbs",
|
58
|
+
"sig/compat.rbs",
|
59
|
+
"sig/config.rbs",
|
60
|
+
"sig/cookie.rbs",
|
61
|
+
"sig/htmlutils.rbs",
|
62
|
+
"sig/httpauth.rbs",
|
63
|
+
"sig/httpauth/authenticator.rbs",
|
64
|
+
"sig/httpauth/basicauth.rbs",
|
65
|
+
"sig/httpauth/digestauth.rbs",
|
66
|
+
"sig/httpauth/htdigest.rbs",
|
67
|
+
"sig/httpauth/htgroup.rbs",
|
68
|
+
"sig/httpauth/htpasswd.rbs",
|
69
|
+
"sig/httpauth/userdb.rbs",
|
70
|
+
"sig/httpproxy.rbs",
|
71
|
+
"sig/httprequest.rbs",
|
72
|
+
"sig/httpresponse.rbs",
|
73
|
+
"sig/https.rbs",
|
74
|
+
"sig/httpserver.rbs",
|
75
|
+
"sig/httpservlet.rbs",
|
76
|
+
"sig/httpservlet/abstract.rbs",
|
77
|
+
"sig/httpservlet/cgi_runner.rbs",
|
78
|
+
"sig/httpservlet/cgihandler.rbs",
|
79
|
+
"sig/httpservlet/erbhandler.rbs",
|
80
|
+
"sig/httpservlet/filehandler.rbs",
|
81
|
+
"sig/httpservlet/prochandler.rbs",
|
82
|
+
"sig/httpstatus.rbs",
|
83
|
+
"sig/httputils.rbs",
|
84
|
+
"sig/httpversion.rbs",
|
85
|
+
"sig/log.rbs",
|
86
|
+
"sig/manifest.yaml",
|
87
|
+
"sig/server.rbs",
|
88
|
+
"sig/ssl.rbs",
|
89
|
+
"sig/utils.rbs",
|
90
|
+
"sig/version.rbs",
|
56
91
|
"webrick.gemspec",
|
57
92
|
]
|
58
93
|
s.required_ruby_version = ">= 2.4.0"
|
metadata
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webrick
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TAKAHASHI Masayoshi
|
8
8
|
- GOTOU YUUZOU
|
9
9
|
- Eric Wong
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2024-11-01 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: WEBrick is an HTTP server toolkit that can be configured as an HTTPS
|
16
16
|
server, a proxy server, and a virtual-host server.
|
17
17
|
email:
|
18
|
-
-
|
19
|
-
-
|
18
|
+
-
|
19
|
+
-
|
20
20
|
- normal@ruby-lang.org
|
21
21
|
executables: []
|
22
22
|
extensions: []
|
@@ -61,6 +61,41 @@ files:
|
|
61
61
|
- lib/webrick/ssl.rb
|
62
62
|
- lib/webrick/utils.rb
|
63
63
|
- lib/webrick/version.rb
|
64
|
+
- sig/accesslog.rbs
|
65
|
+
- sig/cgi.rbs
|
66
|
+
- sig/compat.rbs
|
67
|
+
- sig/config.rbs
|
68
|
+
- sig/cookie.rbs
|
69
|
+
- sig/htmlutils.rbs
|
70
|
+
- sig/httpauth.rbs
|
71
|
+
- sig/httpauth/authenticator.rbs
|
72
|
+
- sig/httpauth/basicauth.rbs
|
73
|
+
- sig/httpauth/digestauth.rbs
|
74
|
+
- sig/httpauth/htdigest.rbs
|
75
|
+
- sig/httpauth/htgroup.rbs
|
76
|
+
- sig/httpauth/htpasswd.rbs
|
77
|
+
- sig/httpauth/userdb.rbs
|
78
|
+
- sig/httpproxy.rbs
|
79
|
+
- sig/httprequest.rbs
|
80
|
+
- sig/httpresponse.rbs
|
81
|
+
- sig/https.rbs
|
82
|
+
- sig/httpserver.rbs
|
83
|
+
- sig/httpservlet.rbs
|
84
|
+
- sig/httpservlet/abstract.rbs
|
85
|
+
- sig/httpservlet/cgi_runner.rbs
|
86
|
+
- sig/httpservlet/cgihandler.rbs
|
87
|
+
- sig/httpservlet/erbhandler.rbs
|
88
|
+
- sig/httpservlet/filehandler.rbs
|
89
|
+
- sig/httpservlet/prochandler.rbs
|
90
|
+
- sig/httpstatus.rbs
|
91
|
+
- sig/httputils.rbs
|
92
|
+
- sig/httpversion.rbs
|
93
|
+
- sig/log.rbs
|
94
|
+
- sig/manifest.yaml
|
95
|
+
- sig/server.rbs
|
96
|
+
- sig/ssl.rbs
|
97
|
+
- sig/utils.rbs
|
98
|
+
- sig/version.rbs
|
64
99
|
- webrick.gemspec
|
65
100
|
homepage: https://github.com/ruby/webrick
|
66
101
|
licenses:
|
@@ -68,7 +103,7 @@ licenses:
|
|
68
103
|
- BSD-2-Clause
|
69
104
|
metadata:
|
70
105
|
bug_tracker_uri: https://github.com/ruby/webrick/issues
|
71
|
-
post_install_message:
|
106
|
+
post_install_message:
|
72
107
|
rdoc_options: []
|
73
108
|
require_paths:
|
74
109
|
- lib
|
@@ -83,8 +118,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
118
|
- !ruby/object:Gem::Version
|
84
119
|
version: '0'
|
85
120
|
requirements: []
|
86
|
-
rubygems_version: 3.5.
|
87
|
-
signing_key:
|
121
|
+
rubygems_version: 3.5.11
|
122
|
+
signing_key:
|
88
123
|
specification_version: 4
|
89
124
|
summary: HTTP server toolkit
|
90
125
|
test_files: []
|