decentworks-date-support 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gem_rbs_collection/actionpack/7.2/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/actionpack/7.2/actioncontroller-7.2.rbs +14 -0
- data/.gem_rbs_collection/actionpack/7.2/actioncontroller.rbs +290 -0
- data/.gem_rbs_collection/actionpack/7.2/actiondispatch.rbs +349 -0
- data/.gem_rbs_collection/actionpack/7.2/actionpack-generated.rbs +11497 -0
- data/.gem_rbs_collection/actionpack/7.2/patch.rbs +77 -0
- data/.gem_rbs_collection/actionview/6.0/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/actionview/6.0/actionview-generated.rbs +8976 -0
- data/.gem_rbs_collection/actionview/6.0/actionview.rbs +1940 -0
- data/.gem_rbs_collection/actionview/6.0/patch.rbs +57 -0
- data/.gem_rbs_collection/activesupport/7.0/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/activesupport/7.0/activesupport-7.0.rbs +381 -0
- data/.gem_rbs_collection/activesupport/7.0/activesupport-generated.rbs +11633 -0
- data/.gem_rbs_collection/activesupport/7.0/activesupport.rbs +724 -0
- data/.gem_rbs_collection/activesupport/7.0/manifest.yaml +15 -0
- data/.gem_rbs_collection/activesupport/7.0/patch.rbs +55 -0
- data/.gem_rbs_collection/ast/2.4/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/ast/2.4/ast.rbs +73 -0
- data/.gem_rbs_collection/cgi/0.5/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/cgi/0.5/core.rbs +925 -0
- data/.gem_rbs_collection/cgi/0.5/manifest.yaml +3 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/array.rbs +4 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/atomic_reference.rbs +16 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/executor.rbs +96 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/hash.rbs +4 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/map.rbs +68 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/promises.rbs +249 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/set.rbs +4 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/timer_task.rbs +47 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/utility/processor_counter.rbs +5 -0
- data/.gem_rbs_collection/connection_pool/2.4/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/connection_pool/2.4/connection_pool.rbs +34 -0
- data/.gem_rbs_collection/connection_pool/2.4/manifest.yaml +2 -0
- data/.gem_rbs_collection/diff-lcs/1.5/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/diff-lcs/1.5/diff-lcs.rbs +11 -0
- data/.gem_rbs_collection/faker/3.4.2/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/faker/3.4.2/faker-2.23.rbs +90 -0
- data/.gem_rbs_collection/faker/3.4.2/faker.rbs +18 -0
- data/.gem_rbs_collection/i18n/1.10/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/i18n/1.10/backend.rbs +274 -0
- data/.gem_rbs_collection/i18n/1.10/i18n.rbs +116 -0
- data/.gem_rbs_collection/lint_roller/1.1/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/lint_roller/1.1/lint_roller.rbs +48 -0
- data/.gem_rbs_collection/minitest/5.25/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/abstract_reporter.rbs +52 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/assertion.rbs +17 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/assertions.rbs +590 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/backtrace_filter.rbs +23 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/bench_spec.rbs +102 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/benchmark.rbs +259 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/composite_reporter.rbs +25 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/compress.rbs +13 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/error_on_warning.rbs +3 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/expectation.rbs +2 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/expectations.rbs +21 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/guard.rbs +64 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/mock.rbs +64 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/parallel/executor.rbs +46 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/parallel/test/class_methods.rbs +5 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/parallel/test.rbs +3 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/parallel.rbs +2 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/pride_io.rbs +62 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/pride_lol.rbs +19 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/progress_reporter.rbs +11 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/reportable.rbs +53 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/reporter.rbs +5 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/result.rbs +28 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/runnable.rbs +163 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/skip.rbs +6 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/spec/dsl/instance_methods.rbs +48 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/spec/dsl.rbs +129 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/spec.rbs +11 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/statistics_reporter.rbs +81 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/summary_reporter.rbs +18 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/test/lifecycle_hooks.rbs +92 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/test.rbs +69 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/unexpected_error.rbs +12 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/unexpected_warning.rbs +6 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/unit/test_case.rbs +3 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/unit.rbs +4 -0
- data/.gem_rbs_collection/minitest/5.25/minitest.rbs +115 -0
- data/.gem_rbs_collection/nokogiri/1.11/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/nokogiri/1.11/nokogiri.rbs +2332 -0
- data/.gem_rbs_collection/nokogiri/1.11/patch.rbs +4 -0
- data/.gem_rbs_collection/parallel/1.20/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/parallel/1.20/parallel.rbs +86 -0
- data/.gem_rbs_collection/parser/3.2/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/parser/3.2/manifest.yaml +7 -0
- data/.gem_rbs_collection/parser/3.2/parser.rbs +194 -0
- data/.gem_rbs_collection/parser/3.2/polyfill.rbs +4 -0
- data/.gem_rbs_collection/rack/2.2/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/rack/2.2/manifest.yaml +3 -0
- data/.gem_rbs_collection/rack/2.2/rack.rbs +1480 -0
- data/.gem_rbs_collection/rails-dom-testing/2.0/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/rails-dom-testing/2.0/rails-dom-testing.rbs +51 -0
- data/.gem_rbs_collection/rails-html-sanitizer/1.6/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/rails-html-sanitizer/1.6/rails-html-sanitizer.rbs +53 -0
- data/.gem_rbs_collection/railties/6.0/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/railties/6.0/manifest.yaml +2 -0
- data/.gem_rbs_collection/railties/6.0/patch.rbs +17 -0
- data/.gem_rbs_collection/railties/6.0/railties-generated.rbs +4822 -0
- data/.gem_rbs_collection/railties/6.0/railties.rbs +44 -0
- data/.gem_rbs_collection/rainbow/3.0/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/rainbow/3.0/global.rbs +7 -0
- data/.gem_rbs_collection/rainbow/3.0/presenter.rbs +209 -0
- data/.gem_rbs_collection/rainbow/3.0/rainbow.rbs +5 -0
- data/.gem_rbs_collection/rake/13.0/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/rake/13.0/manifest.yaml +2 -0
- data/.gem_rbs_collection/rake/13.0/rake.rbs +39 -0
- data/.gem_rbs_collection/regexp_parser/2.8/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/regexp_parser/2.8/regexp_parser.rbs +17 -0
- data/.gem_rbs_collection/rubocop/1.57/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/rubocop/1.57/rubocop.rbs +208 -0
- data/.gem_rbs_collection/rubocop-ast/1.46/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/rubocop-ast/1.46/rubocop-ast.rbs +903 -0
- data/.gem_rbs_collection/thor/1.2/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/thor/1.2/thor.rbs +62 -0
- data/.gem_rbs_collection/tzinfo/2.0/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/tzinfo/2.0/manifest.yaml +7 -0
- data/.gem_rbs_collection/tzinfo/2.0/tzinfo.rbs +600 -0
- data/.rspec +3 -0
- data/.rubocop.yml +8 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +5 -0
- data/CODE_OF_CONDUCT.md +132 -0
- data/LICENSE +21 -0
- data/LICENSE.txt +21 -0
- data/README.md +54 -0
- data/Rakefile +12 -0
- data/Steepfile +43 -0
- data/lib/decentworks/active_support/time_with_zone_support.rb +327 -0
- data/lib/decentworks/date/support/version.rb +9 -0
- data/lib/decentworks/date_support.rb +323 -0
- data/lib/decentworks_date_support.rb +4 -0
- data/rbs_collection.lock.yaml +288 -0
- data/rbs_collection.yaml +41 -0
- data/sig/decentworks/active_support/time_with_zone_support.rbs +109 -0
- data/sig/decentworks/date/support.rbs +8 -0
- data/sig/decentworks/date_support.rbs +107 -0
- metadata +197 -0
|
@@ -0,0 +1,1480 @@
|
|
|
1
|
+
# Classes
|
|
2
|
+
module Rack
|
|
3
|
+
VERSION: [Integer, Integer]
|
|
4
|
+
RELEASE: String
|
|
5
|
+
HTTP_HOST: String
|
|
6
|
+
HTTP_PORT: String
|
|
7
|
+
HTTP_VERSION: String
|
|
8
|
+
HTTPS: String
|
|
9
|
+
PATH_INFO: String
|
|
10
|
+
REQUEST_METHOD: String
|
|
11
|
+
REQUEST_PATH: String
|
|
12
|
+
SCRIPT_NAME: String
|
|
13
|
+
QUERY_STRING: String
|
|
14
|
+
SERVER_PROTOCOL: String
|
|
15
|
+
SERVER_NAME: String
|
|
16
|
+
SERVER_PORT: String
|
|
17
|
+
CACHE_CONTROL: String
|
|
18
|
+
EXPIRES: String
|
|
19
|
+
CONTENT_LENGTH: String
|
|
20
|
+
CONTENT_TYPE: String
|
|
21
|
+
SET_COOKIE: String
|
|
22
|
+
TRANSFER_ENCODING: String
|
|
23
|
+
HTTP_COOKIE: String
|
|
24
|
+
ETAG: String
|
|
25
|
+
GET: String
|
|
26
|
+
POST: String
|
|
27
|
+
PUT: String
|
|
28
|
+
PATCH: String
|
|
29
|
+
DELETE: String
|
|
30
|
+
HEAD: String
|
|
31
|
+
OPTIONS: String
|
|
32
|
+
LINK: String
|
|
33
|
+
UNLINK: String
|
|
34
|
+
TRACE: String
|
|
35
|
+
RACK_VERSION: String
|
|
36
|
+
RACK_TEMPFILES: String
|
|
37
|
+
RACK_ERRORS: String
|
|
38
|
+
RACK_LOGGER: String
|
|
39
|
+
RACK_INPUT: String
|
|
40
|
+
RACK_SESSION: String
|
|
41
|
+
RACK_SESSION_OPTIONS: String
|
|
42
|
+
RACK_SHOWSTATUS_DETAIL: String
|
|
43
|
+
RACK_MULTITHREAD: String
|
|
44
|
+
RACK_MULTIPROCESS: String
|
|
45
|
+
RACK_RUNONCE: String
|
|
46
|
+
RACK_URL_SCHEME: String
|
|
47
|
+
RACK_HIJACK: String
|
|
48
|
+
RACK_IS_HIJACK: String
|
|
49
|
+
RACK_HIJACK_IO: String
|
|
50
|
+
RACK_RECURSIVE_INCLUDE: String
|
|
51
|
+
RACK_MULTIPART_BUFFER_SIZE: String
|
|
52
|
+
RACK_MULTIPART_TEMPFILE_FACTORY: String
|
|
53
|
+
RACK_REQUEST_FORM_INPUT: String
|
|
54
|
+
RACK_REQUEST_FORM_HASH: String
|
|
55
|
+
RACK_REQUEST_FORM_VARS: String
|
|
56
|
+
RACK_REQUEST_COOKIE_HASH: String
|
|
57
|
+
RACK_REQUEST_COOKIE_STRING: String
|
|
58
|
+
RACK_REQUEST_QUERY_HASH: String
|
|
59
|
+
RACK_REQUEST_QUERY_STRING: String
|
|
60
|
+
RACK_METHODOVERRIDE_ORIGINAL_METHOD: String
|
|
61
|
+
RACK_SESSION_UNPACKED_COOKIE_DATA: String
|
|
62
|
+
|
|
63
|
+
def self.version: () -> String
|
|
64
|
+
def self.release: () -> String
|
|
65
|
+
|
|
66
|
+
type env = Hash[String, untyped]
|
|
67
|
+
|
|
68
|
+
type string_body = _ToStr
|
|
69
|
+
|
|
70
|
+
type enumerable_body = _Each[String]
|
|
71
|
+
|
|
72
|
+
interface _StreamingBody
|
|
73
|
+
def call: (untyped stream) -> void
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
type response = [_ToI, _Each[[String, String]], string_body | enumerable_body | _StreamingBody]
|
|
77
|
+
|
|
78
|
+
interface _Application
|
|
79
|
+
def call: (env) -> response
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
class Lobster
|
|
83
|
+
include _Application
|
|
84
|
+
|
|
85
|
+
LobsterString: String
|
|
86
|
+
LambdaLobster: ^(env) -> [Integer, Hash[String, String], Array[String]]
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
module Auth
|
|
90
|
+
module Digest
|
|
91
|
+
class Nonce
|
|
92
|
+
def self.parse: (untyped string) -> Nonce
|
|
93
|
+
def initialize: (?Time timestamp, ?nil given_digest) -> void
|
|
94
|
+
def to_s: () -> untyped
|
|
95
|
+
def digest: () -> untyped
|
|
96
|
+
def valid?: () -> untyped
|
|
97
|
+
def stale?: () -> bool
|
|
98
|
+
def fresh?: () -> bool
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
class Params < Hash[untyped, untyped]
|
|
102
|
+
UNQUOTED: [String, String]
|
|
103
|
+
|
|
104
|
+
def self.parse: (untyped str) -> Hash[untyped, untyped]
|
|
105
|
+
def self.dequote: (untyped str) -> String?
|
|
106
|
+
def self.split_header_value: (untyped str) -> untyped
|
|
107
|
+
def initialize: () ?{ (Params) -> Hash[bot, bot] } -> void
|
|
108
|
+
def []: (untyped k) -> untyped
|
|
109
|
+
def []=: (String k, String? v) -> untyped
|
|
110
|
+
def to_s: () -> String
|
|
111
|
+
def quote: (untyped str) -> String
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
class MD5 < AbstractHandler
|
|
115
|
+
QOP: String
|
|
116
|
+
|
|
117
|
+
attr_accessor opaque: nil
|
|
118
|
+
attr_writer passwords_hashed: nil
|
|
119
|
+
def initialize: (untyped app, ?nil realm, ?nil opaque) -> void
|
|
120
|
+
def passwords_hashed?: () -> bool
|
|
121
|
+
def call: (untyped env) -> [Integer, Hash[String, String], Array[bot]]
|
|
122
|
+
|
|
123
|
+
private
|
|
124
|
+
|
|
125
|
+
def params: (?Hash[bot, bot] hash) -> Params
|
|
126
|
+
def challenge: (?Hash[bot, bot] hash) -> String
|
|
127
|
+
def valid?: (Request auth) -> bool
|
|
128
|
+
def valid_qop?: (Request auth) -> bool
|
|
129
|
+
def valid_opaque?: (Request auth) -> untyped
|
|
130
|
+
def valid_nonce?: (Request auth) -> untyped
|
|
131
|
+
def valid_digest?: (Request auth) -> bool
|
|
132
|
+
def md5: (String? data) -> untyped
|
|
133
|
+
alias H md5
|
|
134
|
+
def KD: (untyped secret, String data) -> untyped
|
|
135
|
+
def A1: (Request auth, untyped password) -> String
|
|
136
|
+
def A2: (Request auth) -> String
|
|
137
|
+
def digest: (Request auth, untyped password) -> untyped
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
class Request < AbstractRequest
|
|
141
|
+
def method: () -> untyped
|
|
142
|
+
def digest?: () -> bool
|
|
143
|
+
def correct_uri?: () -> bool
|
|
144
|
+
def nonce: () -> Nonce
|
|
145
|
+
def params: () -> Hash[untyped, untyped]
|
|
146
|
+
def respond_to?: (untyped sym, *untyped _2) -> bool
|
|
147
|
+
def method_missing: (:cnonce | :nc | :opaque | :qop | :realm | :response | :uri | :username sym, *bot args) -> untyped
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
class Basic
|
|
152
|
+
def call: (untyped env) -> untyped
|
|
153
|
+
|
|
154
|
+
private
|
|
155
|
+
|
|
156
|
+
def challenge: () -> String
|
|
157
|
+
def valid?: (Request auth) -> untyped
|
|
158
|
+
|
|
159
|
+
class Request
|
|
160
|
+
def basic?: () -> false
|
|
161
|
+
def credentials: () -> untyped
|
|
162
|
+
def username: () -> untyped
|
|
163
|
+
end
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
class AbstractRequest
|
|
167
|
+
AUTHORIZATION_KEYS: [String, String, String]
|
|
168
|
+
|
|
169
|
+
def initialize: (untyped env) -> void
|
|
170
|
+
def request: () -> Request
|
|
171
|
+
def provided?: () -> false
|
|
172
|
+
def valid?: () -> untyped
|
|
173
|
+
def parts: () -> untyped
|
|
174
|
+
def scheme: () -> untyped
|
|
175
|
+
def params: () -> untyped
|
|
176
|
+
|
|
177
|
+
private
|
|
178
|
+
|
|
179
|
+
def authorization_key: () -> String?
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
class AbstractHandler
|
|
183
|
+
attr_accessor realm: nil
|
|
184
|
+
def initialize: (untyped app, ?nil realm) -> void
|
|
185
|
+
|
|
186
|
+
private
|
|
187
|
+
|
|
188
|
+
def unauthorized: (?String www_authenticate) -> [Integer, Hash[String, String], Array[bot]]
|
|
189
|
+
def bad_request: () -> [Integer, Hash[String, String], Array[bot]]
|
|
190
|
+
end
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
module Session
|
|
194
|
+
class SessionId
|
|
195
|
+
ID_VERSION: Integer
|
|
196
|
+
|
|
197
|
+
attr_reader public_id: Cookie::Base64::Marshal | Integer | SessionId | String | true
|
|
198
|
+
def initialize: (Cookie::Base64::Marshal | Integer | SessionId | String | true public_id) -> void
|
|
199
|
+
def private_id: () -> String
|
|
200
|
+
alias cookie_value public_id
|
|
201
|
+
alias to_s public_id
|
|
202
|
+
def empty?: () -> false
|
|
203
|
+
def inspect: () -> String
|
|
204
|
+
|
|
205
|
+
private
|
|
206
|
+
|
|
207
|
+
def hash_sid: (Cookie::Base64::Marshal | Integer | SessionId | String | true sid) -> untyped
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
module Abstract
|
|
211
|
+
class SessionHash
|
|
212
|
+
Unspecified: Object
|
|
213
|
+
include Enumerable[[String, untyped]]
|
|
214
|
+
|
|
215
|
+
attr_writer id: (Cookie::Base64::Marshal | Integer | String | bool)?
|
|
216
|
+
def self.find: (untyped req) -> untyped
|
|
217
|
+
def self.set: (untyped req, untyped session) -> untyped
|
|
218
|
+
def self.set_options: (untyped req, untyped options) -> untyped
|
|
219
|
+
def initialize: (Persisted store, Request req) -> void
|
|
220
|
+
def id: () -> (Cookie::Base64::Marshal | Integer | String | bool)?
|
|
221
|
+
def options: () -> String?
|
|
222
|
+
def each: () { ([String, untyped]) -> void } -> void
|
|
223
|
+
| () -> Enumerator[untyped, untyped]
|
|
224
|
+
def []: (String key) -> nil
|
|
225
|
+
def dig: (untyped key, *untyped keys) -> untyped
|
|
226
|
+
def fetch: (untyped key, ?Object default) -> Object
|
|
227
|
+
def has_key?: (untyped key) -> bool
|
|
228
|
+
alias key? has_key?
|
|
229
|
+
alias include? has_key?
|
|
230
|
+
def []=: (untyped key, untyped value) -> untyped
|
|
231
|
+
alias store []=
|
|
232
|
+
def clear: () -> Hash[untyped, untyped]
|
|
233
|
+
def destroy: () -> untyped
|
|
234
|
+
def to_hash: () -> Hash[untyped, untyped]
|
|
235
|
+
def update: (String hash) -> untyped
|
|
236
|
+
alias merge! update
|
|
237
|
+
def replace: (untyped hash) -> untyped
|
|
238
|
+
def delete: (untyped key) -> nil
|
|
239
|
+
def inspect: () -> String
|
|
240
|
+
def exists?: () -> nil
|
|
241
|
+
def loaded?: () -> bool?
|
|
242
|
+
def empty?: () -> bool
|
|
243
|
+
def keys: () -> Array[untyped]
|
|
244
|
+
def values: () -> Array[untyped]
|
|
245
|
+
|
|
246
|
+
private
|
|
247
|
+
|
|
248
|
+
def load_for_read!: () -> true?
|
|
249
|
+
def load_for_write!: () -> true?
|
|
250
|
+
def load!: () -> true
|
|
251
|
+
def stringify_keys: (String other) -> Hash[bot, bot]
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
class Persisted
|
|
255
|
+
DEFAULT_OPTIONS: {key: String, path: String, domain: nil, expire_after: nil, secure: false, httponly: true, defer: false, renew: false, sidbits: Integer, cookie_only: true, secure_random: untyped}
|
|
256
|
+
attr_reader key: (Cookie::Base64::Marshal | Integer | String | bool)?
|
|
257
|
+
attr_reader default_options: {coder: (Cookie::Base64::Marshal | Integer | String | bool)?, key: (Cookie::Base64::Marshal | Integer | String | bool)?, path: (Cookie::Base64::Marshal | Integer | String | bool)?, domain: (Cookie::Base64::Marshal | Integer | String | bool)?, expire_after: (Cookie::Base64::Marshal | Integer | String | bool)?, secure: (Cookie::Base64::Marshal | Integer | String | bool)?, httponly: (Cookie::Base64::Marshal | Integer | String | bool)?, defer: (Cookie::Base64::Marshal | Integer | String | bool)?, renew: (Cookie::Base64::Marshal | Integer | String | bool)?, sidbits: (Cookie::Base64::Marshal | Integer | String | bool)?, cookie_only: (Cookie::Base64::Marshal | Integer | String | bool)?, secure_random: (Cookie::Base64::Marshal | Integer | String | bool)?}
|
|
258
|
+
attr_reader sid_secure: (Cookie::Base64::Marshal | Integer | String | bool)?
|
|
259
|
+
def initialize: (untyped app, ?{coder: Cookie::Base64::Marshal} options) -> void
|
|
260
|
+
def call: (untyped env) -> [untyped, untyped, untyped]
|
|
261
|
+
def context: (untyped env, ?untyped app) -> [untyped, untyped, untyped]
|
|
262
|
+
|
|
263
|
+
private
|
|
264
|
+
|
|
265
|
+
def make_request: (untyped env) -> Request
|
|
266
|
+
def initialize_sid: () -> Integer
|
|
267
|
+
def generate_sid: (?(Cookie::Base64::Marshal | Integer | String | bool)? secure) -> (SessionId | String)
|
|
268
|
+
def prepare_session: (Request req) -> nil
|
|
269
|
+
def load_session: (Request? req) -> bot
|
|
270
|
+
def extract_session_id: (Request? request) -> (Cookie::Base64::Marshal | Integer | String | bool)?
|
|
271
|
+
def current_session_id: (Request? req) -> untyped
|
|
272
|
+
def session_exists?: (Request? req) -> untyped
|
|
273
|
+
def commit_session?: (Request req, String? session, untyped options) -> bool?
|
|
274
|
+
def loaded_session?: (String? session) -> true
|
|
275
|
+
def forced_session_update?: (String? session, untyped options) -> bool?
|
|
276
|
+
def force_options?: (untyped options) -> untyped
|
|
277
|
+
def security_matches?: (Request request, untyped options) -> bool
|
|
278
|
+
|
|
279
|
+
public
|
|
280
|
+
|
|
281
|
+
def commit_session: (Request req, Response::Raw res) -> String?
|
|
282
|
+
|
|
283
|
+
private
|
|
284
|
+
|
|
285
|
+
def cookie_value: (bot data) -> bot
|
|
286
|
+
def set_cookie: (Request request, Response::Raw res, {value: bot, expires: Time, same_site: (Cookie::Base64::Marshal | Integer | String | bool)?} cookie) -> String?
|
|
287
|
+
def session_class: () -> singleton(SessionHash)
|
|
288
|
+
def find_session: (Request? env, untyped sid) -> bot
|
|
289
|
+
def write_session: (Request req, untyped sid, untyped session, untyped options) -> bot
|
|
290
|
+
def delete_session: (Request req, (Cookie::Base64::Marshal | Integer | SessionId | String | bool)? sid, String? options) -> bot
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
class PersistedSecure < Persisted
|
|
294
|
+
def generate_sid: (*false _3) -> SessionId
|
|
295
|
+
def extract_session_id: (*untyped _3) -> (SessionId | false)?
|
|
296
|
+
|
|
297
|
+
private
|
|
298
|
+
|
|
299
|
+
def session_class: () -> singleton(SecureSessionHash)
|
|
300
|
+
def cookie_value: (untyped data) -> untyped
|
|
301
|
+
|
|
302
|
+
class SecureSessionHash < SessionHash
|
|
303
|
+
def []: (untyped key) -> nil
|
|
304
|
+
end
|
|
305
|
+
end
|
|
306
|
+
|
|
307
|
+
class ID < Persisted
|
|
308
|
+
def self.inherited: (untyped klass) -> untyped
|
|
309
|
+
def find_session: (untyped req, untyped sid) -> untyped
|
|
310
|
+
def write_session: (untyped req, untyped sid, untyped session, untyped options) -> untyped
|
|
311
|
+
def delete_session: (untyped req, untyped sid, untyped options) -> untyped
|
|
312
|
+
end
|
|
313
|
+
end
|
|
314
|
+
|
|
315
|
+
class Pool < Abstract::PersistedSecure
|
|
316
|
+
DEFAULT_OPTIONS: untyped
|
|
317
|
+
|
|
318
|
+
attr_reader mutex: Thread::Mutex
|
|
319
|
+
attr_reader pool: Hash[bot, bot]
|
|
320
|
+
def initialize: (untyped app, ?Hash[bot, bot] options) -> void
|
|
321
|
+
def generate_sid: () -> untyped
|
|
322
|
+
def find_session: (untyped req, untyped sid) -> [untyped, Hash[bot, bot]?]?
|
|
323
|
+
def write_session: (untyped req, untyped session_id, untyped new_session, untyped options) -> [untyped, Hash[bot, bot]?]?
|
|
324
|
+
def delete_session: (untyped req, untyped session_id, untyped options) -> [untyped, Hash[bot, bot]?]?
|
|
325
|
+
def with_lock: (untyped req) { () -> [untyped, Hash[bot, bot]?]? } -> [untyped, Hash[bot, bot]?]?
|
|
326
|
+
|
|
327
|
+
private
|
|
328
|
+
|
|
329
|
+
def get_session_with_fallback: (untyped sid) -> nil
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
class Cookie < Abstract::PersistedSecure
|
|
333
|
+
attr_reader coder: Base64::Marshal
|
|
334
|
+
def initialize: (untyped app, ?Hash[bot, bot] options) -> void
|
|
335
|
+
|
|
336
|
+
private
|
|
337
|
+
|
|
338
|
+
def find_session: (untyped req, untyped sid) -> [SessionId, Hash[String, SessionId]]
|
|
339
|
+
def extract_session_id: (untyped request) -> untyped
|
|
340
|
+
def unpacked_cookie_data: (untyped request) -> untyped
|
|
341
|
+
def persistent_session_id!: (untyped data, ?nil sid) -> Hash[String, SessionId]
|
|
342
|
+
def write_session: (untyped req, untyped session_id, untyped session, untyped options) -> SessionId?
|
|
343
|
+
def delete_session: (untyped req, untyped session_id, untyped options) -> SessionId?
|
|
344
|
+
def digest_match?: (untyped data, untyped digest) -> bool?
|
|
345
|
+
def generate_hmac: (untyped data, nil secret) -> untyped
|
|
346
|
+
def secure?: (Hash[bot, bot] options) -> true?
|
|
347
|
+
|
|
348
|
+
class Base64
|
|
349
|
+
def encode: (Object str) -> untyped
|
|
350
|
+
def decode: (untyped str) -> untyped
|
|
351
|
+
|
|
352
|
+
class Marshal < Base64
|
|
353
|
+
def encode: (untyped str) -> untyped
|
|
354
|
+
def decode: (nil str) -> Object?
|
|
355
|
+
end
|
|
356
|
+
|
|
357
|
+
class JSON < Base64
|
|
358
|
+
def encode: (untyped obj) -> untyped
|
|
359
|
+
def decode: (untyped str) -> nil
|
|
360
|
+
end
|
|
361
|
+
|
|
362
|
+
class ZipJSON < Base64
|
|
363
|
+
def encode: (untyped obj) -> untyped
|
|
364
|
+
def decode: (untyped str) -> nil
|
|
365
|
+
end
|
|
366
|
+
end
|
|
367
|
+
|
|
368
|
+
class Identity
|
|
369
|
+
def encode: (untyped str) -> untyped
|
|
370
|
+
def decode: (untyped str) -> untyped
|
|
371
|
+
end
|
|
372
|
+
|
|
373
|
+
class SessionId
|
|
374
|
+
attr_reader cookie_value: untyped
|
|
375
|
+
def initialize: (untyped session_id, untyped cookie_value) -> void
|
|
376
|
+
end
|
|
377
|
+
end
|
|
378
|
+
end
|
|
379
|
+
|
|
380
|
+
class Builder
|
|
381
|
+
UTF_8_BOM: String
|
|
382
|
+
include _Application
|
|
383
|
+
|
|
384
|
+
def self.parse_file: (String config, ?Server::Options opts) -> [bot, Hash[Symbol, untyped]]
|
|
385
|
+
def self.load_file: (String config, ?Server::Options opts) -> [_Application, Hash[Symbol, untyped]]
|
|
386
|
+
def self.new_from_string: (String builder_script, ?String file) -> _Application
|
|
387
|
+
def initialize: (?_Application? default_app) ?{ (self) -> void } -> void
|
|
388
|
+
def self.app: (?_Application? default_app) ?{ (self) -> void } -> _Application
|
|
389
|
+
def use: (Class middleware, *untyped args, **untyped kwargs) ?{ (*untyped) -> void } -> void
|
|
390
|
+
def run: (_Application app) -> _Application
|
|
391
|
+
def warmup: (?(^(_Application) -> void)?) ?{ (_Application) -> void } -> (^(_Application) -> void)?
|
|
392
|
+
def map: (String path) { (Builder) -> void } -> ^(Builder) -> void
|
|
393
|
+
def freeze_app: () -> true
|
|
394
|
+
def to_app: () -> _Application
|
|
395
|
+
|
|
396
|
+
private
|
|
397
|
+
|
|
398
|
+
def generate_map: (_Application? default_app, Hash[String, ^(Builder) -> void] mapping) -> URLMap
|
|
399
|
+
end
|
|
400
|
+
|
|
401
|
+
class BodyProxy
|
|
402
|
+
def initialize: (untyped? body) ?{ () -> void } -> void
|
|
403
|
+
|
|
404
|
+
def close: () -> nil
|
|
405
|
+
|
|
406
|
+
def closed?: () -> bool
|
|
407
|
+
|
|
408
|
+
def respond_to_missing?: (Symbol, ?bool include_all) -> bool
|
|
409
|
+
|
|
410
|
+
def method_missing: (Symbol, *untyped args, **untyped kwargs) ?{ () -> untyped } -> untyped
|
|
411
|
+
end
|
|
412
|
+
|
|
413
|
+
class Cascade
|
|
414
|
+
NotFound: [Integer, Hash[String, String], Array[bot]]
|
|
415
|
+
|
|
416
|
+
attr_reader apps: Array[untyped]
|
|
417
|
+
def initialize: (untyped apps, ?[Integer, Integer] cascade_for) -> void
|
|
418
|
+
def call: (untyped env) -> [Integer, Hash[String, String], Array[bot]]?
|
|
419
|
+
def add: (untyped app) -> Array[untyped]
|
|
420
|
+
def include?: (untyped app) -> bool
|
|
421
|
+
end
|
|
422
|
+
|
|
423
|
+
class CommonLogger
|
|
424
|
+
FORMAT: String
|
|
425
|
+
|
|
426
|
+
# TODO: This method may receive Adapter::Rails and Thin::Stats::Adapter too?
|
|
427
|
+
def initialize: ((CommonLogger | Files | Integer | String | URLMap | {chdir: String, environment: String, address: String, port: Integer, timeout: Integer, log: String, pid: String, max_conns: Integer, max_persistent_conns: Integer, require: Array[bot], wait: Integer, threadpool_size: Integer, rackup: bot, backend: untyped})? app, ?nil logger) -> void
|
|
428
|
+
def call: (untyped env) -> [Integer | String, Hash[String, String] | Utils::HeaderHash, BodyProxy]
|
|
429
|
+
|
|
430
|
+
private
|
|
431
|
+
|
|
432
|
+
def log: (untyped env, untyped status, Hash[bot, bot] | Utils::HeaderHash header, Float | Integer began_at) -> untyped
|
|
433
|
+
def extract_content_length: (Hash[bot, bot] | Utils::HeaderHash headers) -> String?
|
|
434
|
+
end
|
|
435
|
+
|
|
436
|
+
class ConditionalGet
|
|
437
|
+
def initialize: (untyped app) -> void
|
|
438
|
+
def call: (untyped env) -> [Integer, Hash[String, String] | Utils::HeaderHash, BodyProxy]
|
|
439
|
+
|
|
440
|
+
private
|
|
441
|
+
|
|
442
|
+
def fresh?: (untyped env, Hash[String, String] | Utils::HeaderHash headers) -> bool?
|
|
443
|
+
def etag_matches?: (untyped none_match, Hash[String, String] | Utils::HeaderHash headers) -> bool
|
|
444
|
+
def modified_since?: (Time? modified_since, Hash[String, String] | Utils::HeaderHash headers) -> bool?
|
|
445
|
+
def to_rfc2822: (String? since) -> Time?
|
|
446
|
+
end
|
|
447
|
+
|
|
448
|
+
class Config
|
|
449
|
+
include _Application
|
|
450
|
+
|
|
451
|
+
def initialize: (_Application app) { (env) -> void } -> void
|
|
452
|
+
end
|
|
453
|
+
|
|
454
|
+
class ContentLength
|
|
455
|
+
def initialize: (untyped app) -> void
|
|
456
|
+
def call: (Hash[String?, (Integer | String | true)?] env) -> [untyped, untyped, BodyProxy]
|
|
457
|
+
end
|
|
458
|
+
|
|
459
|
+
class ContentType
|
|
460
|
+
def initialize: (untyped app, ?String content_type) -> void
|
|
461
|
+
def call: (untyped env) -> [untyped, Hash[String, String] | Utils::HeaderHash, untyped]
|
|
462
|
+
end
|
|
463
|
+
|
|
464
|
+
class Events
|
|
465
|
+
def initialize: (untyped app, untyped handlers) -> void
|
|
466
|
+
def call: (untyped env) -> [untyped, untyped, EventedBodyProxy]
|
|
467
|
+
|
|
468
|
+
private
|
|
469
|
+
|
|
470
|
+
def on_error: (Request request, nil response, nil e) -> untyped
|
|
471
|
+
def on_commit: (Request request, BufferedResponse response) -> untyped
|
|
472
|
+
def on_start: (Request request, nil response) -> untyped
|
|
473
|
+
def on_finish: (Request request, nil response) -> untyped
|
|
474
|
+
def make_request: (untyped env) -> Request
|
|
475
|
+
def make_response: (untyped status, untyped headers, untyped body) -> BufferedResponse
|
|
476
|
+
|
|
477
|
+
module Abstract
|
|
478
|
+
def on_start: (untyped req, untyped res) -> nil
|
|
479
|
+
def on_commit: (untyped req, untyped res) -> nil
|
|
480
|
+
def on_send: (untyped req, untyped res) -> nil
|
|
481
|
+
def on_finish: (untyped req, untyped res) -> nil
|
|
482
|
+
def on_error: (untyped req, untyped res, untyped e) -> nil
|
|
483
|
+
end
|
|
484
|
+
|
|
485
|
+
class EventedBodyProxy < BodyProxy
|
|
486
|
+
attr_reader request: Request
|
|
487
|
+
attr_reader response: BufferedResponse?
|
|
488
|
+
def initialize: (nil body, Request request, BufferedResponse? response, untyped handlers) ?{ () -> untyped } -> void
|
|
489
|
+
def each: () -> untyped
|
|
490
|
+
end
|
|
491
|
+
|
|
492
|
+
class BufferedResponse
|
|
493
|
+
attr_reader body: untyped
|
|
494
|
+
def initialize: (untyped status, untyped headers, untyped body) -> void
|
|
495
|
+
def to_a: () -> [untyped, untyped, untyped]
|
|
496
|
+
end
|
|
497
|
+
end
|
|
498
|
+
|
|
499
|
+
class Files
|
|
500
|
+
ALLOWED_VERBS: [String, String, String]
|
|
501
|
+
ALLOW_HEADER: String
|
|
502
|
+
MULTIPART_BOUNDARY: String
|
|
503
|
+
|
|
504
|
+
def self.method_added: (untyped name) -> untyped
|
|
505
|
+
attr_reader root: String?
|
|
506
|
+
def initialize: (String? root, ?Hash[bot, bot] headers, ?String default_mime) -> void
|
|
507
|
+
def call: (untyped env) -> [untyped, untyped, BodyProxy]
|
|
508
|
+
def get: (nil env) -> [Integer, Hash[String, String], (Array[String] | BaseIterator | Iterator)?]
|
|
509
|
+
def serving: (Request request, String path) -> [Integer, Hash[String, String], (Array[String] | BaseIterator | Iterator)?]
|
|
510
|
+
|
|
511
|
+
private
|
|
512
|
+
|
|
513
|
+
def fail: (Integer status, String body, ?Hash[String, String] headers) -> [Integer, Hash[String, String], [String]]
|
|
514
|
+
def mime_type: (String path, String default_mime) -> String
|
|
515
|
+
def filesize: (String path) -> Integer
|
|
516
|
+
|
|
517
|
+
class BaseIterator
|
|
518
|
+
attr_reader path: untyped
|
|
519
|
+
attr_reader ranges: untyped
|
|
520
|
+
attr_reader options: untyped
|
|
521
|
+
def initialize: (untyped path, untyped ranges, untyped options) -> void
|
|
522
|
+
def each: () -> nil
|
|
523
|
+
def bytesize: () -> untyped
|
|
524
|
+
def close: () -> nil
|
|
525
|
+
|
|
526
|
+
private
|
|
527
|
+
|
|
528
|
+
def multipart?: () -> untyped
|
|
529
|
+
def multipart_heading: (untyped range) -> String
|
|
530
|
+
def each_range_part: (File file, untyped range) ?{ (String) -> untyped } -> nil
|
|
531
|
+
end
|
|
532
|
+
|
|
533
|
+
class Iterator < BaseIterator
|
|
534
|
+
alias to_path path
|
|
535
|
+
end
|
|
536
|
+
end
|
|
537
|
+
|
|
538
|
+
class Chunked
|
|
539
|
+
def initialize: (untyped app) -> void
|
|
540
|
+
def chunkable_version?: (untyped ver) -> bool
|
|
541
|
+
def call: (untyped env) -> [untyped, untyped, Body | TrailerBody]
|
|
542
|
+
|
|
543
|
+
class Body
|
|
544
|
+
TERM: String
|
|
545
|
+
TAIL: String
|
|
546
|
+
|
|
547
|
+
def initialize: (untyped body) -> void
|
|
548
|
+
def each: () -> untyped
|
|
549
|
+
def close: () -> nil
|
|
550
|
+
|
|
551
|
+
private
|
|
552
|
+
|
|
553
|
+
def yield_trailers: () -> nil
|
|
554
|
+
end
|
|
555
|
+
|
|
556
|
+
class TrailerBody < Body
|
|
557
|
+
private
|
|
558
|
+
|
|
559
|
+
def yield_trailers: () -> untyped
|
|
560
|
+
end
|
|
561
|
+
end
|
|
562
|
+
|
|
563
|
+
class Deflater
|
|
564
|
+
def initialize: (untyped app, ?Hash[bot, bot] options) -> void
|
|
565
|
+
def call: (untyped env) -> [Integer, Hash[String, String] | Utils::HeaderHash, BodyProxy | GzipStream]?
|
|
566
|
+
|
|
567
|
+
private
|
|
568
|
+
|
|
569
|
+
def should_deflate?: (untyped env, untyped status, Hash[String, String] | Utils::HeaderHash headers, untyped body) -> bool
|
|
570
|
+
|
|
571
|
+
class GzipStream
|
|
572
|
+
def initialize: (untyped body, Integer mtime, true sync) -> void
|
|
573
|
+
def each: () -> untyped
|
|
574
|
+
def write: (untyped data) -> untyped
|
|
575
|
+
def close: () -> nil
|
|
576
|
+
end
|
|
577
|
+
end
|
|
578
|
+
|
|
579
|
+
class Directory
|
|
580
|
+
DIR_FILE: String
|
|
581
|
+
DIR_PAGE_HEADER: String
|
|
582
|
+
DIR_PAGE_FOOTER: String
|
|
583
|
+
FILESIZE_FORMAT: [[String, Integer], [String, Integer], [String, Integer], [String, Integer]]
|
|
584
|
+
|
|
585
|
+
attr_reader root: String
|
|
586
|
+
def initialize: (untyped root, ?nil app) -> void
|
|
587
|
+
def call: (untyped env) -> [untyped, untyped, BodyProxy]
|
|
588
|
+
def get: (untyped env) -> [Integer, Hash[String, String], BodyProxy | DirectoryBody | [String]]?
|
|
589
|
+
def check_bad_request: (untyped path_info) -> [Integer, Hash[String, String], [String]]?
|
|
590
|
+
def check_forbidden: (untyped path_info) -> [Integer, Hash[String, String], [String]]?
|
|
591
|
+
def list_directory: (untyped path_info, String path, untyped script_name) -> [Integer, Hash[String, String], DirectoryBody]
|
|
592
|
+
def stat: (String path) -> File::Stat?
|
|
593
|
+
def list_path: (untyped env, String path, untyped path_info, untyped script_name) -> [Integer, Hash[String, String], BodyProxy | DirectoryBody | [String]]
|
|
594
|
+
def entity_not_found: (untyped path_info) -> [Integer, Hash[String, String], [String]]
|
|
595
|
+
def filesize_format: (Integer int) -> String
|
|
596
|
+
|
|
597
|
+
class DirectoryBody
|
|
598
|
+
attr_accessor root(): untyped
|
|
599
|
+
attr_accessor path(): untyped
|
|
600
|
+
attr_accessor files(): untyped
|
|
601
|
+
|
|
602
|
+
def each: () -> untyped
|
|
603
|
+
|
|
604
|
+
private
|
|
605
|
+
|
|
606
|
+
def DIR_FILE_escape: ([String, String, String, String, String]? htmls) -> Array[untyped]
|
|
607
|
+
end
|
|
608
|
+
end
|
|
609
|
+
|
|
610
|
+
class ForwardRequest < Exception
|
|
611
|
+
attr_reader url: untyped
|
|
612
|
+
attr_reader env: Hash[String, untyped]
|
|
613
|
+
def initialize: (untyped url, ?Hash[bot, bot] env) -> void
|
|
614
|
+
end
|
|
615
|
+
|
|
616
|
+
class Recursive
|
|
617
|
+
def initialize: (untyped app) -> void
|
|
618
|
+
def call: (untyped env) -> untyped
|
|
619
|
+
def _call: (untyped env) -> untyped
|
|
620
|
+
def include: (untyped env, untyped path) -> untyped
|
|
621
|
+
end
|
|
622
|
+
|
|
623
|
+
module Handler
|
|
624
|
+
SERVER_NAMES: [String, String, String, String]
|
|
625
|
+
|
|
626
|
+
def self.get: (String? server) -> nil
|
|
627
|
+
def self.pick: ([String, String, String, String] server_names) -> nil
|
|
628
|
+
def self.default: () -> (singleton(CGI) | singleton(FastCGI))?
|
|
629
|
+
def self.try_require: (String prefix, String const_name) -> nil
|
|
630
|
+
# TODO: klass may be of type singleton(Thin)
|
|
631
|
+
def self.register: (:thin | String server, String klass) -> String
|
|
632
|
+
|
|
633
|
+
class CGI
|
|
634
|
+
def self.run: (ContentLength | Lint | ShowExceptions | TempfileReaper app, **(Array[bot] | Integer | String)?) -> untyped
|
|
635
|
+
def self.serve: (ContentLength | Lint | ShowExceptions | TempfileReaper app) -> untyped
|
|
636
|
+
def self.send_headers: (Integer status, Hash[String, String?] headers) -> IO
|
|
637
|
+
def self.send_body: (BodyProxy | Lint | [String?] body) -> untyped
|
|
638
|
+
end
|
|
639
|
+
|
|
640
|
+
class WEBrick
|
|
641
|
+
def self.run: (untyped app, **untyped) -> untyped
|
|
642
|
+
def self.valid_options: () -> Hash[String, String]
|
|
643
|
+
def self.shutdown: () -> nil
|
|
644
|
+
def initialize: (untyped server, untyped app) -> void
|
|
645
|
+
def service: (untyped req, untyped res) -> untyped
|
|
646
|
+
end
|
|
647
|
+
|
|
648
|
+
class LSWS
|
|
649
|
+
def self.run: (untyped app, **untyped) -> nil
|
|
650
|
+
def self.serve: (untyped app) -> untyped
|
|
651
|
+
def self.send_headers: (untyped status, untyped headers) -> IO
|
|
652
|
+
def self.send_body: (untyped body) -> untyped
|
|
653
|
+
end
|
|
654
|
+
|
|
655
|
+
class SCGI
|
|
656
|
+
attr_accessor app: nil
|
|
657
|
+
def self.run: (untyped app, **untyped) -> untyped
|
|
658
|
+
def self.valid_options: () -> Hash[String, String]
|
|
659
|
+
def initialize: (?Hash[bot, bot] settings) -> void
|
|
660
|
+
def process_request: (untyped request, untyped input_body, untyped socket) -> untyped
|
|
661
|
+
end
|
|
662
|
+
|
|
663
|
+
class FastCGI
|
|
664
|
+
def self.run: (ContentLength | Lint | ShowExceptions | TempfileReaper app, **(Array[bot] | Integer | String)?) -> bot
|
|
665
|
+
def self.valid_options: () -> Hash[String, String]
|
|
666
|
+
# TODO: request is of type FCGI::Request
|
|
667
|
+
def self.serve: (untyped request, ContentLength | Lint | ShowExceptions | TempfileReaper app) -> untyped
|
|
668
|
+
def self.send_headers: (StringIO `out`, Integer status, Hash[String, String?] headers) -> StringIO
|
|
669
|
+
def self.send_body: (StringIO `out`, BodyProxy | Lint | [String?] body) -> untyped
|
|
670
|
+
end
|
|
671
|
+
end
|
|
672
|
+
|
|
673
|
+
class Head
|
|
674
|
+
def initialize: (Method | Proc app) -> void
|
|
675
|
+
def call: (untyped env) -> [untyped, untyped, BodyProxy]
|
|
676
|
+
end
|
|
677
|
+
|
|
678
|
+
class Lint
|
|
679
|
+
include Assertion
|
|
680
|
+
|
|
681
|
+
def initialize: (untyped app) -> void
|
|
682
|
+
def call: (?(Array[(Hash[String, String] | Integer | String)?] | Hash[(:input | String)?, (Array[(Integer | String)?] | Hash[:input | String, String?] | Integer | MockRequest::FatalWarner | String | StringIO | bool)?] | MockRequest::FatalWarner | String | StringIO | bool)? env) -> [untyped, untyped, Lint]
|
|
683
|
+
def _call: ((Array[(Hash[String, String] | Integer | String)?] | Hash[(:input | String)?, (Array[(Integer | String)?] | Hash[:input | String, String?] | Integer | MockRequest::FatalWarner | String | StringIO | bool)?] | MockRequest::FatalWarner | String | StringIO | bool)? env) -> [untyped, untyped, Lint]
|
|
684
|
+
def check_env: ((Array[(Hash[String, String] | Integer | String)?] | Hash[(:input | String)?, (Array[(Integer | String)?] | Hash[:input | String, String?] | Integer | MockRequest::FatalWarner | String | StringIO | bool)?] | MockRequest::FatalWarner | String | StringIO | bool)? env) -> nil
|
|
685
|
+
def check_input: ((Array[(Integer | String)?] | Hash[(:input | String)?, (Array[(Integer | String)?] | Hash[:input | String, String?] | Integer | MockRequest::FatalWarner | Proc | String | StringIO | bool)?] | Integer | MockRequest::FatalWarner | Proc | String | StringIO | bool)? input) -> [:gets, :each, :read, :rewind]
|
|
686
|
+
def check_error: ((Array[(Integer | String)?] | Hash[(:input | String)?, (Array[(Integer | String)?] | Hash[:input | String, String?] | Integer | MockRequest::FatalWarner | Proc | String | StringIO | bool)?] | Integer | MockRequest::FatalWarner | Proc | String | StringIO | bool)? error) -> [:puts, :write, :flush]
|
|
687
|
+
def check_hijack: ((Array[(Hash[(:input | String)?, (Integer | MockRequest::FatalWarner | Proc | String | StringIO | bool)?] | Integer | Proc | String)?] | Hash[(:input | String)?, (Array[(Integer | String)?] | Hash[:input | String, String?] | Integer | MockRequest::FatalWarner | Proc | String | StringIO | bool)?] | MockRequest::FatalWarner | String | StringIO | bool)? env) -> ^ () -> untyped?
|
|
688
|
+
def check_hijack_response: (untyped headers, (Array[(ErrorWrapper | Hash[String, String] | InputWrapper | Integer | String)?] | Hash[(:input | String)?, (Array[(Integer | String)?] | ErrorWrapper | Hash[:input | String, String?] | InputWrapper | Integer | MockRequest::FatalWarner | String | StringIO | bool)?] | MockRequest::FatalWarner | String | StringIO | bool)? env) -> ^(untyped) -> untyped?
|
|
689
|
+
def check_status: (untyped status) -> nil
|
|
690
|
+
def check_headers: (untyped header) -> untyped
|
|
691
|
+
def check_content_type: (untyped status, untyped headers) -> nil
|
|
692
|
+
def check_content_length: (untyped status, untyped headers) -> untyped
|
|
693
|
+
def verify_content_length: (Integer bytes) -> nil
|
|
694
|
+
def each: () ?{ (Lint?) -> (Complex | Float | Integer | Rational | String) } -> nil
|
|
695
|
+
def close: () -> nil
|
|
696
|
+
|
|
697
|
+
class LintError < RuntimeError
|
|
698
|
+
end
|
|
699
|
+
|
|
700
|
+
module Assertion
|
|
701
|
+
def assert: (String message) ?{ () -> (Integer | bool)? } -> nil
|
|
702
|
+
end
|
|
703
|
+
|
|
704
|
+
class InputWrapper
|
|
705
|
+
include Assertion
|
|
706
|
+
|
|
707
|
+
def initialize: ((Array[(Integer | String)?] | Hash[:input | String, String?] | Integer | MockRequest::FatalWarner | String | StringIO | bool)? input) -> void
|
|
708
|
+
def gets: (*untyped args) -> String?
|
|
709
|
+
def read: (*untyped args) -> String?
|
|
710
|
+
def each: (*untyped args) -> Hash[:input | String, String?]
|
|
711
|
+
def rewind: (*untyped args) -> nil
|
|
712
|
+
def close: (*untyped args) -> nil
|
|
713
|
+
end
|
|
714
|
+
|
|
715
|
+
class ErrorWrapper
|
|
716
|
+
include Assertion
|
|
717
|
+
|
|
718
|
+
def initialize: ((Array[(Integer | String)?] | Hash[:input | String, String?] | InputWrapper | Integer | MockRequest::FatalWarner | String | StringIO | bool)? error) -> void
|
|
719
|
+
def puts: (untyped str) -> nil
|
|
720
|
+
def write: (untyped str) -> Integer
|
|
721
|
+
def flush: () -> StringIO?
|
|
722
|
+
def close: (*untyped args) -> nil
|
|
723
|
+
end
|
|
724
|
+
|
|
725
|
+
class HijackWrapper
|
|
726
|
+
REQUIRED_METHODS: [:read, :write, :read_nonblock, :write_nonblock, :flush, :close, :close_read, :close_write, :closed?]
|
|
727
|
+
include Assertion
|
|
728
|
+
|
|
729
|
+
def initialize: ((Array[(Integer | String)?] | Hash[(:input | String)?, (Integer | MockRequest::FatalWarner | Proc | String | StringIO | bool)?] | Integer | MockRequest::FatalWarner | Proc | String | StringIO | bool)? io) -> void
|
|
730
|
+
end
|
|
731
|
+
end
|
|
732
|
+
|
|
733
|
+
class Lock
|
|
734
|
+
def initialize: (untyped app, ?Thread::Mutex mutex) -> void
|
|
735
|
+
def call: (untyped env) -> untyped
|
|
736
|
+
|
|
737
|
+
private
|
|
738
|
+
|
|
739
|
+
def unlock: () -> untyped
|
|
740
|
+
end
|
|
741
|
+
|
|
742
|
+
class Logger
|
|
743
|
+
def initialize: (untyped app, ?untyped level) -> void
|
|
744
|
+
def call: (untyped env) -> untyped
|
|
745
|
+
end
|
|
746
|
+
|
|
747
|
+
class MediaType
|
|
748
|
+
SPLIT_PATTERN: Regexp
|
|
749
|
+
|
|
750
|
+
def self.type: (String content_type) -> String
|
|
751
|
+
| (false | nil) -> nil
|
|
752
|
+
def self.params: (String? content_type) -> Hash[String, String]
|
|
753
|
+
def self.strip_doublequotes: (String str) -> String
|
|
754
|
+
end
|
|
755
|
+
|
|
756
|
+
class MethodOverride
|
|
757
|
+
HTTP_METHODS: [String, String, String, String, String, String, String, String, String]
|
|
758
|
+
METHOD_OVERRIDE_PARAM_KEY: String
|
|
759
|
+
HTTP_METHOD_OVERRIDE_HEADER: String
|
|
760
|
+
ALLOWED_METHODS: [String]
|
|
761
|
+
|
|
762
|
+
def initialize: (untyped app) -> void
|
|
763
|
+
def call: (untyped env) -> untyped
|
|
764
|
+
def method_override: (untyped env) -> String
|
|
765
|
+
|
|
766
|
+
private
|
|
767
|
+
|
|
768
|
+
def allowed_methods: () -> [String]
|
|
769
|
+
def method_override_param: (Request req) -> String?
|
|
770
|
+
end
|
|
771
|
+
|
|
772
|
+
module Mime
|
|
773
|
+
MIME_TYPES: Hash[String, String]
|
|
774
|
+
|
|
775
|
+
def mime_type: (String ext, ?String fallback) -> String
|
|
776
|
+
def self.mime_type: (String ext, ?String fallback) -> String
|
|
777
|
+
def match?: (String value, String? matcher) -> bool
|
|
778
|
+
def self.match?: (String value, String? matcher) -> bool
|
|
779
|
+
end
|
|
780
|
+
|
|
781
|
+
class NullLogger
|
|
782
|
+
def initialize: (untyped app) -> void
|
|
783
|
+
def call: (untyped env) -> untyped
|
|
784
|
+
def info: (?nil progname) -> nil
|
|
785
|
+
def debug: (?nil progname) -> nil
|
|
786
|
+
def warn: (?nil progname) -> nil
|
|
787
|
+
def error: (?nil progname) -> nil
|
|
788
|
+
def fatal: (?nil progname) -> nil
|
|
789
|
+
def unknown: (?nil progname) -> nil
|
|
790
|
+
def info?: () -> nil
|
|
791
|
+
def debug?: () -> nil
|
|
792
|
+
def warn?: () -> nil
|
|
793
|
+
def error?: () -> nil
|
|
794
|
+
def fatal?: () -> nil
|
|
795
|
+
def level: () -> nil
|
|
796
|
+
def progname: () -> nil
|
|
797
|
+
def datetime_format: () -> nil
|
|
798
|
+
def formatter: () -> nil
|
|
799
|
+
def sev_threshold: () -> nil
|
|
800
|
+
def level=: (untyped level) -> nil
|
|
801
|
+
def progname=: (untyped progname) -> nil
|
|
802
|
+
def datetime_format=: (untyped datetime_format) -> nil
|
|
803
|
+
def formatter=: (untyped formatter) -> nil
|
|
804
|
+
def sev_threshold=: (untyped sev_threshold) -> nil
|
|
805
|
+
def close: () -> nil
|
|
806
|
+
def add: (untyped severity, ?nil message, ?nil progname) -> nil
|
|
807
|
+
def <<: (untyped msg) -> nil
|
|
808
|
+
end
|
|
809
|
+
|
|
810
|
+
class Reloader
|
|
811
|
+
def initialize: (untyped app, ?Integer cooldown, ?singleton(Stat) backend) -> void
|
|
812
|
+
def call: (untyped env) -> untyped
|
|
813
|
+
def reload!: (?IO stderr) -> untyped
|
|
814
|
+
def safe_load: (untyped file, untyped mtime, ?IO stderr) -> nil
|
|
815
|
+
|
|
816
|
+
module Stat
|
|
817
|
+
def rotation: () -> Array[nil]
|
|
818
|
+
def figure_path: (String file, Array[String] paths) -> [String | false, (File::Stat | false)?]
|
|
819
|
+
def safe_stat: (String file) -> ([String, File::Stat] | false)?
|
|
820
|
+
end
|
|
821
|
+
end
|
|
822
|
+
|
|
823
|
+
class Runtime
|
|
824
|
+
FORMAT_STRING: String
|
|
825
|
+
HEADER_NAME: String
|
|
826
|
+
|
|
827
|
+
def initialize: (untyped app, ?nil name) -> void
|
|
828
|
+
def call: (untyped env) -> [untyped, Hash[String, String] | Utils::HeaderHash, untyped]
|
|
829
|
+
end
|
|
830
|
+
|
|
831
|
+
class Sendfile
|
|
832
|
+
def initialize: (untyped app, ?nil variation, ?Array[bot] mappings) -> void
|
|
833
|
+
def call: (untyped env) -> [untyped, untyped, BodyProxy]
|
|
834
|
+
|
|
835
|
+
private
|
|
836
|
+
|
|
837
|
+
def variation: (untyped env) -> untyped
|
|
838
|
+
def map_accel_path: (untyped env, String path) -> String?
|
|
839
|
+
end
|
|
840
|
+
|
|
841
|
+
class ShowStatus
|
|
842
|
+
TEMPLATE: String
|
|
843
|
+
|
|
844
|
+
def initialize: (untyped app) -> void
|
|
845
|
+
def call: (untyped env) -> [untyped, Hash[String, String] | Utils::HeaderHash, [untyped]]
|
|
846
|
+
def h: (untyped obj) -> untyped
|
|
847
|
+
end
|
|
848
|
+
|
|
849
|
+
class Static
|
|
850
|
+
def initialize: (untyped app, ?Hash[bot, bot] options) -> void
|
|
851
|
+
def add_index_root?: (untyped path) -> nil
|
|
852
|
+
def overwrite_file_path: (untyped path) -> nil
|
|
853
|
+
def route_file: (untyped path) -> bool
|
|
854
|
+
def can_serve: (untyped path) -> true?
|
|
855
|
+
def call: (untyped env) -> [untyped, untyped, BodyProxy]
|
|
856
|
+
def applicable_rules: (untyped path) -> Array[[:all, Hash[String, nil]]]
|
|
857
|
+
end
|
|
858
|
+
|
|
859
|
+
class TempfileReaper
|
|
860
|
+
def initialize: (untyped app) -> void
|
|
861
|
+
def call: (Hash[String?, (Integer | String | true)?] env) -> [untyped, untyped, BodyProxy]
|
|
862
|
+
end
|
|
863
|
+
|
|
864
|
+
class URLMap
|
|
865
|
+
def initialize: (?Hash[String, URLMap] map) -> void
|
|
866
|
+
def remap: (Hash[String, URLMap] map) -> Array[[String?, String, Regexp, URLMap]]
|
|
867
|
+
def call: (untyped env) -> [Integer, Hash[String, String], [String]]
|
|
868
|
+
|
|
869
|
+
private
|
|
870
|
+
|
|
871
|
+
def casecmp?: (untyped v1, String? v2) -> bool
|
|
872
|
+
end
|
|
873
|
+
|
|
874
|
+
class Request
|
|
875
|
+
attr_accessor ip_filter: ^(_ToStr? ip) -> bool
|
|
876
|
+
ALLOWED_SCHEMES: Array[String]
|
|
877
|
+
SCHEME_WHITELIST: Array[String]
|
|
878
|
+
include Helpers
|
|
879
|
+
include Env
|
|
880
|
+
|
|
881
|
+
def initialize: (env) -> void
|
|
882
|
+
def params: () -> Hash[untyped, untyped]
|
|
883
|
+
def update_param: (top k, top v) -> void
|
|
884
|
+
def delete_param: (top k) -> bot
|
|
885
|
+
|
|
886
|
+
module Env
|
|
887
|
+
attr_reader env: env
|
|
888
|
+
def initialize: (env) -> void
|
|
889
|
+
def has_header?: (String name) -> bool
|
|
890
|
+
def get_header: (String name) -> untyped?
|
|
891
|
+
def fetch_header: (String name) ?{ (String) -> untyped } -> untyped?
|
|
892
|
+
def each_header: () { ([String, untyped]) -> void } -> env
|
|
893
|
+
| () -> Enumerator[[String, untyped], env]
|
|
894
|
+
def set_header: (String name, untyped v) -> untyped
|
|
895
|
+
def add_header: (String key, untyped v) -> untyped
|
|
896
|
+
def delete_header: (String name) -> untyped
|
|
897
|
+
def initialize_copy: (Env other) -> void
|
|
898
|
+
end
|
|
899
|
+
|
|
900
|
+
module Helpers
|
|
901
|
+
FORM_DATA_MEDIA_TYPES: Array[String]
|
|
902
|
+
PARSEABLE_DATA_MEDIA_TYPES: Array[String]
|
|
903
|
+
DEFAULT_PORTS: Hash[String, Integer]
|
|
904
|
+
HTTP_X_FORWARDED_FOR: String
|
|
905
|
+
HTTP_X_FORWARDED_HOST: String
|
|
906
|
+
HTTP_X_FORWARDED_SCHEME: String
|
|
907
|
+
HTTP_X_FORWARDED_PROTO: String
|
|
908
|
+
HTTP_X_FORWARDED_PORT: String
|
|
909
|
+
HTTP_X_FORWARDED_SSL: String
|
|
910
|
+
AUTHORITY: Regexp
|
|
911
|
+
|
|
912
|
+
# FIXME: write SPEC-specified duck type for #body and #logger
|
|
913
|
+
def body: () -> untyped
|
|
914
|
+
def script_name: () -> String
|
|
915
|
+
def script_name=: (_ToS s) -> String
|
|
916
|
+
def path_info: () -> String
|
|
917
|
+
def path_info=: (_ToS s) -> String
|
|
918
|
+
def request_method: () -> String
|
|
919
|
+
def query_string: () -> String
|
|
920
|
+
def content_length: () -> String?
|
|
921
|
+
def logger: () -> untyped
|
|
922
|
+
def user_agent: () -> String?
|
|
923
|
+
def multithread?: () -> bool
|
|
924
|
+
def referer: () -> String?
|
|
925
|
+
alias referrer referer
|
|
926
|
+
def session: () -> _ToHash[untyped, untyped]
|
|
927
|
+
# FIXME: SPEC does not document `rack.session_options`
|
|
928
|
+
def session_options: () -> bot
|
|
929
|
+
def delete?: () -> bool
|
|
930
|
+
def get?: () -> bool
|
|
931
|
+
def head?: () -> bool
|
|
932
|
+
def options?: () -> bool
|
|
933
|
+
def link?: () -> bool
|
|
934
|
+
def patch?: () -> bool
|
|
935
|
+
def post?: () -> bool
|
|
936
|
+
def put?: () -> bool
|
|
937
|
+
def trace?: () -> bool
|
|
938
|
+
def unlink?: () -> bool
|
|
939
|
+
def scheme: () -> String?
|
|
940
|
+
def authority: () -> String?
|
|
941
|
+
def server_authority: () -> String?
|
|
942
|
+
def server_name: () -> String
|
|
943
|
+
def server_port: () -> Integer?
|
|
944
|
+
def cookies: () -> Hash[String, String]
|
|
945
|
+
def content_type: () -> String?
|
|
946
|
+
def xhr?: () -> bool
|
|
947
|
+
def host_authority: () -> String?
|
|
948
|
+
def host_with_port: (?String? authority) -> String?
|
|
949
|
+
def host: () -> String?
|
|
950
|
+
def hostname: () -> String?
|
|
951
|
+
def port: () -> Integer?
|
|
952
|
+
def forwarded_for: () -> Array[String?]?
|
|
953
|
+
def forwarded_port: () -> Array[Integer]?
|
|
954
|
+
def forwarded_authority: () -> String?
|
|
955
|
+
def ssl?: () -> bool
|
|
956
|
+
def ip: () -> String?
|
|
957
|
+
def media_type: () -> String?
|
|
958
|
+
def media_type_params: () -> Hash[String, String]
|
|
959
|
+
def content_charset: () -> String?
|
|
960
|
+
def form_data?: () -> bool
|
|
961
|
+
def parseable_data?: () -> bool
|
|
962
|
+
def GET: () -> Hash[untyped, untyped]
|
|
963
|
+
def POST: () -> Hash[untyped, untyped]
|
|
964
|
+
def params: () -> Hash[untyped, untyped]
|
|
965
|
+
def update_param: (top k, top v) -> void
|
|
966
|
+
def delete_param: (top k) -> bot
|
|
967
|
+
def base_url: () -> String
|
|
968
|
+
def url: () -> String
|
|
969
|
+
def path: () -> String
|
|
970
|
+
def fullpath: () -> String
|
|
971
|
+
def accept_encoding: () -> Array[[String?, Float]]
|
|
972
|
+
def accept_language: () -> Array[[String?, Float]]
|
|
973
|
+
def trusted_proxy?: (String? ip) -> bool
|
|
974
|
+
def []: (untyped key) -> untyped
|
|
975
|
+
def []=: (untyped key, untyped value) -> untyped
|
|
976
|
+
def values_at: (*untyped keys) -> Array[untyped]
|
|
977
|
+
|
|
978
|
+
private
|
|
979
|
+
|
|
980
|
+
def default_session: () -> Hash[untyped, untyped]
|
|
981
|
+
def wrap_ipv6: (String host) -> String
|
|
982
|
+
def parse_http_accept_header: (_ToS header) -> Array[[String?, Float]]
|
|
983
|
+
def query_parser: () -> QueryParser
|
|
984
|
+
def parse_query: (String qs, ?String? d) -> Hash[String, String | Array[String]]
|
|
985
|
+
# FIXME: What exactly does #parse_multipart return?
|
|
986
|
+
def parse_multipart: () -> bot
|
|
987
|
+
def split_header: (String? value) -> Array[String]
|
|
988
|
+
def split_authority: (String authority) -> [String?, String?, Integer?]
|
|
989
|
+
def reject_trusted_ip_addresses: (Array[String?]? ip_addresses) -> Array[String?]
|
|
990
|
+
def forwarded_scheme: () -> String?
|
|
991
|
+
def allowed_scheme: (String? header) -> String?
|
|
992
|
+
def extract_proto_header: (String? header) -> String?
|
|
993
|
+
end
|
|
994
|
+
end
|
|
995
|
+
|
|
996
|
+
class Response
|
|
997
|
+
CHUNKED: String
|
|
998
|
+
STATUS_WITH_NO_ENTITY_BODY: Hash[Integer, true]
|
|
999
|
+
include Helpers
|
|
1000
|
+
|
|
1001
|
+
def self.[]: (_ToI status, _Each[[String, String]] headers, nil | _Each[String] | _ToStr body) -> Response
|
|
1002
|
+
attr_accessor length: Integer
|
|
1003
|
+
attr_accessor status: _ToI
|
|
1004
|
+
attr_accessor body: _Each[String]
|
|
1005
|
+
attr_reader headers: _Each[[String, String]]
|
|
1006
|
+
alias header headers
|
|
1007
|
+
def initialize: (?nil | _Each[String] | _ToStr body, ?_ToI status, ?_Each[[String, String]] headers) -> void
|
|
1008
|
+
def redirect: (String target, ?_ToI status) -> void
|
|
1009
|
+
def chunked?: () -> bool
|
|
1010
|
+
def finish: () -> response
|
|
1011
|
+
alias to_a finish
|
|
1012
|
+
def each: () ?{ (String) -> void } -> void
|
|
1013
|
+
def write: (_ToS chunk) -> void
|
|
1014
|
+
def close: () -> void
|
|
1015
|
+
def empty?: () -> bool
|
|
1016
|
+
def has_header?: (String key) -> bool
|
|
1017
|
+
def get_header: (String key) -> String?
|
|
1018
|
+
def set_header: (String key, String v) -> String
|
|
1019
|
+
def delete_header: (String key) -> String?
|
|
1020
|
+
alias [] get_header
|
|
1021
|
+
alias []= set_header
|
|
1022
|
+
|
|
1023
|
+
module Helpers
|
|
1024
|
+
def invalid?: () -> bool
|
|
1025
|
+
def informational?: () -> bool
|
|
1026
|
+
def successful?: () -> bool
|
|
1027
|
+
def redirection?: () -> bool
|
|
1028
|
+
def client_error?: () -> bool
|
|
1029
|
+
def server_error?: () -> bool
|
|
1030
|
+
def ok?: () -> bool
|
|
1031
|
+
def created?: () -> bool
|
|
1032
|
+
def accepted?: () -> bool
|
|
1033
|
+
def no_content?: () -> bool
|
|
1034
|
+
def moved_permanently?: () -> bool
|
|
1035
|
+
def bad_request?: () -> bool
|
|
1036
|
+
def unauthorized?: () -> bool
|
|
1037
|
+
def forbidden?: () -> bool
|
|
1038
|
+
def not_found?: () -> bool
|
|
1039
|
+
def method_not_allowed?: () -> bool
|
|
1040
|
+
def precondition_failed?: () -> bool
|
|
1041
|
+
def unprocessable?: () -> bool
|
|
1042
|
+
def redirect?: () -> bool
|
|
1043
|
+
def include?: (untyped header) -> bool
|
|
1044
|
+
def add_header: (String key, String v) -> String
|
|
1045
|
+
def content_type: () -> String?
|
|
1046
|
+
def content_type=: (String content_type) -> String
|
|
1047
|
+
def media_type: () -> String?
|
|
1048
|
+
def media_type_params: () -> Hash[String, String]
|
|
1049
|
+
def content_length: () -> Integer?
|
|
1050
|
+
def location: () -> String?
|
|
1051
|
+
def location=: (String location) -> String
|
|
1052
|
+
def set_cookie: (String key, _ToS value) -> String
|
|
1053
|
+
def delete_cookie: (String key, ?Hash[Symbol, _ToS] value) -> String
|
|
1054
|
+
def set_cookie_header: () -> String?
|
|
1055
|
+
def set_cookie_header=: (String v) -> String
|
|
1056
|
+
def cache_control: () -> String?
|
|
1057
|
+
def cache_control=: (String v) -> String
|
|
1058
|
+
def do_not_cache!: () -> void
|
|
1059
|
+
def cache!: (?Integer duration, ?directive: String) -> void
|
|
1060
|
+
def etag: () -> String?
|
|
1061
|
+
def etag=: (String v) -> String
|
|
1062
|
+
def buffered_body!: () -> true?
|
|
1063
|
+
def append: (String chunk) -> String
|
|
1064
|
+
end
|
|
1065
|
+
|
|
1066
|
+
class Raw
|
|
1067
|
+
include Helpers
|
|
1068
|
+
|
|
1069
|
+
attr_reader headers: Hash[String, String]
|
|
1070
|
+
attr_accessor status: untyped
|
|
1071
|
+
def initialize: (untyped status, Hash[String, String] headers) -> void
|
|
1072
|
+
def has_header?: (String key) -> bool
|
|
1073
|
+
def get_header: (String key) -> String?
|
|
1074
|
+
def set_header: (String key, String v) -> String
|
|
1075
|
+
def delete_header: (String key) -> String?
|
|
1076
|
+
end
|
|
1077
|
+
end
|
|
1078
|
+
|
|
1079
|
+
module RegexpExtensions
|
|
1080
|
+
end
|
|
1081
|
+
|
|
1082
|
+
class Server
|
|
1083
|
+
def self.start: (?untyped options) -> untyped
|
|
1084
|
+
attr_writer options: {config: String?}
|
|
1085
|
+
def initialize: (?nil options) -> void
|
|
1086
|
+
def options: () -> {config: (Array[bot] | Integer | String)?, environment: (Array[bot] | Integer | String)?, pid: (Array[bot] | Integer | String)?, Port: (Array[bot] | Integer | String)?, Host: (Array[bot] | Integer | String)?, AccessLog: (Array[bot] | Integer | String)?}
|
|
1087
|
+
def default_options: () -> {environment: String, pid: nil, Port: Integer, Host: String, AccessLog: Array[bot], config: String}
|
|
1088
|
+
def app: () -> untyped
|
|
1089
|
+
def self.logging_middleware: () -> Proc
|
|
1090
|
+
def self.default_middleware_by_environment: () -> Hash[String, Array[Proc | [singleton(ContentLength) | singleton(Lint) | singleton(ShowExceptions) | singleton(TempfileReaper)]]]
|
|
1091
|
+
def self.middleware: () -> Hash[String, Array[Proc | [singleton(ContentLength) | singleton(Lint) | singleton(ShowExceptions) | singleton(TempfileReaper)]]]
|
|
1092
|
+
def middleware: () -> Hash[String, Array[Proc | [singleton(ContentLength) | singleton(Lint) | singleton(ShowExceptions) | singleton(TempfileReaper)]]]
|
|
1093
|
+
def start: () -> untyped
|
|
1094
|
+
def server: () -> (singleton(Handler::CGI) | singleton(Handler::FastCGI))?
|
|
1095
|
+
|
|
1096
|
+
private
|
|
1097
|
+
|
|
1098
|
+
def build_app_and_options_from_config: () -> untyped
|
|
1099
|
+
def handle_profiling: (nil heapfile, nil profile_mode, nil filename) { () -> (ContentLength | Lint | ShowExceptions | TempfileReaper) } -> (ContentLength | Lint | ShowExceptions | TempfileReaper)
|
|
1100
|
+
def make_profile_name: (untyped filename) -> untyped
|
|
1101
|
+
def build_app_from_string: () -> untyped
|
|
1102
|
+
def parse_options: (Array[String] args) -> {config: String?}
|
|
1103
|
+
def opt_parser: () -> Options
|
|
1104
|
+
def build_app: (untyped app) -> (ContentLength | Lint | ShowExceptions | TempfileReaper)
|
|
1105
|
+
def wrapped_app: () -> (ContentLength | Lint | ShowExceptions | TempfileReaper)
|
|
1106
|
+
def daemonize_app: () -> Integer
|
|
1107
|
+
def write_pid: () -> Proc
|
|
1108
|
+
def check_pid!: () -> nil
|
|
1109
|
+
def pidfile_process_status: () -> (:dead | :exited | :not_owned | :running)
|
|
1110
|
+
|
|
1111
|
+
class Options
|
|
1112
|
+
def parse!: (Array[String] args) -> {config: String?}
|
|
1113
|
+
def handler_opts: (untyped options) -> String
|
|
1114
|
+
end
|
|
1115
|
+
end
|
|
1116
|
+
|
|
1117
|
+
class ShowExceptions
|
|
1118
|
+
CONTEXT: Integer
|
|
1119
|
+
TEMPLATE: untyped
|
|
1120
|
+
|
|
1121
|
+
def initialize: (untyped app) -> void
|
|
1122
|
+
def call: (Hash[String?, (Integer | String | true)?] env) -> [Integer, Hash[String, String?], [String?]]
|
|
1123
|
+
def prefers_plaintext?: (untyped env) -> bool
|
|
1124
|
+
|
|
1125
|
+
private
|
|
1126
|
+
|
|
1127
|
+
def accepts_html?: (Hash[String, String?] env) -> (Float | String)?
|
|
1128
|
+
|
|
1129
|
+
public
|
|
1130
|
+
|
|
1131
|
+
def dump_exception: (nil exception) -> String
|
|
1132
|
+
def pretty: (Hash[String, String?] env, nil exception) -> untyped
|
|
1133
|
+
def template: () -> untyped
|
|
1134
|
+
def h: (untyped obj) -> untyped
|
|
1135
|
+
end
|
|
1136
|
+
|
|
1137
|
+
class QueryParser
|
|
1138
|
+
DEFAULT_SEP: Regexp
|
|
1139
|
+
COMMON_SEP: Hash[String, Regexp]
|
|
1140
|
+
|
|
1141
|
+
def self.make_default: (Integer key_space_limit, Integer param_depth_limit) -> QueryParser
|
|
1142
|
+
attr_reader key_space_limit: Integer
|
|
1143
|
+
attr_reader param_depth_limit: Integer
|
|
1144
|
+
def initialize: (singleton(Params) params_class, Integer key_space_limit, Integer param_depth_limit) -> void
|
|
1145
|
+
def parse_query: (untyped qs, ?nil d) -> Hash[String?, (Array[(Array[nil] | Hash[String?, untyped] | Params | String)?] | Hash[String?, (Array[untyped] | Hash[String?, untyped] | Params | String)?] | Params | String)?]
|
|
1146
|
+
def parse_nested_query: (untyped qs, ?nil d) -> Hash[String?, (Array[(Array[nil] | Params | String)?] | Hash[String?, (Params | String)?] | Params | String)?]
|
|
1147
|
+
def normalize_params: ((Array[(Array[nil] | Hash[String?, untyped] | Params | String)?] | Hash[String?, (Array[untyped] | Hash[String?, untyped] | Params | String)?] | Params | String)? params, String? name, String? v, Integer depth) -> (Array[(Array[(Params | String)?] | Hash[String?, (Params | String)?] | Params | String)?] | Hash[String?, (Array[(Params | String)?] | Hash[String?, (Params | String)?] | Params | String)?] | Params | String)?
|
|
1148
|
+
def make_params: () -> Params
|
|
1149
|
+
def new_space_limit: (untyped key_space_limit) -> QueryParser
|
|
1150
|
+
def new_depth_limit: (untyped param_depth_limit) -> QueryParser
|
|
1151
|
+
|
|
1152
|
+
private
|
|
1153
|
+
|
|
1154
|
+
def params_hash_type?: ((Array[(Array[nil] | Hash[String?, untyped] | Params | String)?] | Hash[String?, (Array[untyped] | Hash[String?, untyped] | Params | String)?] | Params | String)? obj) -> bool
|
|
1155
|
+
def params_hash_has_key?: ((Array[nil] | Hash[String?, untyped] | Params | String)? hash, String? key) -> bool
|
|
1156
|
+
def unescape: (String s) -> untyped
|
|
1157
|
+
|
|
1158
|
+
class ParameterTypeError < TypeError
|
|
1159
|
+
end
|
|
1160
|
+
|
|
1161
|
+
class InvalidParameterError < ArgumentError
|
|
1162
|
+
end
|
|
1163
|
+
|
|
1164
|
+
class ParamsTooDeepError < RangeError
|
|
1165
|
+
end
|
|
1166
|
+
|
|
1167
|
+
class Params
|
|
1168
|
+
def initialize: (Integer limit) -> void
|
|
1169
|
+
def []: (String? key) -> (Array[(Array[nil] | Hash[String?, untyped] | Params | String)?] | Hash[String?, (Array[untyped] | Hash[String?, untyped] | Params | String)?] | Params | String)?
|
|
1170
|
+
def []=: (String? key, (Array[(Array[(Params | String)?] | Hash[String?, (Params | String)?] | Params | String)?] | Hash[String?, (Array[(Params | String)?] | Hash[String?, (Params | String)?] | Params | String)?] | Params | String)? value) -> (Array[(Array[(Params | String)?] | Hash[String?, (Params | String)?] | Params | String)?] | Hash[String?, (Array[(Params | String)?] | Hash[String?, (Params | String)?] | Params | String)?] | Params | String)?
|
|
1171
|
+
def key?: (String key) -> bool
|
|
1172
|
+
def to_h: () -> Hash[String?, (Array[(Array[nil] | Hash[String?, untyped] | Params | String)?] | Hash[String?, (Array[untyped] | Hash[String?, untyped] | Params | String)?] | Params | String)?]
|
|
1173
|
+
end
|
|
1174
|
+
end
|
|
1175
|
+
|
|
1176
|
+
module Utils
|
|
1177
|
+
DEFAULT_SEP: Regexp
|
|
1178
|
+
COMMON_SEP: Hash[String, Regexp]
|
|
1179
|
+
RFC2822_DAY_NAME: Array[String]
|
|
1180
|
+
RFC2822_MONTH_NAME: Array[String]
|
|
1181
|
+
ESCAPE_HTML: Hash[String, String]
|
|
1182
|
+
ESCAPE_HTML_PATTERN: Regexp
|
|
1183
|
+
HTTP_STATUS_CODES: Hash[Integer, String]
|
|
1184
|
+
STATUS_WITH_NO_ENTITY_BODY: Hash[true, true]
|
|
1185
|
+
SYMBOL_TO_STATUS_CODE: Hash[untyped, untyped]
|
|
1186
|
+
PATH_SEPS: Regexp
|
|
1187
|
+
NULL_BYTE: String
|
|
1188
|
+
|
|
1189
|
+
def escape: ((Integer | Session::Cookie::Base64::Marshal | String | [:expires | :same_site | :value, Time] | bool | {value: bot, expires: Time, same_site: untyped})? s) -> untyped
|
|
1190
|
+
def self.escape: ((Integer | Session::Cookie::Base64::Marshal | String | [:expires | :same_site | :value, Time] | bool | {value: bot, expires: Time, same_site: untyped})? s) -> untyped
|
|
1191
|
+
def escape_path: (String? s) -> untyped
|
|
1192
|
+
def self.escape_path: (String? s) -> untyped
|
|
1193
|
+
def unescape_path: (String s) -> untyped
|
|
1194
|
+
def self.unescape_path: (String s) -> untyped
|
|
1195
|
+
def unescape: (String s, ?Encoding encoding) -> untyped
|
|
1196
|
+
def self.unescape: (String s, ?Encoding encoding) -> untyped
|
|
1197
|
+
def self.param_depth_limit: () -> untyped
|
|
1198
|
+
def self.param_depth_limit=: (untyped v) -> untyped
|
|
1199
|
+
def self.key_space_limit: () -> untyped
|
|
1200
|
+
def self.key_space_limit=: (untyped v) -> untyped
|
|
1201
|
+
def clock_time: () -> (Float | Integer)
|
|
1202
|
+
def self.clock_time: () -> (Float | Integer)
|
|
1203
|
+
def parse_query: (String? qs, ?String? d) { () -> untyped } -> untyped
|
|
1204
|
+
def self.parse_query: (String? qs, ?String? d) { () -> untyped } -> untyped
|
|
1205
|
+
def parse_nested_query: ((MockRequest::FatalWarner | String | StringIO | [Integer, Integer] | bool)? qs, ?nil d) -> untyped
|
|
1206
|
+
def self.parse_nested_query: ((MockRequest::FatalWarner | String | StringIO | [Integer, Integer] | bool)? qs, ?nil d) -> untyped
|
|
1207
|
+
def build_query: (untyped params) -> untyped
|
|
1208
|
+
def self.build_query: (untyped params) -> untyped
|
|
1209
|
+
def build_nested_query: (nil value, ?String? prefix) -> String?
|
|
1210
|
+
def self.build_nested_query: (nil value, ?String? prefix) -> String?
|
|
1211
|
+
def q_values: (String? q_value_header) -> Array[[String?, Float]]
|
|
1212
|
+
def self.q_values: (String? q_value_header) -> Array[[String?, Float]]
|
|
1213
|
+
def best_q_match: (String? q_value_header, [String] available_mimes) -> (Float | String)?
|
|
1214
|
+
def self.best_q_match: (String? q_value_header, [String] available_mimes) -> (Float | String)?
|
|
1215
|
+
def escape_html: (String string) -> untyped
|
|
1216
|
+
def self.escape_html: (String string) -> untyped
|
|
1217
|
+
def select_best_encoding: ([String, String] available_encodings, Array[[String?, Float]] accept_encoding) -> (Array[(Array[untyped] | Float | Integer | String)?] | String)
|
|
1218
|
+
def self.select_best_encoding: ([String, String] available_encodings, Array[[String?, Float]] accept_encoding) -> (Array[(Array[untyped] | Float | Integer | String)?] | String)
|
|
1219
|
+
def parse_cookies: (untyped env) -> untyped
|
|
1220
|
+
def self.parse_cookies: (untyped env) -> untyped
|
|
1221
|
+
def parse_cookies_header: (String? header) -> untyped
|
|
1222
|
+
def self.parse_cookies_header: (String? header) -> untyped
|
|
1223
|
+
def add_cookie_to_header: (String header, (Integer | Session::Cookie::Base64::Marshal | String | bool)? key, {value: bot, expires: Time, same_site: (Integer | Session::Cookie::Base64::Marshal | String | bool)?} value) -> String
|
|
1224
|
+
def self.add_cookie_to_header: (String header, (Integer | Session::Cookie::Base64::Marshal | String | bool)? key, {value: bot, expires: Time, same_site: (Integer | Session::Cookie::Base64::Marshal | String | bool)?} value) -> String
|
|
1225
|
+
def set_cookie_header!: (untyped header, untyped key, untyped value) -> nil
|
|
1226
|
+
def self.set_cookie_header!: (untyped header, untyped key, untyped value) -> nil
|
|
1227
|
+
def make_delete_cookie_header: (untyped header, untyped key, Hash[bot, bot] value) -> String
|
|
1228
|
+
def self.make_delete_cookie_header: (untyped header, untyped key, Hash[bot, bot] value) -> String
|
|
1229
|
+
def delete_cookie_header!: (untyped header, untyped key, ?Hash[bot, bot] value) -> nil
|
|
1230
|
+
def self.delete_cookie_header!: (untyped header, untyped key, ?Hash[bot, bot] value) -> nil
|
|
1231
|
+
def add_remove_cookie_to_header: (untyped header, untyped key, ?Hash[bot, bot] value) -> String
|
|
1232
|
+
def self.add_remove_cookie_to_header: (untyped header, untyped key, ?Hash[bot, bot] value) -> String
|
|
1233
|
+
def rfc2822: (untyped time) -> untyped
|
|
1234
|
+
def self.rfc2822: (untyped time) -> untyped
|
|
1235
|
+
def rfc2109: (untyped time) -> untyped
|
|
1236
|
+
def self.rfc2109: (untyped time) -> untyped
|
|
1237
|
+
def byte_ranges: (untyped env, untyped size) -> Array[Range[Integer]]?
|
|
1238
|
+
def self.byte_ranges: (untyped env, untyped size) -> Array[Range[Integer]]?
|
|
1239
|
+
def get_byte_ranges: (String? http_range, Integer size) -> Array[Range[Integer]]?
|
|
1240
|
+
def self.get_byte_ranges: (String? http_range, Integer size) -> Array[Range[Integer]]?
|
|
1241
|
+
def secure_compare: (untyped a, untyped b) -> bool
|
|
1242
|
+
def self.secure_compare: (untyped a, untyped b) -> bool
|
|
1243
|
+
def status_code: (untyped status) -> untyped
|
|
1244
|
+
def self.status_code: (untyped status) -> untyped
|
|
1245
|
+
def clean_path_info: (untyped path_info) -> String
|
|
1246
|
+
def self.clean_path_info: (untyped path_info) -> String
|
|
1247
|
+
def valid_path?: (untyped path) -> untyped
|
|
1248
|
+
def self.valid_path?: (untyped path) -> untyped
|
|
1249
|
+
|
|
1250
|
+
class Context
|
|
1251
|
+
attr_reader for: untyped
|
|
1252
|
+
attr_reader app: untyped
|
|
1253
|
+
def initialize: (untyped app_f, untyped app_r) -> void
|
|
1254
|
+
def call: (untyped env) -> untyped
|
|
1255
|
+
def recontext: (untyped app) -> Context
|
|
1256
|
+
def context: (untyped env, ?untyped app) -> untyped
|
|
1257
|
+
end
|
|
1258
|
+
|
|
1259
|
+
class HeaderHash < Hash[untyped, untyped]
|
|
1260
|
+
def self.[]: (Hash[String, String] | HeaderHash headers) -> (Hash[String, String] | HeaderHash)
|
|
1261
|
+
def initialize: (?Hash[String, String] | HeaderHash hash) -> void
|
|
1262
|
+
def initialize_copy: (untyped other) -> untyped
|
|
1263
|
+
def clear: () -> Hash[String, String]
|
|
1264
|
+
def each: () ?{ ([String, String], ?untyped) -> String } -> HeaderHash
|
|
1265
|
+
def to_hash: () -> Hash[untyped, untyped]
|
|
1266
|
+
def []: (String k) -> untyped
|
|
1267
|
+
def []=: (String k, Array[(Array[String] | String)?] | String v) -> untyped
|
|
1268
|
+
def delete: (String k) -> nil
|
|
1269
|
+
def include?: (untyped k) -> bool
|
|
1270
|
+
def merge!: (untyped other) -> HeaderHash
|
|
1271
|
+
def merge: (untyped other) -> HeaderHash
|
|
1272
|
+
def replace: (untyped other) -> HeaderHash
|
|
1273
|
+
def names: () -> Hash[String, String]
|
|
1274
|
+
end
|
|
1275
|
+
end
|
|
1276
|
+
|
|
1277
|
+
module Multipart
|
|
1278
|
+
EOL: String
|
|
1279
|
+
MULTIPART_BOUNDARY: String
|
|
1280
|
+
MULTIPART: Regexp
|
|
1281
|
+
TOKEN: Regexp
|
|
1282
|
+
CONDISP: Regexp
|
|
1283
|
+
VALUE: Regexp
|
|
1284
|
+
BROKEN: Regexp
|
|
1285
|
+
MULTIPART_CONTENT_TYPE: Regexp
|
|
1286
|
+
MULTIPART_CONTENT_DISPOSITION: Regexp
|
|
1287
|
+
MULTIPART_CONTENT_ID: Regexp
|
|
1288
|
+
ATTRIBUTE_CHAR: Regexp
|
|
1289
|
+
ATTRIBUTE: Regexp
|
|
1290
|
+
SECTION: Regexp
|
|
1291
|
+
REGULAR_PARAMETER_NAME: Regexp
|
|
1292
|
+
REGULAR_PARAMETER: Regexp
|
|
1293
|
+
EXTENDED_OTHER_NAME: Regexp
|
|
1294
|
+
EXTENDED_OTHER_VALUE: Regexp
|
|
1295
|
+
EXTENDED_OTHER_PARAMETER: Regexp
|
|
1296
|
+
EXTENDED_INITIAL_NAME: Regexp
|
|
1297
|
+
EXTENDED_INITIAL_VALUE: Regexp
|
|
1298
|
+
EXTENDED_INITIAL_PARAMETER: Regexp
|
|
1299
|
+
EXTENDED_PARAMETER: Regexp
|
|
1300
|
+
DISPPARM: Regexp
|
|
1301
|
+
RFC2183: Regexp
|
|
1302
|
+
|
|
1303
|
+
def self.parse_multipart: (untyped env, ?untyped params) -> nil
|
|
1304
|
+
def self.extract_multipart: (Request | Request::Helpers req, ?untyped params) -> nil
|
|
1305
|
+
def self.build_multipart: (nil params, ?bool first) -> (Hash[bot, bot] | String)?
|
|
1306
|
+
|
|
1307
|
+
class MultipartPartLimitError < Errno::EMFILE
|
|
1308
|
+
end
|
|
1309
|
+
|
|
1310
|
+
class Parser
|
|
1311
|
+
BUFSIZE: Integer
|
|
1312
|
+
TEXT_PLAIN: String
|
|
1313
|
+
TEMPFILE_FACTORY: Proc
|
|
1314
|
+
BOUNDARY_REGEX: Regexp
|
|
1315
|
+
EMPTY: MultipartInfo
|
|
1316
|
+
CHARSET: String
|
|
1317
|
+
|
|
1318
|
+
def self.parse_boundary: (String? content_type) -> String?
|
|
1319
|
+
def self.parse: (String? io, Integer? content_length, String? content_type, Proc | String tmpfile, Integer | String bufsize, untyped qp) -> MultipartInfo
|
|
1320
|
+
attr_reader state: :CONSUME_TOKEN | :DONE | :FAST_FORWARD | :MIME_BODY | :MIME_HEAD
|
|
1321
|
+
def initialize: (String boundary, Proc | String tempfile, Integer | String bufsize, untyped query_parser) -> void
|
|
1322
|
+
def on_read: (nil content) -> nil
|
|
1323
|
+
def result: () -> MultipartInfo
|
|
1324
|
+
|
|
1325
|
+
private
|
|
1326
|
+
|
|
1327
|
+
def run_parser: () -> nil
|
|
1328
|
+
def handle_fast_forward: () -> (:MIME_HEAD | :want_read)
|
|
1329
|
+
def handle_consume_token: () -> (:DONE | :MIME_HEAD)
|
|
1330
|
+
def handle_mime_head: () -> (:MIME_BODY | :want_read)
|
|
1331
|
+
def handle_mime_body: () -> (:want_read | Integer)
|
|
1332
|
+
def full_boundary: () -> String
|
|
1333
|
+
def consume_boundary: () -> (:BOUNDARY | :END_BOUNDARY)?
|
|
1334
|
+
def get_filename: (untyped head) -> String?
|
|
1335
|
+
def tag_multipart_encoding: (String? filename, untyped content_type, String? name, String | {filename: String?, type: untyped, name: String?, tempfile: String, head: untyped} body) -> String?
|
|
1336
|
+
def handle_empty_content!: (nil content) -> nil
|
|
1337
|
+
|
|
1338
|
+
class BoundedIO
|
|
1339
|
+
def initialize: (String? io, Integer content_length) -> void
|
|
1340
|
+
def read: (Integer | String size, ?String? outbuf) -> nil
|
|
1341
|
+
def rewind: () -> untyped
|
|
1342
|
+
end
|
|
1343
|
+
|
|
1344
|
+
class MultipartInfo < Struct[untyped]
|
|
1345
|
+
attr_accessor params(): nil
|
|
1346
|
+
attr_accessor tmp_files(): Array[untyped]
|
|
1347
|
+
end
|
|
1348
|
+
|
|
1349
|
+
class Collector
|
|
1350
|
+
include Enumerable[MimePart]
|
|
1351
|
+
|
|
1352
|
+
def initialize: (Proc | String tempfile) -> void
|
|
1353
|
+
def each: () { (MimePart) -> void } -> void
|
|
1354
|
+
| () -> Enumerator[MimePart, untyped]
|
|
1355
|
+
def on_mime_head: (Integer mime_index, untyped head, String? filename, untyped content_type, String? name) -> nil
|
|
1356
|
+
def on_mime_body: (Integer mime_index, untyped content) -> String
|
|
1357
|
+
def on_mime_finish: (untyped mime_index) -> nil
|
|
1358
|
+
|
|
1359
|
+
private
|
|
1360
|
+
|
|
1361
|
+
def check_open_files: () -> nil
|
|
1362
|
+
|
|
1363
|
+
class MimePart
|
|
1364
|
+
attr_accessor body(): untyped
|
|
1365
|
+
attr_accessor head(): untyped
|
|
1366
|
+
attr_accessor filename(): untyped
|
|
1367
|
+
attr_accessor content_type(): untyped
|
|
1368
|
+
attr_accessor name(): untyped
|
|
1369
|
+
|
|
1370
|
+
def get_data: () { (String | {filename: String?, type: untyped, name: String?, tempfile: String, head: untyped}) -> untyped } -> nil
|
|
1371
|
+
end
|
|
1372
|
+
|
|
1373
|
+
class BufferPart < MimePart
|
|
1374
|
+
def file?: () -> false
|
|
1375
|
+
def close: () -> nil
|
|
1376
|
+
end
|
|
1377
|
+
|
|
1378
|
+
class TempfilePart < MimePart
|
|
1379
|
+
def file?: () -> true
|
|
1380
|
+
def close: () -> untyped
|
|
1381
|
+
end
|
|
1382
|
+
end
|
|
1383
|
+
end
|
|
1384
|
+
|
|
1385
|
+
class UploadedFile
|
|
1386
|
+
attr_reader original_filename: String?
|
|
1387
|
+
attr_accessor content_type: String
|
|
1388
|
+
def initialize: (?nil filepath, ?String ct, ?false bin, ?path: untyped, ?content_type: untyped, ?binary: untyped, ?filename: nil, ?io: nil) -> void
|
|
1389
|
+
def path: () -> nil
|
|
1390
|
+
def respond_to?: (*untyped args) -> bool
|
|
1391
|
+
def method_missing: (untyped method_name, *untyped args) -> untyped
|
|
1392
|
+
end
|
|
1393
|
+
|
|
1394
|
+
class Generator
|
|
1395
|
+
def initialize: (nil params, ?bool first) -> void
|
|
1396
|
+
def dump: () -> (Hash[bot, bot] | String)?
|
|
1397
|
+
|
|
1398
|
+
private
|
|
1399
|
+
|
|
1400
|
+
def multipart?: () -> untyped
|
|
1401
|
+
def flattened_params: () -> Hash[bot, bot]
|
|
1402
|
+
def content_for_tempfile: (File io, bot file, bot name) -> String
|
|
1403
|
+
def content_for_other: (bot file, bot name) -> String
|
|
1404
|
+
end
|
|
1405
|
+
end
|
|
1406
|
+
|
|
1407
|
+
class ETag
|
|
1408
|
+
ETAG_STRING: String
|
|
1409
|
+
DEFAULT_CACHE_CONTROL: String
|
|
1410
|
+
|
|
1411
|
+
def initialize: (untyped app, ?nil no_cache_control, ?String cache_control) -> void
|
|
1412
|
+
def call: (untyped env) -> [untyped, untyped, BodyProxy]
|
|
1413
|
+
|
|
1414
|
+
private
|
|
1415
|
+
|
|
1416
|
+
def etag_status?: (untyped status) -> untyped
|
|
1417
|
+
def etag_body?: (untyped body) -> untyped
|
|
1418
|
+
def skip_caching?: (untyped headers) -> untyped
|
|
1419
|
+
def digest_body: (untyped body) -> [nil, Array[bot]]
|
|
1420
|
+
end
|
|
1421
|
+
|
|
1422
|
+
class RewindableInput
|
|
1423
|
+
def initialize: (IO | String | StringIO io) -> void
|
|
1424
|
+
def gets: () -> String?
|
|
1425
|
+
def read: (*untyped args) -> untyped
|
|
1426
|
+
def each: () -> untyped
|
|
1427
|
+
def rewind: () -> untyped
|
|
1428
|
+
def close: () -> nil
|
|
1429
|
+
|
|
1430
|
+
private
|
|
1431
|
+
|
|
1432
|
+
def make_rewindable: () -> untyped
|
|
1433
|
+
def filesystem_has_posix_semantics?: () -> bool
|
|
1434
|
+
end
|
|
1435
|
+
|
|
1436
|
+
class MockRequest
|
|
1437
|
+
DEFAULT_ENV: env
|
|
1438
|
+
|
|
1439
|
+
def initialize: (_Application app) -> void
|
|
1440
|
+
def get: (?String uri, ?Hash[Symbol, untyped] opts) -> MockResponse
|
|
1441
|
+
def post: (?String uri, ?Hash[Symbol, untyped] opts) -> MockResponse
|
|
1442
|
+
def put: (?String uri, ?Hash[Symbol, untyped] opts) -> MockResponse
|
|
1443
|
+
def patch: (?String uri, ?Hash[Symbol, untyped] opts) -> MockResponse
|
|
1444
|
+
def delete: (?String uri, ?Hash[Symbol, untyped] opts) -> MockResponse
|
|
1445
|
+
def head: (?String uri, ?Hash[Symbol, untyped] opts) -> MockResponse
|
|
1446
|
+
def options: (?String uri, ?Hash[Symbol, untyped] opts) -> MockResponse
|
|
1447
|
+
def request: (?_ToS method, ?String uri, ?Hash[Symbol, untyped] opts) -> MockResponse
|
|
1448
|
+
def self.parse_uri_rfc2396: (String uri) -> URI::Generic
|
|
1449
|
+
def self.env_for: (?String uri, ?Hash[Symbol, untyped] opts) -> env
|
|
1450
|
+
|
|
1451
|
+
class FatalWarning < RuntimeError
|
|
1452
|
+
end
|
|
1453
|
+
|
|
1454
|
+
class FatalWarner
|
|
1455
|
+
def puts: (untyped warning) -> bot
|
|
1456
|
+
def write: (untyped warning) -> bot
|
|
1457
|
+
def flush: () -> nil
|
|
1458
|
+
def string: () -> ""
|
|
1459
|
+
end
|
|
1460
|
+
end
|
|
1461
|
+
|
|
1462
|
+
class MockResponse < Response
|
|
1463
|
+
alias self.[] self.new
|
|
1464
|
+
attr_reader original_headers: _Each[[String, String]]
|
|
1465
|
+
attr_reader cookies: Hash[String, CGI::Cookie]
|
|
1466
|
+
attr_accessor errors: String
|
|
1467
|
+
# FIXME: write SPEC-specified duck type for errors parameter
|
|
1468
|
+
def initialize: (_ToI status, _Each[[String, String]] headers, nil | _Each[String] | _ToStr body, ?untyped errors) -> void
|
|
1469
|
+
def =~: (untyped other) -> Integer?
|
|
1470
|
+
def match: (Regexp | string other) -> MatchData?
|
|
1471
|
+
def body: () -> String
|
|
1472
|
+
def empty?: () -> bool
|
|
1473
|
+
def cookie: (String name) -> CGI::Cookie?
|
|
1474
|
+
|
|
1475
|
+
private
|
|
1476
|
+
|
|
1477
|
+
def parse_cookies_from_header: () -> Hash[String, CGI::Cookie]
|
|
1478
|
+
def identify_cookie_attributes: (String cookie_filling) -> Hash[String, untyped]
|
|
1479
|
+
end
|
|
1480
|
+
end
|