wal 0.0.1 → 0.0.3

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 (115) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +0 -7
  3. data/lib/wal/noop_watcher.rb +0 -4
  4. data/lib/wal/record_watcher.rb +4 -58
  5. data/lib/wal/replicator.rb +2 -21
  6. data/lib/wal/streaming_watcher.rb +0 -9
  7. data/lib/wal/version.rb +1 -2
  8. data/lib/wal/watcher.rb +0 -25
  9. data/lib/wal.rb +9 -68
  10. data/rbi/wal.rbi +5 -85
  11. data/sig/wal.rbs +4 -4
  12. metadata +2 -161
  13. data/sorbet/config +0 -7
  14. data/sorbet/rbi/annotations/.gitattributes +0 -1
  15. data/sorbet/rbi/annotations/activemodel.rbi +0 -89
  16. data/sorbet/rbi/annotations/activerecord.rbi +0 -98
  17. data/sorbet/rbi/annotations/activesupport.rbi +0 -463
  18. data/sorbet/rbi/annotations/minitest.rbi +0 -119
  19. data/sorbet/rbi/annotations/rainbow.rbi +0 -269
  20. data/sorbet/rbi/gems/.gitattributes +0 -1
  21. data/sorbet/rbi/gems/actioncable@8.0.2.rbi +0 -9
  22. data/sorbet/rbi/gems/actionmailbox@8.0.2.rbi +0 -9
  23. data/sorbet/rbi/gems/actionmailer@8.0.2.rbi +0 -9
  24. data/sorbet/rbi/gems/actionpack@8.0.2.rbi +0 -21122
  25. data/sorbet/rbi/gems/actiontext@8.0.2.rbi +0 -9
  26. data/sorbet/rbi/gems/actionview@8.0.2.rbi +0 -16423
  27. data/sorbet/rbi/gems/activejob@8.0.2.rbi +0 -9
  28. data/sorbet/rbi/gems/activemodel@8.0.2.rbi +0 -6866
  29. data/sorbet/rbi/gems/activerecord@8.0.2.rbi +0 -43227
  30. data/sorbet/rbi/gems/activestorage@8.0.2.rbi +0 -9
  31. data/sorbet/rbi/gems/activesupport@8.0.2.rbi +0 -21110
  32. data/sorbet/rbi/gems/ast@2.4.3.rbi +0 -585
  33. data/sorbet/rbi/gems/base64@0.3.0.rbi +0 -545
  34. data/sorbet/rbi/gems/benchmark@0.4.1.rbi +0 -619
  35. data/sorbet/rbi/gems/bigdecimal@3.2.2.rbi +0 -78
  36. data/sorbet/rbi/gems/builder@3.3.0.rbi +0 -9
  37. data/sorbet/rbi/gems/commander@5.0.0.rbi +0 -9
  38. data/sorbet/rbi/gems/concurrent-ruby@1.3.5.rbi +0 -11657
  39. data/sorbet/rbi/gems/connection_pool@2.5.3.rbi +0 -9
  40. data/sorbet/rbi/gems/crass@1.0.6.rbi +0 -623
  41. data/sorbet/rbi/gems/date@3.4.1.rbi +0 -75
  42. data/sorbet/rbi/gems/diff-lcs@1.6.2.rbi +0 -1134
  43. data/sorbet/rbi/gems/docker-api@2.4.0.rbi +0 -1719
  44. data/sorbet/rbi/gems/docopt@0.6.1.rbi +0 -9
  45. data/sorbet/rbi/gems/drb@2.2.3.rbi +0 -1661
  46. data/sorbet/rbi/gems/erubi@1.13.1.rbi +0 -155
  47. data/sorbet/rbi/gems/excon@1.2.7.rbi +0 -1514
  48. data/sorbet/rbi/gems/globalid@1.2.1.rbi +0 -9
  49. data/sorbet/rbi/gems/highline@3.0.1.rbi +0 -9
  50. data/sorbet/rbi/gems/i18n@1.14.7.rbi +0 -2359
  51. data/sorbet/rbi/gems/io-console@0.8.0.rbi +0 -9
  52. data/sorbet/rbi/gems/logger@1.7.0.rbi +0 -963
  53. data/sorbet/rbi/gems/loofah@2.24.1.rbi +0 -1105
  54. data/sorbet/rbi/gems/mail@2.8.1.rbi +0 -9
  55. data/sorbet/rbi/gems/marcel@1.0.4.rbi +0 -9
  56. data/sorbet/rbi/gems/mini_mime@1.1.5.rbi +0 -9
  57. data/sorbet/rbi/gems/minitest@5.25.5.rbi +0 -1704
  58. data/sorbet/rbi/gems/multi_json@1.15.0.rbi +0 -268
  59. data/sorbet/rbi/gems/net-imap@0.5.9.rbi +0 -9
  60. data/sorbet/rbi/gems/net-pop@0.1.2.rbi +0 -9
  61. data/sorbet/rbi/gems/net-protocol@0.2.2.rbi +0 -292
  62. data/sorbet/rbi/gems/net-smtp@0.5.1.rbi +0 -9
  63. data/sorbet/rbi/gems/netrc@0.11.0.rbi +0 -159
  64. data/sorbet/rbi/gems/nio4r@2.7.4.rbi +0 -9
  65. data/sorbet/rbi/gems/nokogiri@1.18.8.rbi +0 -8206
  66. data/sorbet/rbi/gems/ostruct@0.6.2.rbi +0 -354
  67. data/sorbet/rbi/gems/parallel@1.27.0.rbi +0 -291
  68. data/sorbet/rbi/gems/parlour@9.1.1.rbi +0 -3071
  69. data/sorbet/rbi/gems/parser@3.3.8.0.rbi +0 -7338
  70. data/sorbet/rbi/gems/pg-replication-protocol@0.0.7.rbi +0 -633
  71. data/sorbet/rbi/gems/pg@1.5.9.rbi +0 -2806
  72. data/sorbet/rbi/gems/pp@0.6.2.rbi +0 -368
  73. data/sorbet/rbi/gems/prettyprint@0.2.0.rbi +0 -477
  74. data/sorbet/rbi/gems/prism@1.4.0.rbi +0 -41732
  75. data/sorbet/rbi/gems/psych@5.2.3.rbi +0 -2435
  76. data/sorbet/rbi/gems/racc@1.8.1.rbi +0 -160
  77. data/sorbet/rbi/gems/rack-session@2.1.1.rbi +0 -727
  78. data/sorbet/rbi/gems/rack-test@2.2.0.rbi +0 -734
  79. data/sorbet/rbi/gems/rack@3.1.16.rbi +0 -4940
  80. data/sorbet/rbi/gems/rackup@2.2.1.rbi +0 -230
  81. data/sorbet/rbi/gems/rails-dom-testing@2.3.0.rbi +0 -858
  82. data/sorbet/rbi/gems/rails-html-sanitizer@1.6.2.rbi +0 -785
  83. data/sorbet/rbi/gems/rails@8.0.2.rbi +0 -9
  84. data/sorbet/rbi/gems/railties@8.0.2.rbi +0 -3865
  85. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +0 -403
  86. data/sorbet/rbi/gems/rake@13.2.1.rbi +0 -3120
  87. data/sorbet/rbi/gems/rbi@0.3.6.rbi +0 -6893
  88. data/sorbet/rbi/gems/rbs@3.9.4.rbi +0 -6978
  89. data/sorbet/rbi/gems/rdoc@6.12.0.rbi +0 -12760
  90. data/sorbet/rbi/gems/reline@0.6.0.rbi +0 -2451
  91. data/sorbet/rbi/gems/rexml@3.4.1.rbi +0 -5240
  92. data/sorbet/rbi/gems/rspec-core@3.13.4.rbi +0 -11348
  93. data/sorbet/rbi/gems/rspec-expectations@3.13.5.rbi +0 -8189
  94. data/sorbet/rbi/gems/rspec-mocks@3.13.5.rbi +0 -5350
  95. data/sorbet/rbi/gems/rspec-sorbet@1.9.2.rbi +0 -164
  96. data/sorbet/rbi/gems/rspec-support@3.13.4.rbi +0 -1630
  97. data/sorbet/rbi/gems/rspec@3.13.1.rbi +0 -83
  98. data/sorbet/rbi/gems/securerandom@0.4.1.rbi +0 -75
  99. data/sorbet/rbi/gems/spoom@1.6.3.rbi +0 -6985
  100. data/sorbet/rbi/gems/stringio@3.1.5.rbi +0 -9
  101. data/sorbet/rbi/gems/tapioca@0.16.11.rbi +0 -3628
  102. data/sorbet/rbi/gems/testcontainers-core@0.2.0.rbi +0 -1005
  103. data/sorbet/rbi/gems/testcontainers-postgres@0.2.0.rbi +0 -145
  104. data/sorbet/rbi/gems/thor@1.3.2.rbi +0 -4378
  105. data/sorbet/rbi/gems/timeout@0.4.3.rbi +0 -157
  106. data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +0 -5918
  107. data/sorbet/rbi/gems/uri@1.0.3.rbi +0 -2349
  108. data/sorbet/rbi/gems/useragent@0.16.11.rbi +0 -9
  109. data/sorbet/rbi/gems/websocket-driver@0.8.0.rbi +0 -9
  110. data/sorbet/rbi/gems/websocket-extensions@0.1.5.rbi +0 -9
  111. data/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +0 -435
  112. data/sorbet/rbi/gems/yard@0.9.37.rbi +0 -18379
  113. data/sorbet/rbi/gems/zeitwerk@2.7.3.rbi +0 -9
  114. data/sorbet/tapioca/config.yml +0 -5
  115. data/sorbet/tapioca/require.rb +0 -12
@@ -1,4940 +0,0 @@
1
- # typed: true
2
-
3
- # DO NOT EDIT MANUALLY
4
- # This is an autogenerated file for types exported from the `rack` gem.
5
- # Please instead update this file by running `bin/tapioca gem rack`.
6
-
7
-
8
- # The Rack main module, serving as a namespace for all core Rack
9
- # modules and classes.
10
- #
11
- # All modules meant for use in your application are <tt>autoload</tt>ed here,
12
- # so it should be enough just to <tt>require 'rack'</tt> in your code.
13
- #
14
- # source://rack//lib/rack/version.rb#14
15
- module Rack
16
- class << self
17
- # Return the Rack release as a dotted string.
18
- #
19
- # source://rack//lib/rack/version.rb#18
20
- def release; end
21
- end
22
- end
23
-
24
- # source://rack//lib/rack.rb#60
25
- module Rack::Auth; end
26
-
27
- # Rack::Auth::AbstractHandler implements common authentication functionality.
28
- #
29
- # +realm+ should be set for all handlers.
30
- #
31
- # source://rack//lib/rack/auth/abstract/handler.rb#11
32
- class Rack::Auth::AbstractHandler
33
- # @return [AbstractHandler] a new instance of AbstractHandler
34
- #
35
- # source://rack//lib/rack/auth/abstract/handler.rb#15
36
- def initialize(app, realm = T.unsafe(nil), &authenticator); end
37
-
38
- # Returns the value of attribute realm.
39
- #
40
- # source://rack//lib/rack/auth/abstract/handler.rb#13
41
- def realm; end
42
-
43
- # Sets the attribute realm
44
- #
45
- # @param value the value to set the attribute realm to.
46
- #
47
- # source://rack//lib/rack/auth/abstract/handler.rb#13
48
- def realm=(_arg0); end
49
-
50
- private
51
-
52
- # source://rack//lib/rack/auth/abstract/handler.rb#31
53
- def bad_request; end
54
-
55
- # source://rack//lib/rack/auth/abstract/handler.rb#22
56
- def unauthorized(www_authenticate = T.unsafe(nil)); end
57
- end
58
-
59
- # source://rack//lib/rack/auth/abstract/request.rb#7
60
- class Rack::Auth::AbstractRequest
61
- # @return [AbstractRequest] a new instance of AbstractRequest
62
- #
63
- # source://rack//lib/rack/auth/abstract/request.rb#9
64
- def initialize(env); end
65
-
66
- # source://rack//lib/rack/auth/abstract/request.rb#33
67
- def params; end
68
-
69
- # source://rack//lib/rack/auth/abstract/request.rb#25
70
- def parts; end
71
-
72
- # @return [Boolean]
73
- #
74
- # source://rack//lib/rack/auth/abstract/request.rb#17
75
- def provided?; end
76
-
77
- # source://rack//lib/rack/auth/abstract/request.rb#13
78
- def request; end
79
-
80
- # source://rack//lib/rack/auth/abstract/request.rb#29
81
- def scheme; end
82
-
83
- # @return [Boolean]
84
- #
85
- # source://rack//lib/rack/auth/abstract/request.rb#21
86
- def valid?; end
87
-
88
- private
89
-
90
- # source://rack//lib/rack/auth/abstract/request.rb#42
91
- def authorization_key; end
92
- end
93
-
94
- # source://rack//lib/rack/auth/abstract/request.rb#40
95
- Rack::Auth::AbstractRequest::AUTHORIZATION_KEYS = T.let(T.unsafe(nil), Array)
96
-
97
- # Rack::Auth::Basic implements HTTP Basic Authentication, as per RFC 2617.
98
- #
99
- # Initialize with the Rack application that you want protecting,
100
- # and a block that checks if a username and password pair are valid.
101
- #
102
- # source://rack//lib/rack/auth/basic.rb#13
103
- class Rack::Auth::Basic < ::Rack::Auth::AbstractHandler
104
- # source://rack//lib/rack/auth/basic.rb#15
105
- def call(env); end
106
-
107
- private
108
-
109
- # source://rack//lib/rack/auth/basic.rb#34
110
- def challenge; end
111
-
112
- # @return [Boolean]
113
- #
114
- # source://rack//lib/rack/auth/basic.rb#38
115
- def valid?(auth); end
116
- end
117
-
118
- # source://rack//lib/rack/auth/basic.rb#42
119
- class Rack::Auth::Basic::Request < ::Rack::Auth::AbstractRequest
120
- # @return [Boolean]
121
- #
122
- # source://rack//lib/rack/auth/basic.rb#43
123
- def basic?; end
124
-
125
- # source://rack//lib/rack/auth/basic.rb#47
126
- def credentials; end
127
-
128
- # source://rack//lib/rack/auth/basic.rb#51
129
- def username; end
130
- end
131
-
132
- # source://rack//lib/rack/builder.rb#6
133
- Rack::BUILDER_TOPLEVEL_BINDING = T.let(T.unsafe(nil), Proc)
134
-
135
- # Represents a 400 Bad Request error when input data fails to meet the
136
- # requirements.
137
- #
138
- # source://rack//lib/rack/bad_request.rb#6
139
- module Rack::BadRequest; end
140
-
141
- # Proxy for response bodies allowing calling a block when
142
- # the response body is closed (after the response has been fully
143
- # sent to the client).
144
- #
145
- # source://rack//lib/rack/body_proxy.rb#7
146
- class Rack::BodyProxy
147
- # Set the response body to wrap, and the block to call when the
148
- # response has been fully sent.
149
- #
150
- # @return [BodyProxy] a new instance of BodyProxy
151
- #
152
- # source://rack//lib/rack/body_proxy.rb#10
153
- def initialize(body, &block); end
154
-
155
- # If not already closed, close the wrapped body and
156
- # then call the block the proxy was initialized with.
157
- #
158
- # source://rack//lib/rack/body_proxy.rb#28
159
- def close; end
160
-
161
- # Whether the proxy is closed. The proxy starts as not closed,
162
- # and becomes closed on the first call to close.
163
- #
164
- # @return [Boolean]
165
- #
166
- # source://rack//lib/rack/body_proxy.rb#40
167
- def closed?; end
168
-
169
- # Delegate missing methods to the wrapped body.
170
- #
171
- # source://rack//lib/rack/body_proxy.rb#45
172
- def method_missing(method_name, *args, **_arg2, &block); end
173
-
174
- private
175
-
176
- # Return whether the wrapped body responds to the method.
177
- #
178
- # @return [Boolean]
179
- #
180
- # source://rack//lib/rack/body_proxy.rb#17
181
- def respond_to_missing?(method_name, include_all = T.unsafe(nil)); end
182
- end
183
-
184
- # Rack::Builder provides a domain-specific language (DSL) to construct Rack
185
- # applications. It is primarily used to parse +config.ru+ files which
186
- # instantiate several middleware and a final application which are hosted
187
- # by a Rack-compatible web server.
188
- #
189
- # Example:
190
- #
191
- # app = Rack::Builder.new do
192
- # use Rack::CommonLogger
193
- # map "/ok" do
194
- # run lambda { |env| [200, {'content-type' => 'text/plain'}, ['OK']] }
195
- # end
196
- # end
197
- #
198
- # run app
199
- #
200
- # Or
201
- #
202
- # app = Rack::Builder.app do
203
- # use Rack::CommonLogger
204
- # run lambda { |env| [200, {'content-type' => 'text/plain'}, ['OK']] }
205
- # end
206
- #
207
- # run app
208
- #
209
- # +use+ adds middleware to the stack, +run+ dispatches to an application.
210
- # You can use +map+ to construct a Rack::URLMap in a convenient way.
211
- #
212
- # source://rack//lib/rack/builder.rb#36
213
- class Rack::Builder
214
- # Initialize a new Rack::Builder instance. +default_app+ specifies the
215
- # default application if +run+ is not called later. If a block
216
- # is given, it is evaluated in the context of the instance.
217
- #
218
- # @return [Builder] a new instance of Builder
219
- #
220
- # source://rack//lib/rack/builder.rb#116
221
- def initialize(default_app = T.unsafe(nil), **options, &block); end
222
-
223
- # Call the Rack application generated by this builder instance. Note that
224
- # this rebuilds the Rack application and runs the warmup code (if any)
225
- # every time it is called, so it should not be used if performance is important.
226
- #
227
- # source://rack//lib/rack/builder.rb#276
228
- def call(env); end
229
-
230
- # Freeze the app (set using run) and all middleware instances when building the application
231
- # in to_app.
232
- #
233
- # source://rack//lib/rack/builder.rb#259
234
- def freeze_app; end
235
-
236
- # Creates a route within the application. Routes under the mapped path will be sent to
237
- # the Rack application specified by run inside the block. Other requests will be sent to the
238
- # default application specified by run outside the block.
239
- #
240
- # class App
241
- # def call(env)
242
- # [200, {'content-type' => 'text/plain'}, ["Hello World"]]
243
- # end
244
- # end
245
- #
246
- # class Heartbeat
247
- # def call(env)
248
- # [200, { "content-type" => "text/plain" }, ["OK"]]
249
- # end
250
- # end
251
- #
252
- # app = Rack::Builder.app do
253
- # map '/heartbeat' do
254
- # run Heartbeat.new
255
- # end
256
- # run App.new
257
- # end
258
- #
259
- # run app
260
- #
261
- # The +use+ method can also be used inside the block to specify middleware to run under a specific path:
262
- #
263
- # app = Rack::Builder.app do
264
- # map '/heartbeat' do
265
- # use Middleware
266
- # run Heartbeat.new
267
- # end
268
- # run App.new
269
- # end
270
- #
271
- # This example includes a piece of middleware which will run before +/heartbeat+ requests hit +Heartbeat+.
272
- #
273
- # Note that providing a +path+ of +/+ will ignore any default application given in a +run+ statement
274
- # outside the block.
275
- #
276
- # source://rack//lib/rack/builder.rb#252
277
- def map(path, &block); end
278
-
279
- # Any options provided to the Rack::Builder instance at initialization.
280
- # These options can be server-specific. Some general options are:
281
- #
282
- # * +:isolation+: One of +process+, +thread+ or +fiber+. The execution
283
- # isolation model to use.
284
- #
285
- # source://rack//lib/rack/builder.rb#132
286
- def options; end
287
-
288
- # Takes a block or argument that is an object that responds to #call and
289
- # returns a Rack response.
290
- #
291
- # You can use a block:
292
- #
293
- # run do |env|
294
- # [200, { "content-type" => "text/plain" }, ["Hello World!"]]
295
- # end
296
- #
297
- # You can also provide a lambda:
298
- #
299
- # run lambda { |env| [200, { "content-type" => "text/plain" }, ["OK"]] }
300
- #
301
- # You can also provide a class instance:
302
- #
303
- # class Heartbeat
304
- # def call(env)
305
- # [200, { "content-type" => "text/plain" }, ["OK"]]
306
- # end
307
- # end
308
- #
309
- # run Heartbeat.new
310
- #
311
- # @raise [ArgumentError]
312
- #
313
- # source://rack//lib/rack/builder.rb#193
314
- def run(app = T.unsafe(nil), &block); end
315
-
316
- # Return the Rack application generated by this instance.
317
- #
318
- # source://rack//lib/rack/builder.rb#264
319
- def to_app; end
320
-
321
- # Specifies middleware to use in a stack.
322
- #
323
- # class Middleware
324
- # def initialize(app)
325
- # @app = app
326
- # end
327
- #
328
- # def call(env)
329
- # env["rack.some_header"] = "setting an example"
330
- # @app.call(env)
331
- # end
332
- # end
333
- #
334
- # use Middleware
335
- # run lambda { |env| [200, { "content-type" => "text/plain" }, ["OK"]] }
336
- #
337
- # All requests through to this application will first be processed by the middleware class.
338
- # The +call+ method in this example sets an additional environment key which then can be
339
- # referenced in the application if required.
340
- #
341
- # source://rack//lib/rack/builder.rb#159
342
- def use(middleware, *args, **_arg2, &block); end
343
-
344
- # Takes a lambda or block that is used to warm-up the application. This block is called
345
- # before the Rack application is returned by to_app.
346
- #
347
- # warmup do |app|
348
- # client = Rack::MockRequest.new(app)
349
- # client.get('/')
350
- # end
351
- #
352
- # use SomeMiddleware
353
- # run MyApp
354
- #
355
- # source://rack//lib/rack/builder.rb#209
356
- def warmup(prc = T.unsafe(nil), &block); end
357
-
358
- private
359
-
360
- # Generate a URLMap instance by generating new Rack applications for each
361
- # map block in this instance.
362
- #
363
- # source://rack//lib/rack/builder.rb#284
364
- def generate_map(default_app, mapping); end
365
-
366
- class << self
367
- # Create a new Rack::Builder instance and return the Rack application
368
- # generated from it.
369
- #
370
- # source://rack//lib/rack/builder.rb#136
371
- def app(default_app = T.unsafe(nil), &block); end
372
-
373
- # Load the given file as a rackup file, treating the
374
- # contents as if specified inside a Rack::Builder block.
375
- #
376
- # Ignores content in the file after +__END__+, so that
377
- # use of +__END__+ will not result in a syntax error.
378
- #
379
- # Example config.ru file:
380
- #
381
- # $ cat config.ru
382
- #
383
- # use Rack::ContentLength
384
- # require './app.rb'
385
- # run App
386
- #
387
- # source://rack//lib/rack/builder.rb#87
388
- def load_file(path, **options); end
389
-
390
- # Evaluate the given +builder_script+ string in the context of
391
- # a Rack::Builder block, returning a Rack application.
392
- #
393
- # source://rack//lib/rack/builder.rb#102
394
- def new_from_string(builder_script, path = T.unsafe(nil), **options); end
395
-
396
- # Parse the given config file to get a Rack application.
397
- #
398
- # If the config file ends in +.ru+, it is treated as a
399
- # rackup file and the contents will be treated as if
400
- # specified inside a Rack::Builder block.
401
- #
402
- # If the config file does not end in +.ru+, it is
403
- # required and Rack will use the basename of the file
404
- # to guess which constant will be the Rack application to run.
405
- #
406
- # Examples:
407
- #
408
- # Rack::Builder.parse_file('config.ru')
409
- # # Rack application built using Rack::Builder.new
410
- #
411
- # Rack::Builder.parse_file('app.rb')
412
- # # requires app.rb, which can be anywhere in Ruby's
413
- # # load path. After requiring, assumes App constant
414
- # # is a Rack application
415
- #
416
- # Rack::Builder.parse_file('./my_app.rb')
417
- # # requires ./my_app.rb, which should be in the
418
- # # process's current directory. After requiring,
419
- # # assumes MyApp constant is a Rack application
420
- #
421
- # source://rack//lib/rack/builder.rb#65
422
- def parse_file(path, **options); end
423
- end
424
- end
425
-
426
- # https://stackoverflow.com/questions/2223882/whats-the-difference-between-utf-8-and-utf-8-without-bom
427
- #
428
- # source://rack//lib/rack/builder.rb#39
429
- Rack::Builder::UTF_8_BOM = T.let(T.unsafe(nil), String)
430
-
431
- # Response Header Keys
432
- #
433
- # source://rack//lib/rack/constants.rb#19
434
- Rack::CACHE_CONTROL = T.let(T.unsafe(nil), String)
435
-
436
- # source://rack//lib/rack/constants.rb#35
437
- Rack::CONNECT = T.let(T.unsafe(nil), String)
438
-
439
- # source://rack//lib/rack/constants.rb#20
440
- Rack::CONTENT_LENGTH = T.let(T.unsafe(nil), String)
441
-
442
- # source://rack//lib/rack/constants.rb#21
443
- Rack::CONTENT_TYPE = T.let(T.unsafe(nil), String)
444
-
445
- # Rack::Cascade tries a request on several apps, and returns the
446
- # first response that is not 404 or 405 (or in a list of configured
447
- # status codes). If all applications tried return one of the configured
448
- # status codes, return the last response.
449
- #
450
- # source://rack//lib/rack/cascade.rb#11
451
- class Rack::Cascade
452
- # Set the apps to send requests to, and what statuses result in
453
- # cascading. Arguments:
454
- #
455
- # apps: An enumerable of rack applications.
456
- # cascade_for: The statuses to use cascading for. If a response is received
457
- # from an app, the next app is tried.
458
- #
459
- # @return [Cascade] a new instance of Cascade
460
- #
461
- # source://rack//lib/rack/cascade.rb#21
462
- def initialize(apps, cascade_for = T.unsafe(nil)); end
463
-
464
- # Append an app to the list of apps to cascade. This app will
465
- # be tried last.
466
- #
467
- # source://rack//lib/rack/cascade.rb#56
468
- def <<(app); end
469
-
470
- # Append an app to the list of apps to cascade. This app will
471
- # be tried last.
472
- #
473
- # source://rack//lib/rack/cascade.rb#56
474
- def add(app); end
475
-
476
- # An array of applications to try in order.
477
- #
478
- # source://rack//lib/rack/cascade.rb#13
479
- def apps; end
480
-
481
- # Call each app in order. If the responses uses a status that requires
482
- # cascading, try the next app. If all responses require cascading,
483
- # return the response from the last app.
484
- #
485
- # source://rack//lib/rack/cascade.rb#32
486
- def call(env); end
487
-
488
- # Whether the given app is one of the apps to cascade to.
489
- #
490
- # @return [Boolean]
491
- #
492
- # source://rack//lib/rack/cascade.rb#61
493
- def include?(app); end
494
- end
495
-
496
- # Rack::CommonLogger forwards every request to the given +app+, and
497
- # logs a line in the
498
- # {Apache common log format}[http://httpd.apache.org/docs/1.3/logs.html#common]
499
- # to the configured logger.
500
- #
501
- # source://rack//lib/rack/common_logger.rb#13
502
- class Rack::CommonLogger
503
- # +logger+ can be any object that supports the +write+ or +<<+ methods,
504
- # which includes the standard library Logger. These methods are called
505
- # with a single string argument, the log message.
506
- # If +logger+ is nil, CommonLogger will fall back <tt>env['rack.errors']</tt>.
507
- #
508
- # @return [CommonLogger] a new instance of CommonLogger
509
- #
510
- # source://rack//lib/rack/common_logger.rb#29
511
- def initialize(app, logger = T.unsafe(nil)); end
512
-
513
- # Log all requests in common_log format after a response has been
514
- # returned. Note that if the app raises an exception, the request
515
- # will not be logged, so if exception handling middleware are used,
516
- # they should be loaded after this middleware. Additionally, because
517
- # the logging happens after the request body has been fully sent, any
518
- # exceptions raised during the sending of the response body will
519
- # cause the request not to be logged.
520
- #
521
- # source://rack//lib/rack/common_logger.rb#41
522
- def call(env); end
523
-
524
- private
525
-
526
- # Attempt to determine the content length for the response to
527
- # include it in the logged data.
528
- #
529
- # source://rack//lib/rack/common_logger.rb#84
530
- def extract_content_length(headers); end
531
-
532
- # Log the request to the configured logger.
533
- #
534
- # source://rack//lib/rack/common_logger.rb#52
535
- def log(env, status, response_headers, began_at); end
536
- end
537
-
538
- # Common Log Format: http://httpd.apache.org/docs/1.3/logs.html#common
539
- #
540
- # lilith.local - - [07/Aug/2006 23:58:02 -0400] "GET / HTTP/1.1" 500 -
541
- #
542
- # %{%s - %s [%s] "%s %s%s %s" %d %s\n} %
543
- #
544
- # The actual format is slightly different than the above due to the
545
- # separation of SCRIPT_NAME and PATH_INFO, and because the elapsed
546
- # time in seconds is included at the end.
547
- #
548
- # source://rack//lib/rack/common_logger.rb#23
549
- Rack::CommonLogger::FORMAT = T.let(T.unsafe(nil), String)
550
-
551
- # Middleware that enables conditional GET using if-none-match and
552
- # if-modified-since. The application should set either or both of the
553
- # last-modified or etag response headers according to RFC 2616. When
554
- # either of the conditions is met, the response body is set to be zero
555
- # length and the response status is set to 304 Not Modified.
556
- #
557
- # Applications that defer response body generation until the body's each
558
- # message is received will avoid response body generation completely when
559
- # a conditional GET matches.
560
- #
561
- # Adapted from Michael Klishin's Merb implementation:
562
- # https://github.com/wycats/merb/blob/master/merb-core/lib/merb-core/rack/middleware/conditional_get.rb
563
- #
564
- # source://rack//lib/rack/conditional_get.rb#21
565
- class Rack::ConditionalGet
566
- # @return [ConditionalGet] a new instance of ConditionalGet
567
- #
568
- # source://rack//lib/rack/conditional_get.rb#22
569
- def initialize(app); end
570
-
571
- # Return empty 304 response if the response has not been
572
- # modified since the last request.
573
- #
574
- # source://rack//lib/rack/conditional_get.rb#28
575
- def call(env); end
576
-
577
- private
578
-
579
- # Whether the etag response header matches the if-none-match request header.
580
- # If so, the request has not been modified.
581
- #
582
- # @return [Boolean]
583
- #
584
- # source://rack//lib/rack/conditional_get.rb#62
585
- def etag_matches?(none_match, headers); end
586
-
587
- # Return whether the response has not been modified since the
588
- # last request.
589
- #
590
- # @return [Boolean]
591
- #
592
- # source://rack//lib/rack/conditional_get.rb#51
593
- def fresh?(env, headers); end
594
-
595
- # Whether the last-modified response header matches the if-modified-since
596
- # request header. If so, the request has not been modified.
597
- #
598
- # @return [Boolean]
599
- #
600
- # source://rack//lib/rack/conditional_get.rb#68
601
- def modified_since?(modified_since, headers); end
602
-
603
- # Return a Time object for the given string (which should be in RFC2822
604
- # format), or nil if the string cannot be parsed.
605
- #
606
- # source://rack//lib/rack/conditional_get.rb#75
607
- def to_rfc2822(since); end
608
- end
609
-
610
- # Rack::Config modifies the environment using the block given during
611
- # initialization.
612
- #
613
- # Example:
614
- # use Rack::Config do |env|
615
- # env['my-key'] = 'some-value'
616
- # end
617
- #
618
- # source://rack//lib/rack/config.rb#11
619
- class Rack::Config
620
- # @return [Config] a new instance of Config
621
- #
622
- # source://rack//lib/rack/config.rb#12
623
- def initialize(app, &block); end
624
-
625
- # source://rack//lib/rack/config.rb#17
626
- def call(env); end
627
- end
628
-
629
- # Sets the content-length header on responses that do not specify
630
- # a content-length or transfer-encoding header. Note that this
631
- # does not fix responses that have an invalid content-length
632
- # header specified.
633
- #
634
- # source://rack//lib/rack/content_length.rb#12
635
- class Rack::ContentLength
636
- include ::Rack::Utils
637
-
638
- # @return [ContentLength] a new instance of ContentLength
639
- #
640
- # source://rack//lib/rack/content_length.rb#15
641
- def initialize(app); end
642
-
643
- # source://rack//lib/rack/content_length.rb#19
644
- def call(env); end
645
- end
646
-
647
- # Sets the content-type header on responses which don't have one.
648
- #
649
- # Builder Usage:
650
- # use Rack::ContentType, "text/plain"
651
- #
652
- # When no content type argument is provided, "text/html" is the
653
- # default.
654
- #
655
- # source://rack//lib/rack/content_type.rb#15
656
- class Rack::ContentType
657
- include ::Rack::Utils
658
-
659
- # @return [ContentType] a new instance of ContentType
660
- #
661
- # source://rack//lib/rack/content_type.rb#18
662
- def initialize(app, content_type = T.unsafe(nil)); end
663
-
664
- # source://rack//lib/rack/content_type.rb#23
665
- def call(env); end
666
- end
667
-
668
- # source://rack//lib/rack/constants.rb#32
669
- Rack::DELETE = T.let(T.unsafe(nil), String)
670
-
671
- # This middleware enables content encoding of http responses,
672
- # usually for purposes of compression.
673
- #
674
- # Currently supported encodings:
675
- #
676
- # * gzip
677
- # * identity (no transformation)
678
- #
679
- # This middleware automatically detects when encoding is supported
680
- # and allowed. For example no encoding is made when a cache
681
- # directive of 'no-transform' is present, when the response status
682
- # code is one that doesn't allow an entity body, or when the body
683
- # is empty.
684
- #
685
- # Note that despite the name, Deflater does not support the +deflate+
686
- # encoding.
687
- #
688
- # source://rack//lib/rack/deflater.rb#28
689
- class Rack::Deflater
690
- # Creates Rack::Deflater middleware. Options:
691
- #
692
- # :if :: a lambda enabling / disabling deflation based on returned boolean value
693
- # (e.g <tt>use Rack::Deflater, :if => lambda { |*, body| sum=0; body.each { |i| sum += i.length }; sum > 512 }</tt>).
694
- # However, be aware that calling `body.each` inside the block will break cases where `body.each` is not idempotent,
695
- # such as when it is an +IO+ instance.
696
- # :include :: a list of content types that should be compressed. By default, all content types are compressed.
697
- # :sync :: determines if the stream is going to be flushed after every chunk. Flushing after every chunk reduces
698
- # latency for time-sensitive streaming applications, but hurts compression and throughput.
699
- # Defaults to +true+.
700
- #
701
- # @return [Deflater] a new instance of Deflater
702
- #
703
- # source://rack//lib/rack/deflater.rb#39
704
- def initialize(app, options = T.unsafe(nil)); end
705
-
706
- # source://rack//lib/rack/deflater.rb#46
707
- def call(env); end
708
-
709
- private
710
-
711
- # Whether the body should be compressed.
712
- #
713
- # @return [Boolean]
714
- #
715
- # source://rack//lib/rack/deflater.rb#136
716
- def should_deflate?(env, status, headers, body); end
717
- end
718
-
719
- # Body class used for gzip encoded responses.
720
- #
721
- # source://rack//lib/rack/deflater.rb#83
722
- class Rack::Deflater::GzipStream
723
- # Initialize the gzip stream. Arguments:
724
- # body :: Response body to compress with gzip
725
- # mtime :: The modification time of the body, used to set the
726
- # modification time in the gzip header.
727
- # sync :: Whether to flush each gzip chunk as soon as it is ready.
728
- #
729
- # @return [GzipStream] a new instance of GzipStream
730
- #
731
- # source://rack//lib/rack/deflater.rb#92
732
- def initialize(body, mtime, sync); end
733
-
734
- # Close the original body if possible.
735
- #
736
- # source://rack//lib/rack/deflater.rb#128
737
- def close; end
738
-
739
- # Yield gzip compressed strings to the given block.
740
- #
741
- # source://rack//lib/rack/deflater.rb#99
742
- def each(&block); end
743
-
744
- # Call the block passed to #each with the gzipped data.
745
- #
746
- # source://rack//lib/rack/deflater.rb#123
747
- def write(data); end
748
- end
749
-
750
- # source://rack//lib/rack/deflater.rb#85
751
- Rack::Deflater::GzipStream::BUFFER_LENGTH = T.let(T.unsafe(nil), Integer)
752
-
753
- # Rack::Directory serves entries below the +root+ given, according to the
754
- # path info of the Rack request. If a directory is found, the file's contents
755
- # will be presented in an html based index. If a file is found, the env will
756
- # be passed to the specified +app+.
757
- #
758
- # If +app+ is not specified, a Rack::Files of the same +root+ will be used.
759
- #
760
- # source://rack//lib/rack/directory.rb#19
761
- class Rack::Directory
762
- # Set the root directory and application for serving files.
763
- #
764
- # @return [Directory] a new instance of Directory
765
- #
766
- # source://rack//lib/rack/directory.rb#83
767
- def initialize(root, app = T.unsafe(nil)); end
768
-
769
- # source://rack//lib/rack/directory.rb#89
770
- def call(env); end
771
-
772
- # Rack response to use for requests with invalid paths, or nil if path is valid.
773
- #
774
- # source://rack//lib/rack/directory.rb#109
775
- def check_bad_request(path_info); end
776
-
777
- # Rack response to use for requests with paths outside the root, or nil if path is inside the root.
778
- #
779
- # source://rack//lib/rack/directory.rb#119
780
- def check_forbidden(path_info); end
781
-
782
- # Rack response to use for unreadable and non-file, non-directory entries.
783
- #
784
- # source://rack//lib/rack/directory.rb#181
785
- def entity_not_found(path_info); end
786
-
787
- # Provide human readable file sizes
788
- #
789
- # source://rack//lib/rack/directory.rb#197
790
- def filesize_format(int); end
791
-
792
- # Internals of request handling. Similar to call but does
793
- # not remove body for HEAD requests.
794
- #
795
- # source://rack//lib/rack/directory.rb#96
796
- def get(env); end
797
-
798
- # Rack response to use for directories under the root.
799
- #
800
- # source://rack//lib/rack/directory.rb#130
801
- def list_directory(path_info, path, script_name); end
802
-
803
- # Rack response to use for files and directories under the root.
804
- # Unreadable and non-file, non-directory entries will get a 404 response.
805
- #
806
- # source://rack//lib/rack/directory.rb#171
807
- def list_path(env, path, path_info, script_name); end
808
-
809
- # The root of the directory hierarchy. Only requests for files and
810
- # directories inside of the root directory are supported.
811
- #
812
- # source://rack//lib/rack/directory.rb#80
813
- def root; end
814
-
815
- # File::Stat for the given path, but return nil for missing/bad entries.
816
- #
817
- # source://rack//lib/rack/directory.rb#163
818
- def stat(path); end
819
- end
820
-
821
- # source://rack//lib/rack/directory.rb#20
822
- Rack::Directory::DIR_FILE = T.let(T.unsafe(nil), String)
823
-
824
- # source://rack//lib/rack/directory.rb#43
825
- Rack::Directory::DIR_PAGE_FOOTER = T.let(T.unsafe(nil), String)
826
-
827
- # source://rack//lib/rack/directory.rb#21
828
- Rack::Directory::DIR_PAGE_HEADER = T.let(T.unsafe(nil), String)
829
-
830
- # Body class for directory entries, showing an index page with links
831
- # to each file.
832
- #
833
- # source://rack//lib/rack/directory.rb#51
834
- class Rack::Directory::DirectoryBody < ::Struct
835
- # Yield strings for each part of the directory entry
836
- #
837
- # @yield [DIR_PAGE_HEADER % [ show_path, show_path ]]
838
- #
839
- # source://rack//lib/rack/directory.rb#53
840
- def each; end
841
-
842
- private
843
-
844
- # Escape each element in the array of html strings.
845
- #
846
- # source://rack//lib/rack/directory.rb#73
847
- def DIR_FILE_escape(htmls); end
848
- end
849
-
850
- # Stolen from Ramaze
851
- #
852
- # source://rack//lib/rack/directory.rb#189
853
- Rack::Directory::FILESIZE_FORMAT = T.let(T.unsafe(nil), Array)
854
-
855
- # source://rack//lib/rack/constants.rb#22
856
- Rack::ETAG = T.let(T.unsafe(nil), String)
857
-
858
- # Automatically sets the etag header on all String bodies.
859
- #
860
- # The etag header is skipped if etag or last-modified headers are sent or if
861
- # a sendfile body (body.responds_to :to_path) is given (since such cases
862
- # should be handled by apache/nginx).
863
- #
864
- # On initialization, you can pass two parameters: a cache-control directive
865
- # used when etag is absent and a directive when it is present. The first
866
- # defaults to nil, while the second defaults to "max-age=0, private, must-revalidate"
867
- #
868
- # source://rack//lib/rack/etag.rb#18
869
- class Rack::ETag
870
- # @return [ETag] a new instance of ETag
871
- #
872
- # source://rack//lib/rack/etag.rb#22
873
- def initialize(app, no_cache_control = T.unsafe(nil), cache_control = T.unsafe(nil)); end
874
-
875
- # source://rack//lib/rack/etag.rb#28
876
- def call(env); end
877
-
878
- private
879
-
880
- # source://rack//lib/rack/etag.rb#61
881
- def digest_body(body); end
882
-
883
- # @return [Boolean]
884
- #
885
- # source://rack//lib/rack/etag.rb#53
886
- def etag_status?(status); end
887
-
888
- # @return [Boolean]
889
- #
890
- # source://rack//lib/rack/etag.rb#57
891
- def skip_caching?(headers); end
892
- end
893
-
894
- # source://rack//lib/rack/etag.rb#20
895
- Rack::ETag::DEFAULT_CACHE_CONTROL = T.let(T.unsafe(nil), String)
896
-
897
- # source://rack//lib/rack/etag.rb#19
898
- Rack::ETag::ETAG_STRING = T.let(T.unsafe(nil), String)
899
-
900
- # source://rack//lib/rack/constants.rb#23
901
- Rack::EXPIRES = T.let(T.unsafe(nil), String)
902
-
903
- # This middleware provides hooks to certain places in the request /
904
- # response lifecycle. This is so that middleware that don't need to filter
905
- # the response data can safely leave it alone and not have to send messages
906
- # down the traditional "rack stack".
907
- #
908
- # The events are:
909
- #
910
- # * on_start(request, response)
911
- #
912
- # This event is sent at the start of the request, before the next
913
- # middleware in the chain is called. This method is called with a request
914
- # object, and a response object. Right now, the response object is always
915
- # nil, but in the future it may actually be a real response object.
916
- #
917
- # * on_commit(request, response)
918
- #
919
- # The response has been committed. The application has returned, but the
920
- # response has not been sent to the webserver yet. This method is always
921
- # called with a request object and the response object. The response
922
- # object is constructed from the rack triple that the application returned.
923
- # Changes may still be made to the response object at this point.
924
- #
925
- # * on_send(request, response)
926
- #
927
- # The webserver has started iterating over the response body and presumably
928
- # has started sending data over the wire. This method is always called with
929
- # a request object and the response object. The response object is
930
- # constructed from the rack triple that the application returned. Changes
931
- # SHOULD NOT be made to the response object as the webserver has already
932
- # started sending data. Any mutations will likely result in an exception.
933
- #
934
- # * on_finish(request, response)
935
- #
936
- # The webserver has closed the response, and all data has been written to
937
- # the response socket. The request and response object should both be
938
- # read-only at this point. The body MAY NOT be available on the response
939
- # object as it may have been flushed to the socket.
940
- #
941
- # * on_error(request, response, error)
942
- #
943
- # An exception has occurred in the application or an `on_commit` event.
944
- # This method will get the request, the response (if available) and the
945
- # exception that was raised.
946
- #
947
- # ## Order
948
- #
949
- # `on_start` is called on the handlers in the order that they were passed to
950
- # the constructor. `on_commit`, on_send`, `on_finish`, and `on_error` are
951
- # called in the reverse order. `on_finish` handlers are called inside an
952
- # `ensure` block, so they are guaranteed to be called even if something
953
- # raises an exception. If something raises an exception in a `on_finish`
954
- # method, then nothing is guaranteed.
955
- #
956
- # source://rack//lib/rack/events.rb#61
957
- class Rack::Events
958
- # @return [Events] a new instance of Events
959
- #
960
- # source://rack//lib/rack/events.rb#106
961
- def initialize(app, handlers); end
962
-
963
- # source://rack//lib/rack/events.rb#111
964
- def call(env); end
965
-
966
- private
967
-
968
- # source://rack//lib/rack/events.rb#149
969
- def make_request(env); end
970
-
971
- # source://rack//lib/rack/events.rb#153
972
- def make_response(status, headers, body); end
973
-
974
- # source://rack//lib/rack/events.rb#137
975
- def on_commit(request, response); end
976
-
977
- # source://rack//lib/rack/events.rb#133
978
- def on_error(request, response, e); end
979
-
980
- # source://rack//lib/rack/events.rb#145
981
- def on_finish(request, response); end
982
-
983
- # source://rack//lib/rack/events.rb#141
984
- def on_start(request, response); end
985
- end
986
-
987
- # source://rack//lib/rack/events.rb#62
988
- module Rack::Events::Abstract
989
- # source://rack//lib/rack/events.rb#66
990
- def on_commit(req, res); end
991
-
992
- # source://rack//lib/rack/events.rb#75
993
- def on_error(req, res, e); end
994
-
995
- # source://rack//lib/rack/events.rb#72
996
- def on_finish(req, res); end
997
-
998
- # source://rack//lib/rack/events.rb#69
999
- def on_send(req, res); end
1000
-
1001
- # source://rack//lib/rack/events.rb#63
1002
- def on_start(req, res); end
1003
- end
1004
-
1005
- # source://rack//lib/rack/events.rb#95
1006
- class Rack::Events::BufferedResponse < ::Rack::Response::Raw
1007
- # @return [BufferedResponse] a new instance of BufferedResponse
1008
- #
1009
- # source://rack//lib/rack/events.rb#98
1010
- def initialize(status, headers, body); end
1011
-
1012
- # Returns the value of attribute body.
1013
- #
1014
- # source://rack//lib/rack/events.rb#96
1015
- def body; end
1016
-
1017
- # source://rack//lib/rack/events.rb#103
1018
- def to_a; end
1019
- end
1020
-
1021
- # source://rack//lib/rack/events.rb#79
1022
- class Rack::Events::EventedBodyProxy < ::Rack::BodyProxy
1023
- # @return [EventedBodyProxy] a new instance of EventedBodyProxy
1024
- #
1025
- # source://rack//lib/rack/events.rb#82
1026
- def initialize(body, request, response, handlers, &block); end
1027
-
1028
- # source://rack//lib/rack/events.rb#89
1029
- def each; end
1030
-
1031
- # Returns the value of attribute request.
1032
- #
1033
- # source://rack//lib/rack/events.rb#80
1034
- def request; end
1035
-
1036
- # Returns the value of attribute response.
1037
- #
1038
- # source://rack//lib/rack/events.rb#80
1039
- def response; end
1040
- end
1041
-
1042
- # Rack::Files serves files below the +root+ directory given, according to the
1043
- # path info of the Rack request.
1044
- # e.g. when Rack::Files.new("/etc") is used, you can access 'passwd' file
1045
- # as http://localhost:9292/passwd
1046
- #
1047
- # Handlers can detect if bodies are a Rack::Files, and use mechanisms
1048
- # like sendfile on the +path+.
1049
- #
1050
- # source://rack//lib/rack/files.rb#20
1051
- class Rack::Files
1052
- # @return [Files] a new instance of Files
1053
- #
1054
- # source://rack//lib/rack/files.rb#27
1055
- def initialize(root, headers = T.unsafe(nil), default_mime = T.unsafe(nil)); end
1056
-
1057
- # source://rack//lib/rack/files.rb#34
1058
- def call(env); end
1059
-
1060
- # source://rack//lib/rack/files.rb#39
1061
- def get(env); end
1062
-
1063
- # Returns the value of attribute root.
1064
- #
1065
- # source://rack//lib/rack/files.rb#25
1066
- def root; end
1067
-
1068
- # source://rack//lib/rack/files.rb#68
1069
- def serving(request, path); end
1070
-
1071
- private
1072
-
1073
- # source://rack//lib/rack/files.rb#190
1074
- def fail(status, body, headers = T.unsafe(nil)); end
1075
-
1076
- # source://rack//lib/rack/files.rb#209
1077
- def filesize(path); end
1078
-
1079
- # The MIME type for the contents of the file located at @path
1080
- #
1081
- # source://rack//lib/rack/files.rb#205
1082
- def mime_type(path, default_mime); end
1083
- end
1084
-
1085
- # source://rack//lib/rack/files.rb#21
1086
- Rack::Files::ALLOWED_VERBS = T.let(T.unsafe(nil), Array)
1087
-
1088
- # source://rack//lib/rack/files.rb#22
1089
- Rack::Files::ALLOW_HEADER = T.let(T.unsafe(nil), String)
1090
-
1091
- # source://rack//lib/rack/files.rb#121
1092
- class Rack::Files::BaseIterator
1093
- # @return [BaseIterator] a new instance of BaseIterator
1094
- #
1095
- # source://rack//lib/rack/files.rb#124
1096
- def initialize(path, ranges, options); end
1097
-
1098
- # source://rack//lib/rack/files.rb#144
1099
- def bytesize; end
1100
-
1101
- # source://rack//lib/rack/files.rb#153
1102
- def close; end
1103
-
1104
- # source://rack//lib/rack/files.rb#130
1105
- def each; end
1106
-
1107
- # Returns the value of attribute options.
1108
- #
1109
- # source://rack//lib/rack/files.rb#122
1110
- def options; end
1111
-
1112
- # Returns the value of attribute path.
1113
- #
1114
- # source://rack//lib/rack/files.rb#122
1115
- def path; end
1116
-
1117
- # Returns the value of attribute ranges.
1118
- #
1119
- # source://rack//lib/rack/files.rb#122
1120
- def ranges; end
1121
-
1122
- private
1123
-
1124
- # source://rack//lib/rack/files.rb#171
1125
- def each_range_part(file, range); end
1126
-
1127
- # @return [Boolean]
1128
- #
1129
- # source://rack//lib/rack/files.rb#157
1130
- def multipart?; end
1131
-
1132
- # source://rack//lib/rack/files.rb#161
1133
- def multipart_heading(range); end
1134
- end
1135
-
1136
- # source://rack//lib/rack/files.rb#184
1137
- class Rack::Files::Iterator < ::Rack::Files::BaseIterator
1138
- # source://rack//lib/rack/files.rb#122
1139
- def to_path; end
1140
- end
1141
-
1142
- # source://rack//lib/rack/files.rb#23
1143
- Rack::Files::MULTIPART_BOUNDARY = T.let(T.unsafe(nil), String)
1144
-
1145
- # Rack::ForwardRequest gets caught by Rack::Recursive and redirects
1146
- # the current request to the app at +url+.
1147
- #
1148
- # raise ForwardRequest.new("/not-found")
1149
- #
1150
- # source://rack//lib/rack/recursive.rb#14
1151
- class Rack::ForwardRequest < ::Exception
1152
- # @return [ForwardRequest] a new instance of ForwardRequest
1153
- #
1154
- # source://rack//lib/rack/recursive.rb#17
1155
- def initialize(url, env = T.unsafe(nil)); end
1156
-
1157
- # Returns the value of attribute env.
1158
- #
1159
- # source://rack//lib/rack/recursive.rb#15
1160
- def env; end
1161
-
1162
- # Returns the value of attribute url.
1163
- #
1164
- # source://rack//lib/rack/recursive.rb#15
1165
- def url; end
1166
- end
1167
-
1168
- # HTTP method verbs
1169
- #
1170
- # source://rack//lib/rack/constants.rb#28
1171
- Rack::GET = T.let(T.unsafe(nil), String)
1172
-
1173
- # source://rack//lib/rack/constants.rb#33
1174
- Rack::HEAD = T.let(T.unsafe(nil), String)
1175
-
1176
- # source://rack//lib/rack/constants.rb#7
1177
- Rack::HTTPS = T.let(T.unsafe(nil), String)
1178
-
1179
- # source://rack//lib/rack/constants.rb#16
1180
- Rack::HTTP_COOKIE = T.let(T.unsafe(nil), String)
1181
-
1182
- # Request env keys
1183
- #
1184
- # source://rack//lib/rack/constants.rb#5
1185
- Rack::HTTP_HOST = T.let(T.unsafe(nil), String)
1186
-
1187
- # source://rack//lib/rack/constants.rb#6
1188
- Rack::HTTP_PORT = T.let(T.unsafe(nil), String)
1189
-
1190
- # Rack::Head returns an empty body for all HEAD requests. It leaves
1191
- # all other requests unchanged.
1192
- #
1193
- # source://rack//lib/rack/head.rb#9
1194
- class Rack::Head
1195
- # @return [Head] a new instance of Head
1196
- #
1197
- # source://rack//lib/rack/head.rb#10
1198
- def initialize(app); end
1199
-
1200
- # source://rack//lib/rack/head.rb#14
1201
- def call(env); end
1202
- end
1203
-
1204
- # Rack::Headers is a Hash subclass that downcases all keys. It's designed
1205
- # to be used by rack applications that don't implement the Rack 3 SPEC
1206
- # (by using non-lowercase response header keys), automatically handling
1207
- # the downcasing of keys.
1208
- #
1209
- # source://rack//lib/rack/headers.rb#8
1210
- class Rack::Headers < ::Hash
1211
- # source://rack//lib/rack/headers.rb#110
1212
- def [](key); end
1213
-
1214
- # source://rack//lib/rack/headers.rb#114
1215
- def []=(key, value); end
1216
-
1217
- # source://rack//lib/rack/headers.rb#119
1218
- def assoc(key); end
1219
-
1220
- # @raise [TypeError]
1221
- #
1222
- # source://rack//lib/rack/headers.rb#123
1223
- def compare_by_identity; end
1224
-
1225
- # source://rack//lib/rack/headers.rb#127
1226
- def delete(key); end
1227
-
1228
- # source://rack//lib/rack/headers.rb#131
1229
- def dig(key, *a); end
1230
-
1231
- # :nocov:
1232
- #
1233
- # source://rack//lib/rack/headers.rb#227
1234
- def except(*a); end
1235
-
1236
- # source://rack//lib/rack/headers.rb#135
1237
- def fetch(key, *default, &block); end
1238
-
1239
- # source://rack//lib/rack/headers.rb#140
1240
- def fetch_values(*a); end
1241
-
1242
- # @return [Boolean]
1243
- #
1244
- # source://rack//lib/rack/headers.rb#144
1245
- def has_key?(key); end
1246
-
1247
- # @return [Boolean]
1248
- #
1249
- # source://rack//lib/rack/headers.rb#144
1250
- def include?(key); end
1251
-
1252
- # source://rack//lib/rack/headers.rb#151
1253
- def invert; end
1254
-
1255
- # @return [Boolean]
1256
- #
1257
- # source://rack//lib/rack/headers.rb#144
1258
- def key?(key); end
1259
-
1260
- # @return [Boolean]
1261
- #
1262
- # source://rack//lib/rack/headers.rb#144
1263
- def member?(key); end
1264
-
1265
- # source://rack//lib/rack/headers.rb#157
1266
- def merge(hash, &block); end
1267
-
1268
- # source://rack//lib/rack/headers.rb#186
1269
- def merge!(hash, &block); end
1270
-
1271
- # source://rack//lib/rack/headers.rb#161
1272
- def reject(&block); end
1273
-
1274
- # source://rack//lib/rack/headers.rb#167
1275
- def replace(hash); end
1276
-
1277
- # source://rack//lib/rack/headers.rb#172
1278
- def select(&block); end
1279
-
1280
- # :nocov:
1281
- #
1282
- # source://rack//lib/rack/headers.rb#205
1283
- def slice(*a); end
1284
-
1285
- # source://rack//lib/rack/headers.rb#114
1286
- def store(key, value); end
1287
-
1288
- # source://rack//lib/rack/headers.rb#178
1289
- def to_proc; end
1290
-
1291
- # source://rack//lib/rack/headers.rb#211
1292
- def transform_keys(&block); end
1293
-
1294
- # source://rack//lib/rack/headers.rb#215
1295
- def transform_keys!; end
1296
-
1297
- # source://rack//lib/rack/headers.rb#182
1298
- def transform_values(&block); end
1299
-
1300
- # source://rack//lib/rack/headers.rb#186
1301
- def update(hash, &block); end
1302
-
1303
- # source://rack//lib/rack/headers.rb#198
1304
- def values_at(*keys); end
1305
-
1306
- private
1307
-
1308
- # source://rack//lib/rack/headers.rb#234
1309
- def downcase_key(key); end
1310
-
1311
- class << self
1312
- # source://rack//lib/rack/headers.rb#91
1313
- def [](*items); end
1314
- end
1315
- end
1316
-
1317
- # source://rack//lib/rack/headers.rb#9
1318
- Rack::Headers::KNOWN_HEADERS = T.let(T.unsafe(nil), Hash)
1319
-
1320
- # source://rack//lib/rack/constants.rb#36
1321
- Rack::LINK = T.let(T.unsafe(nil), String)
1322
-
1323
- # Rack::Lint validates your application and the requests and
1324
- # responses according to the Rack spec.
1325
- #
1326
- # source://rack//lib/rack/lint.rb#13
1327
- class Rack::Lint
1328
- # @return [Lint] a new instance of Lint
1329
- #
1330
- # source://rack//lib/rack/lint.rb#19
1331
- def initialize(app); end
1332
-
1333
- # AUTHORS: n.b. The trailing whitespace between paragraphs is important and
1334
- # should not be removed. The whitespace creates paragraphs in the RDoc
1335
- # output.
1336
- #
1337
- # This specification aims to formalize the Rack protocol. You
1338
- # can (and should) use Rack::Lint to enforce it.
1339
- #
1340
- # When you develop middleware, be sure to add a Lint before and
1341
- # after to catch all mistakes.
1342
- #
1343
- # = Rack applications
1344
- #
1345
- # A Rack application is a Ruby object (not a class) that
1346
- # responds to +call+.
1347
- #
1348
- # source://rack//lib/rack/lint.rb#40
1349
- def call(env = T.unsafe(nil)); end
1350
- end
1351
-
1352
- # :stopdoc:
1353
- #
1354
- # source://rack//lib/rack/lint.rb#25
1355
- class Rack::Lint::LintError < ::RuntimeError; end
1356
-
1357
- # source://rack//lib/rack/lint.rb#15
1358
- Rack::Lint::REQUEST_PATH_ABSOLUTE_FORM = T.let(T.unsafe(nil), Regexp)
1359
-
1360
- # source://rack//lib/rack/lint.rb#17
1361
- Rack::Lint::REQUEST_PATH_ASTERISK_FORM = T.let(T.unsafe(nil), String)
1362
-
1363
- # source://rack//lib/rack/lint.rb#16
1364
- Rack::Lint::REQUEST_PATH_AUTHORITY_FORM = T.let(T.unsafe(nil), Regexp)
1365
-
1366
- # source://rack//lib/rack/lint.rb#14
1367
- Rack::Lint::REQUEST_PATH_ORIGIN_FORM = T.let(T.unsafe(nil), Regexp)
1368
-
1369
- # source://rack//lib/rack/lint.rb#44
1370
- class Rack::Lint::Wrapper
1371
- # @return [Wrapper] a new instance of Wrapper
1372
- #
1373
- # source://rack//lib/rack/lint.rb#45
1374
- def initialize(app, env); end
1375
-
1376
- # ==== Streaming Body
1377
- #
1378
- # @raise [LintError]
1379
- #
1380
- # source://rack//lib/rack/lint.rb#939
1381
- def call(stream); end
1382
-
1383
- # ==== The +content-length+ Header
1384
- #
1385
- # source://rack//lib/rack/lint.rb#757
1386
- def check_content_length_header(status, headers); end
1387
-
1388
- # ==== The +content-type+ Header
1389
- #
1390
- # source://rack//lib/rack/lint.rb#741
1391
- def check_content_type_header(status, headers); end
1392
-
1393
- # === Early Hints
1394
- #
1395
- # The application or any middleware may call the <tt>rack.early_hints</tt>
1396
- # with an object which would be valid as the headers of a Rack response.
1397
- #
1398
- # source://rack//lib/rack/lint.rb#657
1399
- def check_early_hints(env); end
1400
-
1401
- # == The Environment
1402
- #
1403
- # @raise [LintError]
1404
- #
1405
- # source://rack//lib/rack/lint.rb#101
1406
- def check_environment(env); end
1407
-
1408
- # === The Error Stream
1409
- #
1410
- # source://rack//lib/rack/lint.rb#531
1411
- def check_error_stream(error); end
1412
-
1413
- # source://rack//lib/rack/lint.rb#731
1414
- def check_header_value(key, value); end
1415
-
1416
- # === The Headers
1417
- #
1418
- # source://rack//lib/rack/lint.rb#691
1419
- def check_headers(headers); end
1420
-
1421
- # === Hijacking
1422
- #
1423
- # The hijacking interfaces provides a means for an application to take
1424
- # control of the HTTP connection. There are two distinct hijack
1425
- # interfaces: full hijacking where the application takes over the raw
1426
- # connection, and partial hijacking where the application takes over
1427
- # just the response body stream. In both cases, the application is
1428
- # responsible for closing the hijacked stream.
1429
- #
1430
- # Full hijacking only works with HTTP/1. Partial hijacking is functionally
1431
- # equivalent to streaming bodies, and is still optionally supported for
1432
- # backwards compatibility with older Rack versions.
1433
- #
1434
- # ==== Full Hijack
1435
- #
1436
- # Full hijack is used to completely take over an HTTP/1 connection. It
1437
- # occurs before any headers are written and causes the request to
1438
- # ignores any response generated by the application.
1439
- #
1440
- # It is intended to be used when applications need access to raw HTTP/1
1441
- # connection.
1442
- #
1443
- # source://rack//lib/rack/lint.rb#591
1444
- def check_hijack(env); end
1445
-
1446
- # ==== Partial Hijack
1447
- #
1448
- # Partial hijack is used for bi-directional streaming of the request and
1449
- # response body. It occurs after the status and headers are written by
1450
- # the server and causes the server to ignore the Body of the response.
1451
- #
1452
- # It is intended to be used when applications need bi-directional
1453
- # streaming.
1454
- #
1455
- # source://rack//lib/rack/lint.rb#619
1456
- def check_hijack_response(headers, env); end
1457
-
1458
- # === The Input Stream
1459
- #
1460
- # The input stream is an IO-like object which contains the raw HTTP
1461
- # POST data.
1462
- #
1463
- # source://rack//lib/rack/lint.rb#427
1464
- def check_input_stream(input); end
1465
-
1466
- # ==== The +rack.protocol+ Header
1467
- #
1468
- # source://rack//lib/rack/lint.rb#785
1469
- def check_rack_protocol_header(status, headers); end
1470
-
1471
- # == The Response
1472
- #
1473
- # === The Status
1474
- #
1475
- # source://rack//lib/rack/lint.rb#680
1476
- def check_status(status); end
1477
-
1478
- # Setting this value informs the server that it should perform a
1479
- # connection upgrade. In HTTP/1, this is done using the +upgrade+
1480
- # header. In HTTP/2, this is done by accepting the request.
1481
- #
1482
- # === The Body
1483
- #
1484
- # The Body is typically an +Array+ of +String+ instances, an enumerable
1485
- # that yields +String+ instances, a +Proc+ instance, or a File-like
1486
- # object.
1487
- #
1488
- # The Body must respond to +each+ or +call+. It may optionally respond
1489
- # to +to_path+ or +to_ary+. A Body that responds to +each+ is considered
1490
- # to be an Enumerable Body. A Body that responds to +call+ is considered
1491
- # to be a Streaming Body.
1492
- #
1493
- # A Body that responds to both +each+ and +call+ must be treated as an
1494
- # Enumerable Body, not a Streaming Body. If it responds to +each+, you
1495
- # must call +each+ and not +call+. If the Body doesn't respond to
1496
- # +each+, then you can assume it responds to +call+.
1497
- #
1498
- # The Body must either be consumed or returned. The Body is consumed by
1499
- # optionally calling either +each+ or +call+.
1500
- # Then, if the Body responds to +close+, it must be called to release
1501
- # any resources associated with the generation of the body.
1502
- # In other words, +close+ must always be called at least once; typically
1503
- # after the web server has sent the response to the client, but also in
1504
- # cases where the Rack application makes internal/virtual requests and
1505
- # discards the response.
1506
- #
1507
- # source://rack//lib/rack/lint.rb#831
1508
- def close; end
1509
-
1510
- # ==== Enumerable Body
1511
- #
1512
- # @raise [LintError]
1513
- #
1514
- # source://rack//lib/rack/lint.rb#865
1515
- def each; end
1516
-
1517
- # @return [Boolean]
1518
- #
1519
- # source://rack//lib/rack/lint.rb#910
1520
- def respond_to?(name, *_arg1); end
1521
-
1522
- # @raise [LintError]
1523
- #
1524
- # source://rack//lib/rack/lint.rb#60
1525
- def response; end
1526
-
1527
- # If the Body responds to +to_ary+, it must return an +Array+ whose
1528
- # contents are identical to that produced by calling +each+.
1529
- # Middleware may call +to_ary+ directly on the Body and return a new
1530
- # Body in its place. In other words, middleware can only process the
1531
- # Body directly if it responds to +to_ary+. If the Body responds to both
1532
- # +to_ary+ and +close+, its implementation of +to_ary+ must call
1533
- # +close+.
1534
- #
1535
- # source://rack//lib/rack/lint.rb#926
1536
- def to_ary; end
1537
-
1538
- # source://rack//lib/rack/lint.rb#906
1539
- def to_path; end
1540
-
1541
- # source://rack//lib/rack/lint.rb#770
1542
- def verify_content_length(size); end
1543
-
1544
- # source://rack//lib/rack/lint.rb#847
1545
- def verify_to_path; end
1546
- end
1547
-
1548
- # source://rack//lib/rack/lint.rb#904
1549
- Rack::Lint::Wrapper::BODY_METHODS = T.let(T.unsafe(nil), Hash)
1550
-
1551
- # source://rack//lib/rack/lint.rb#540
1552
- class Rack::Lint::Wrapper::ErrorWrapper
1553
- # @return [ErrorWrapper] a new instance of ErrorWrapper
1554
- #
1555
- # source://rack//lib/rack/lint.rb#541
1556
- def initialize(error); end
1557
-
1558
- # * +close+ must never be called on the error stream.
1559
- #
1560
- # @raise [LintError]
1561
- #
1562
- # source://rack//lib/rack/lint.rb#563
1563
- def close(*args); end
1564
-
1565
- # * +flush+ must be called without arguments and must be called
1566
- # in order to make the error appear for sure.
1567
- #
1568
- # source://rack//lib/rack/lint.rb#558
1569
- def flush; end
1570
-
1571
- # * +puts+ must be called with a single argument that responds to +to_s+.
1572
- #
1573
- # source://rack//lib/rack/lint.rb#546
1574
- def puts(str); end
1575
-
1576
- # * +write+ must be called with a single argument that is a String.
1577
- #
1578
- # @raise [LintError]
1579
- #
1580
- # source://rack//lib/rack/lint.rb#551
1581
- def write(str); end
1582
- end
1583
-
1584
- # source://rack//lib/rack/lint.rb#445
1585
- class Rack::Lint::Wrapper::InputWrapper
1586
- # @return [InputWrapper] a new instance of InputWrapper
1587
- #
1588
- # source://rack//lib/rack/lint.rb#446
1589
- def initialize(input); end
1590
-
1591
- # * +close+ can be called on the input stream to indicate that
1592
- # any remaining input is not needed.
1593
- #
1594
- # source://rack//lib/rack/lint.rb#523
1595
- def close(*args); end
1596
-
1597
- # * +each+ must be called without arguments and only yield Strings.
1598
- #
1599
- # @raise [LintError]
1600
- #
1601
- # source://rack//lib/rack/lint.rb#511
1602
- def each(*args); end
1603
-
1604
- # * +gets+ must be called without arguments and return a string,
1605
- # or +nil+ on EOF.
1606
- #
1607
- # @raise [LintError]
1608
- #
1609
- # source://rack//lib/rack/lint.rb#452
1610
- def gets(*args); end
1611
-
1612
- # * +read+ behaves like <tt>IO#read</tt>.
1613
- # Its signature is <tt>read([length, [buffer]])</tt>.
1614
- #
1615
- # If given, +length+ must be a non-negative Integer (>= 0) or +nil+,
1616
- # and +buffer+ must be a String and may not be nil.
1617
- #
1618
- # If +length+ is given and not nil, then this method reads at most
1619
- # +length+ bytes from the input stream.
1620
- #
1621
- # If +length+ is not given or nil, then this method reads
1622
- # all data until EOF.
1623
- #
1624
- # When EOF is reached, this method returns nil if +length+ is given
1625
- # and not nil, or "" if +length+ is not given or is nil.
1626
- #
1627
- # If +buffer+ is given, then the read data will be placed
1628
- # into +buffer+ instead of a newly created String object.
1629
- #
1630
- # source://rack//lib/rack/lint.rb#478
1631
- def read(*args); end
1632
- end
1633
-
1634
- # source://rack//lib/rack/lint.rb#959
1635
- class Rack::Lint::Wrapper::StreamWrapper
1636
- extend ::Forwardable
1637
-
1638
- # @return [StreamWrapper] a new instance of StreamWrapper
1639
- #
1640
- # source://rack//lib/rack/lint.rb#974
1641
- def initialize(stream); end
1642
-
1643
- # source://forwardable/1.3.3/forwardable.rb#231
1644
- def <<(*args, **_arg1, &block); end
1645
-
1646
- # source://forwardable/1.3.3/forwardable.rb#231
1647
- def close(*args, **_arg1, &block); end
1648
-
1649
- # source://forwardable/1.3.3/forwardable.rb#231
1650
- def close_read(*args, **_arg1, &block); end
1651
-
1652
- # source://forwardable/1.3.3/forwardable.rb#231
1653
- def close_write(*args, **_arg1, &block); end
1654
-
1655
- # source://forwardable/1.3.3/forwardable.rb#231
1656
- def closed?(*args, **_arg1, &block); end
1657
-
1658
- # source://forwardable/1.3.3/forwardable.rb#231
1659
- def flush(*args, **_arg1, &block); end
1660
-
1661
- # source://forwardable/1.3.3/forwardable.rb#231
1662
- def read(*args, **_arg1, &block); end
1663
-
1664
- # source://forwardable/1.3.3/forwardable.rb#231
1665
- def write(*args, **_arg1, &block); end
1666
- end
1667
-
1668
- # The semantics of these IO methods must be a best effort match to
1669
- # those of a normal Ruby IO or Socket object, using standard arguments
1670
- # and raising standard exceptions. Servers are encouraged to simply
1671
- # pass on real IO objects, although it is recognized that this approach
1672
- # is not directly compatible with HTTP/2.
1673
- #
1674
- # source://rack//lib/rack/lint.rb#967
1675
- Rack::Lint::Wrapper::StreamWrapper::REQUIRED_METHODS = T.let(T.unsafe(nil), Array)
1676
-
1677
- # Rack::Lock locks every request inside a mutex, so that every request
1678
- # will effectively be executed synchronously.
1679
- #
1680
- # source://rack//lib/rack/lock.rb#8
1681
- class Rack::Lock
1682
- # @return [Lock] a new instance of Lock
1683
- #
1684
- # source://rack//lib/rack/lock.rb#9
1685
- def initialize(app, mutex = T.unsafe(nil)); end
1686
-
1687
- # source://rack//lib/rack/lock.rb#13
1688
- def call(env); end
1689
-
1690
- private
1691
-
1692
- # source://rack//lib/rack/lock.rb#25
1693
- def unlock; end
1694
- end
1695
-
1696
- # Sets up rack.logger to write to rack.errors stream
1697
- #
1698
- # source://rack//lib/rack/logger.rb#10
1699
- class Rack::Logger
1700
- # @return [Logger] a new instance of Logger
1701
- #
1702
- # source://rack//lib/rack/logger.rb#11
1703
- def initialize(app, level = T.unsafe(nil)); end
1704
-
1705
- # source://rack//lib/rack/logger.rb#15
1706
- def call(env); end
1707
- end
1708
-
1709
- # Rack::MediaType parse media type and parameters out of content_type string
1710
- #
1711
- # source://rack//lib/rack/media_type.rb#6
1712
- class Rack::MediaType
1713
- class << self
1714
- # The media type parameters provided in CONTENT_TYPE as a Hash, or
1715
- # an empty Hash if no CONTENT_TYPE or media-type parameters were
1716
- # provided. e.g., when the CONTENT_TYPE is "text/plain;charset=utf-8",
1717
- # this method responds with the following Hash:
1718
- # { 'charset' => 'utf-8' }
1719
- #
1720
- # This will pass back parameters with empty strings in the hash if they
1721
- # lack a value (e.g., "text/plain;charset=" will return { 'charset' => '' },
1722
- # and "text/plain;charset" will return { 'charset' => '' }, similarly to
1723
- # the query params parser (barring the latter case, which returns nil instead)).
1724
- #
1725
- # source://rack//lib/rack/media_type.rb#35
1726
- def params(content_type); end
1727
-
1728
- # The media type (type/subtype) portion of the CONTENT_TYPE header
1729
- # without any media type parameters. e.g., when CONTENT_TYPE is
1730
- # "text/plain;charset=utf-8", the media-type is "text/plain".
1731
- #
1732
- # For more information on the use of media types in HTTP, see:
1733
- # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7
1734
- #
1735
- # source://rack//lib/rack/media_type.rb#16
1736
- def type(content_type); end
1737
-
1738
- private
1739
-
1740
- # source://rack//lib/rack/media_type.rb#48
1741
- def strip_doublequotes(str); end
1742
- end
1743
- end
1744
-
1745
- # source://rack//lib/rack/media_type.rb#7
1746
- Rack::MediaType::SPLIT_PATTERN = T.let(T.unsafe(nil), Regexp)
1747
-
1748
- # source://rack//lib/rack/method_override.rb#8
1749
- class Rack::MethodOverride
1750
- # @return [MethodOverride] a new instance of MethodOverride
1751
- #
1752
- # source://rack//lib/rack/method_override.rb#15
1753
- def initialize(app); end
1754
-
1755
- # source://rack//lib/rack/method_override.rb#19
1756
- def call(env); end
1757
-
1758
- # source://rack//lib/rack/method_override.rb#31
1759
- def method_override(env); end
1760
-
1761
- private
1762
-
1763
- # source://rack//lib/rack/method_override.rb#44
1764
- def allowed_methods; end
1765
-
1766
- # source://rack//lib/rack/method_override.rb#48
1767
- def method_override_param(req); end
1768
- end
1769
-
1770
- # source://rack//lib/rack/method_override.rb#13
1771
- Rack::MethodOverride::ALLOWED_METHODS = T.let(T.unsafe(nil), Array)
1772
-
1773
- # source://rack//lib/rack/method_override.rb#9
1774
- Rack::MethodOverride::HTTP_METHODS = T.let(T.unsafe(nil), Array)
1775
-
1776
- # source://rack//lib/rack/method_override.rb#12
1777
- Rack::MethodOverride::HTTP_METHOD_OVERRIDE_HEADER = T.let(T.unsafe(nil), String)
1778
-
1779
- # source://rack//lib/rack/method_override.rb#11
1780
- Rack::MethodOverride::METHOD_OVERRIDE_PARAM_KEY = T.let(T.unsafe(nil), String)
1781
-
1782
- # source://rack//lib/rack/mime.rb#4
1783
- module Rack::Mime
1784
- private
1785
-
1786
- # Returns true if the given value is a mime match for the given mime match
1787
- # specification, false otherwise.
1788
- #
1789
- # Rack::Mime.match?('text/html', 'text/*') => true
1790
- # Rack::Mime.match?('text/plain', '*') => true
1791
- # Rack::Mime.match?('text/html', 'application/json') => false
1792
- #
1793
- # @return [Boolean]
1794
- #
1795
- # source://rack//lib/rack/mime.rb#30
1796
- def match?(value, matcher); end
1797
-
1798
- # Returns String with mime type if found, otherwise use +fallback+.
1799
- # +ext+ should be filename extension in the '.ext' format that
1800
- # File.extname(file) returns.
1801
- # +fallback+ may be any object
1802
- #
1803
- # Also see the documentation for MIME_TYPES
1804
- #
1805
- # Usage:
1806
- # Rack::Mime.mime_type('.foo')
1807
- #
1808
- # This is a shortcut for:
1809
- # Rack::Mime::MIME_TYPES.fetch('.foo', 'application/octet-stream')
1810
- #
1811
- # source://rack//lib/rack/mime.rb#18
1812
- def mime_type(ext, fallback = T.unsafe(nil)); end
1813
-
1814
- class << self
1815
- # Returns true if the given value is a mime match for the given mime match
1816
- # specification, false otherwise.
1817
- #
1818
- # Rack::Mime.match?('text/html', 'text/*') => true
1819
- # Rack::Mime.match?('text/plain', '*') => true
1820
- # Rack::Mime.match?('text/html', 'application/json') => false
1821
- #
1822
- # @return [Boolean]
1823
- #
1824
- # source://rack//lib/rack/mime.rb#30
1825
- def match?(value, matcher); end
1826
-
1827
- # Returns String with mime type if found, otherwise use +fallback+.
1828
- # +ext+ should be filename extension in the '.ext' format that
1829
- # File.extname(file) returns.
1830
- # +fallback+ may be any object
1831
- #
1832
- # Also see the documentation for MIME_TYPES
1833
- #
1834
- # Usage:
1835
- # Rack::Mime.mime_type('.foo')
1836
- #
1837
- # This is a shortcut for:
1838
- # Rack::Mime::MIME_TYPES.fetch('.foo', 'application/octet-stream')
1839
- #
1840
- # source://rack//lib/rack/mime.rb#18
1841
- def mime_type(ext, fallback = T.unsafe(nil)); end
1842
- end
1843
- end
1844
-
1845
- # List of most common mime-types, selected various sources
1846
- # according to their usefulness in a webserving scope for Ruby
1847
- # users.
1848
- #
1849
- # To amend this list with your local mime.types list you can use:
1850
- #
1851
- # require 'webrick/httputils'
1852
- # list = WEBrick::HTTPUtils.load_mime_types('/etc/mime.types')
1853
- # Rack::Mime::MIME_TYPES.merge!(list)
1854
- #
1855
- # N.B. On Ubuntu the mime.types file does not include the leading period, so
1856
- # users may need to modify the data before merging into the hash.
1857
- #
1858
- # source://rack//lib/rack/mime.rb#51
1859
- Rack::Mime::MIME_TYPES = T.let(T.unsafe(nil), Hash)
1860
-
1861
- # Rack::MockRequest helps testing your Rack application without
1862
- # actually using HTTP.
1863
- #
1864
- # After performing a request on a URL with get/post/put/patch/delete, it
1865
- # returns a MockResponse with useful helper methods for effective
1866
- # testing.
1867
- #
1868
- # You can pass a hash with additional configuration to the
1869
- # get/post/put/patch/delete.
1870
- # <tt>:input</tt>:: A String or IO-like to be used as rack.input.
1871
- # <tt>:fatal</tt>:: Raise a FatalWarning if the app writes to rack.errors.
1872
- # <tt>:lint</tt>:: If true, wrap the application in a Rack::Lint.
1873
- #
1874
- # source://rack//lib/rack/mock_request.rb#23
1875
- class Rack::MockRequest
1876
- # @return [MockRequest] a new instance of MockRequest
1877
- #
1878
- # source://rack//lib/rack/mock_request.rb#44
1879
- def initialize(app); end
1880
-
1881
- # Make a DELETE request and return a MockResponse. See #request.
1882
- #
1883
- # source://rack//lib/rack/mock_request.rb#57
1884
- def delete(uri, opts = T.unsafe(nil)); end
1885
-
1886
- # Make a GET request and return a MockResponse. See #request.
1887
- #
1888
- # source://rack//lib/rack/mock_request.rb#49
1889
- def get(uri, opts = T.unsafe(nil)); end
1890
-
1891
- # Make a HEAD request and return a MockResponse. See #request.
1892
- #
1893
- # source://rack//lib/rack/mock_request.rb#59
1894
- def head(uri, opts = T.unsafe(nil)); end
1895
-
1896
- # Make an OPTIONS request and return a MockResponse. See #request.
1897
- #
1898
- # source://rack//lib/rack/mock_request.rb#61
1899
- def options(uri, opts = T.unsafe(nil)); end
1900
-
1901
- # Make a PATCH request and return a MockResponse. See #request.
1902
- #
1903
- # source://rack//lib/rack/mock_request.rb#55
1904
- def patch(uri, opts = T.unsafe(nil)); end
1905
-
1906
- # Make a POST request and return a MockResponse. See #request.
1907
- #
1908
- # source://rack//lib/rack/mock_request.rb#51
1909
- def post(uri, opts = T.unsafe(nil)); end
1910
-
1911
- # Make a PUT request and return a MockResponse. See #request.
1912
- #
1913
- # source://rack//lib/rack/mock_request.rb#53
1914
- def put(uri, opts = T.unsafe(nil)); end
1915
-
1916
- # Make a request using the given request method for the given
1917
- # uri to the rack application and return a MockResponse.
1918
- # Options given are passed to MockRequest.env_for.
1919
- #
1920
- # source://rack//lib/rack/mock_request.rb#66
1921
- def request(method = T.unsafe(nil), uri = T.unsafe(nil), opts = T.unsafe(nil)); end
1922
-
1923
- class << self
1924
- # Return the Rack environment used for a request to +uri+.
1925
- # All options that are strings are added to the returned environment.
1926
- # Options:
1927
- # :fatal :: Whether to raise an exception if request outputs to rack.errors
1928
- # :input :: The rack.input to set
1929
- # :http_version :: The SERVER_PROTOCOL to set
1930
- # :method :: The HTTP request method to use
1931
- # :params :: The params to use
1932
- # :script_name :: The SCRIPT_NAME to set
1933
- #
1934
- # source://rack//lib/rack/mock_request.rb#98
1935
- def env_for(uri = T.unsafe(nil), opts = T.unsafe(nil)); end
1936
-
1937
- # For historical reasons, we're pinning to RFC 2396.
1938
- # URI::Parser = URI::RFC2396_Parser
1939
- #
1940
- # source://rack//lib/rack/mock_request.rb#84
1941
- def parse_uri_rfc2396(uri); end
1942
- end
1943
- end
1944
-
1945
- # source://rack//lib/rack/mock_request.rb#27
1946
- class Rack::MockRequest::FatalWarner
1947
- # source://rack//lib/rack/mock_request.rb#36
1948
- def flush; end
1949
-
1950
- # @raise [FatalWarning]
1951
- #
1952
- # source://rack//lib/rack/mock_request.rb#28
1953
- def puts(warning); end
1954
-
1955
- # source://rack//lib/rack/mock_request.rb#39
1956
- def string; end
1957
-
1958
- # @raise [FatalWarning]
1959
- #
1960
- # source://rack//lib/rack/mock_request.rb#32
1961
- def write(warning); end
1962
- end
1963
-
1964
- # source://rack//lib/rack/mock_request.rb#24
1965
- class Rack::MockRequest::FatalWarning < ::RuntimeError; end
1966
-
1967
- # Rack::MockResponse provides useful helpers for testing your apps.
1968
- # Usually, you don't create the MockResponse on your own, but use
1969
- # MockRequest.
1970
- #
1971
- # source://rack//lib/rack/mock_response.rb#12
1972
- class Rack::MockResponse < ::Rack::Response
1973
- # @return [MockResponse] a new instance of MockResponse
1974
- #
1975
- # source://rack//lib/rack/mock_response.rb#53
1976
- def initialize(status, headers, body, errors = T.unsafe(nil)); end
1977
-
1978
- # source://rack//lib/rack/mock_response.rb#68
1979
- def =~(other); end
1980
-
1981
- # source://rack//lib/rack/mock_response.rb#76
1982
- def body; end
1983
-
1984
- # source://rack//lib/rack/mock_response.rb#102
1985
- def cookie(name); end
1986
-
1987
- # Headers
1988
- #
1989
- # source://rack//lib/rack/mock_response.rb#48
1990
- def cookies; end
1991
-
1992
- # @return [Boolean]
1993
- #
1994
- # source://rack//lib/rack/mock_response.rb#98
1995
- def empty?; end
1996
-
1997
- # Errors
1998
- #
1999
- # source://rack//lib/rack/mock_response.rb#51
2000
- def errors; end
2001
-
2002
- # Errors
2003
- #
2004
- # source://rack//lib/rack/mock_response.rb#51
2005
- def errors=(_arg0); end
2006
-
2007
- # source://rack//lib/rack/mock_response.rb#72
2008
- def match(other); end
2009
-
2010
- # Headers
2011
- #
2012
- # source://rack//lib/rack/mock_response.rb#48
2013
- def original_headers; end
2014
-
2015
- private
2016
-
2017
- # source://rack//lib/rack/mock_response.rb#129
2018
- def identify_cookie_attributes(cookie_filling); end
2019
-
2020
- # source://rack//lib/rack/mock_response.rb#108
2021
- def parse_cookies_from_header; end
2022
-
2023
- class << self
2024
- def [](*_arg0); end
2025
- end
2026
- end
2027
-
2028
- # source://rack//lib/rack/mock_response.rb#16
2029
- Rack::MockResponse::Cookie = CGI::Cookie
2030
-
2031
- # A multipart form data parser, adapted from IOWA.
2032
- #
2033
- # Usually, Rack::Request#POST takes care of calling this.
2034
- #
2035
- # source://rack//lib/rack/multipart/parser.rb#9
2036
- module Rack::Multipart
2037
- class << self
2038
- # source://rack//lib/rack/multipart.rb#72
2039
- def build_multipart(params, first = T.unsafe(nil)); end
2040
-
2041
- # source://rack//lib/rack/multipart.rb#68
2042
- def extract_multipart(request, params = T.unsafe(nil)); end
2043
-
2044
- # source://rack//lib/rack/multipart.rb#48
2045
- def parse_multipart(env, params = T.unsafe(nil)); end
2046
- end
2047
- end
2048
-
2049
- # Base class for multipart exceptions that do not subclass from
2050
- # other exception classes for backwards compatibility.
2051
- #
2052
- # source://rack//lib/rack/multipart/parser.rb#26
2053
- class Rack::Multipart::BoundaryTooLongError < ::StandardError
2054
- include ::Rack::BadRequest
2055
- end
2056
-
2057
- # source://rack//lib/rack/multipart/parser.rb#33
2058
- Rack::Multipart::EOL = T.let(T.unsafe(nil), String)
2059
-
2060
- # Use specific error class when parsing multipart request
2061
- # that ends early.
2062
- #
2063
- # source://rack//lib/rack/multipart/parser.rb#20
2064
- class Rack::Multipart::EmptyContentError < ::EOFError
2065
- include ::Rack::BadRequest
2066
- end
2067
-
2068
- # Prefer to use the BoundaryTooLongError class or Rack::BadRequest.
2069
- #
2070
- # source://rack//lib/rack/multipart/parser.rb#31
2071
- Rack::Multipart::Error = Rack::Multipart::BoundaryTooLongError
2072
-
2073
- # whitespace with optional folding
2074
- #
2075
- # source://rack//lib/rack/multipart/parser.rb#34
2076
- Rack::Multipart::FWS = T.let(T.unsafe(nil), Regexp)
2077
-
2078
- # source://rack//lib/rack/multipart/generator.rb#7
2079
- class Rack::Multipart::Generator
2080
- # @return [Generator] a new instance of Generator
2081
- #
2082
- # source://rack//lib/rack/multipart/generator.rb#8
2083
- def initialize(params, first = T.unsafe(nil)); end
2084
-
2085
- # source://rack//lib/rack/multipart/generator.rb#16
2086
- def dump; end
2087
-
2088
- private
2089
-
2090
- # source://rack//lib/rack/multipart/generator.rb#89
2091
- def content_for_other(file, name); end
2092
-
2093
- # source://rack//lib/rack/multipart/generator.rb#77
2094
- def content_for_tempfile(io, file, name); end
2095
-
2096
- # source://rack//lib/rack/multipart/generator.rb#52
2097
- def flattened_params; end
2098
-
2099
- # @return [Boolean]
2100
- #
2101
- # source://rack//lib/rack/multipart/generator.rb#37
2102
- def multipart?; end
2103
- end
2104
-
2105
- # anything but a non-folding CRLF
2106
- #
2107
- # source://rack//lib/rack/multipart/parser.rb#35
2108
- Rack::Multipart::HEADER_VALUE = T.let(T.unsafe(nil), String)
2109
-
2110
- # source://rack//lib/rack/multipart/parser.rb#36
2111
- Rack::Multipart::MULTIPART = T.let(T.unsafe(nil), Regexp)
2112
-
2113
- # source://rack//lib/rack/multipart.rb#16
2114
- Rack::Multipart::MULTIPART_BOUNDARY = T.let(T.unsafe(nil), String)
2115
-
2116
- # source://rack//lib/rack/multipart/parser.rb#38
2117
- Rack::Multipart::MULTIPART_CONTENT_DISPOSITION = T.let(T.unsafe(nil), Regexp)
2118
-
2119
- # source://rack//lib/rack/multipart/parser.rb#39
2120
- Rack::Multipart::MULTIPART_CONTENT_ID = T.let(T.unsafe(nil), Regexp)
2121
-
2122
- # source://rack//lib/rack/multipart/parser.rb#37
2123
- Rack::Multipart::MULTIPART_CONTENT_TYPE = T.let(T.unsafe(nil), Regexp)
2124
-
2125
- # source://rack//lib/rack/multipart.rb#18
2126
- class Rack::Multipart::MissingInputError < ::StandardError
2127
- include ::Rack::BadRequest
2128
- end
2129
-
2130
- # source://rack//lib/rack/multipart/parser.rb#10
2131
- class Rack::Multipart::MultipartPartLimitError < ::Errno::EMFILE
2132
- include ::Rack::BadRequest
2133
- end
2134
-
2135
- # source://rack//lib/rack/multipart/parser.rb#14
2136
- class Rack::Multipart::MultipartTotalPartLimitError < ::StandardError
2137
- include ::Rack::BadRequest
2138
- end
2139
-
2140
- # Accumulator for multipart form data, conforming to the QueryParser API.
2141
- # In future, the Parser could return the pair list directly, but that would
2142
- # change its API.
2143
- #
2144
- # source://rack//lib/rack/multipart.rb#25
2145
- class Rack::Multipart::ParamList
2146
- # @return [ParamList] a new instance of ParamList
2147
- #
2148
- # source://rack//lib/rack/multipart.rb#34
2149
- def initialize; end
2150
-
2151
- # source://rack//lib/rack/multipart.rb#38
2152
- def <<(pair); end
2153
-
2154
- # source://rack//lib/rack/multipart.rb#42
2155
- def to_params_hash; end
2156
-
2157
- class << self
2158
- # source://rack//lib/rack/multipart.rb#26
2159
- def make_params; end
2160
-
2161
- # source://rack//lib/rack/multipart.rb#30
2162
- def normalize_params(params, key, value); end
2163
- end
2164
- end
2165
-
2166
- # source://rack//lib/rack/multipart/parser.rb#41
2167
- class Rack::Multipart::Parser
2168
- # @return [Parser] a new instance of Parser
2169
- #
2170
- # source://rack//lib/rack/multipart/parser.rb#202
2171
- def initialize(boundary, tempfile, bufsize, query_parser); end
2172
-
2173
- # source://rack//lib/rack/multipart/parser.rb#219
2174
- def parse(io); end
2175
-
2176
- # source://rack//lib/rack/multipart/parser.rb#242
2177
- def result; end
2178
-
2179
- # Returns the value of attribute state.
2180
- #
2181
- # source://rack//lib/rack/multipart/parser.rb#200
2182
- def state; end
2183
-
2184
- private
2185
-
2186
- # Scan until the we find the start or end of the boundary.
2187
- # If we find it, return the appropriate symbol for the start or
2188
- # end of the boundary. If we don't find the start or end of the
2189
- # boundary, clear the buffer and return nil.
2190
- #
2191
- # source://rack//lib/rack/multipart/parser.rb#436
2192
- def consume_boundary; end
2193
-
2194
- # From WEBrick::HTTPUtils
2195
- #
2196
- # source://rack//lib/rack/multipart/parser.rb#254
2197
- def dequote(str); end
2198
-
2199
- # Return the related Encoding object. However, because
2200
- # enc is submitted by the user, it may be invalid, so
2201
- # use a binary encoding in that case.
2202
- #
2203
- # source://rack//lib/rack/multipart/parser.rb#491
2204
- def find_encoding(enc); end
2205
-
2206
- # source://rack//lib/rack/multipart/parser.rb#296
2207
- def handle_consume_token; end
2208
-
2209
- # source://rack//lib/rack/multipart/parser.rb#497
2210
- def handle_empty_content!(content); end
2211
-
2212
- # This handles the initial parser state. We read until we find the starting
2213
- # boundary, then we can transition to the next state. If we find the ending
2214
- # boundary, this is an invalid multipart upload, but keep scanning for opening
2215
- # boundary in that case. If no boundary found, we need to keep reading data
2216
- # and retry. It's highly unlikely the initial read will not consume the
2217
- # boundary. The client would have to deliberately craft a response
2218
- # with the opening boundary beyond the buffer size for that to happen.
2219
- #
2220
- # source://rack//lib/rack/multipart/parser.rb#273
2221
- def handle_fast_forward; end
2222
-
2223
- # source://rack//lib/rack/multipart/parser.rb#413
2224
- def handle_mime_body; end
2225
-
2226
- # source://rack//lib/rack/multipart/parser.rb#308
2227
- def handle_mime_head; end
2228
-
2229
- # source://rack//lib/rack/multipart/parser.rb#445
2230
- def normalize_filename(filename); end
2231
-
2232
- # source://rack//lib/rack/multipart/parser.rb#260
2233
- def read_data(io, outbuf); end
2234
-
2235
- # source://rack//lib/rack/multipart/parser.rb#458
2236
- def tag_multipart_encoding(filename, content_type, name, body); end
2237
-
2238
- class << self
2239
- # source://rack//lib/rack/multipart/parser.rb#89
2240
- def parse(io, content_length, content_type, tmpfile, bufsize, qp); end
2241
-
2242
- # source://rack//lib/rack/multipart/parser.rb#82
2243
- def parse_boundary(content_type); end
2244
- end
2245
- end
2246
-
2247
- # source://rack//lib/rack/multipart/parser.rb#42
2248
- Rack::Multipart::Parser::BUFSIZE = T.let(T.unsafe(nil), Integer)
2249
-
2250
- # source://rack//lib/rack/multipart/parser.rb#50
2251
- class Rack::Multipart::Parser::BoundedIO
2252
- # @return [BoundedIO] a new instance of BoundedIO
2253
- #
2254
- # source://rack//lib/rack/multipart/parser.rb#51
2255
- def initialize(io, content_length); end
2256
-
2257
- # source://rack//lib/rack/multipart/parser.rb#57
2258
- def read(size, outbuf = T.unsafe(nil)); end
2259
- end
2260
-
2261
- # source://rack//lib/rack/multipart/parser.rb#455
2262
- Rack::Multipart::Parser::CHARSET = T.let(T.unsafe(nil), String)
2263
-
2264
- # source://rack//lib/rack/multipart/parser.rb#307
2265
- Rack::Multipart::Parser::CONTENT_DISPOSITION_MAX_BYTES = T.let(T.unsafe(nil), Integer)
2266
-
2267
- # source://rack//lib/rack/multipart/parser.rb#306
2268
- Rack::Multipart::Parser::CONTENT_DISPOSITION_MAX_PARAMS = T.let(T.unsafe(nil), Integer)
2269
-
2270
- # source://rack//lib/rack/multipart/parser.rb#109
2271
- class Rack::Multipart::Parser::Collector
2272
- include ::Enumerable
2273
-
2274
- # @return [Collector] a new instance of Collector
2275
- #
2276
- # source://rack//lib/rack/multipart/parser.rb#145
2277
- def initialize(tempfile); end
2278
-
2279
- # source://rack//lib/rack/multipart/parser.rb#151
2280
- def each; end
2281
-
2282
- # source://rack//lib/rack/multipart/parser.rb#171
2283
- def on_mime_body(mime_index, content); end
2284
-
2285
- # source://rack//lib/rack/multipart/parser.rb#175
2286
- def on_mime_finish(mime_index); end
2287
-
2288
- # source://rack//lib/rack/multipart/parser.rb#155
2289
- def on_mime_head(mime_index, head, filename, content_type, name); end
2290
-
2291
- private
2292
-
2293
- # source://rack//lib/rack/multipart/parser.rb#180
2294
- def check_part_limits; end
2295
- end
2296
-
2297
- # source://rack//lib/rack/multipart/parser.rb#133
2298
- class Rack::Multipart::Parser::Collector::BufferPart < ::Rack::Multipart::Parser::Collector::MimePart
2299
- # source://rack//lib/rack/multipart/parser.rb#135
2300
- def close; end
2301
-
2302
- # @return [Boolean]
2303
- #
2304
- # source://rack//lib/rack/multipart/parser.rb#134
2305
- def file?; end
2306
- end
2307
-
2308
- # source://rack//lib/rack/multipart/parser.rb#110
2309
- class Rack::Multipart::Parser::Collector::MimePart < ::Struct
2310
- # @yield [data]
2311
- #
2312
- # source://rack//lib/rack/multipart/parser.rb#111
2313
- def get_data; end
2314
- end
2315
-
2316
- # source://rack//lib/rack/multipart/parser.rb#138
2317
- class Rack::Multipart::Parser::Collector::TempfilePart < ::Rack::Multipart::Parser::Collector::MimePart
2318
- # source://rack//lib/rack/multipart/parser.rb#140
2319
- def close; end
2320
-
2321
- # @return [Boolean]
2322
- #
2323
- # source://rack//lib/rack/multipart/parser.rb#139
2324
- def file?; end
2325
- end
2326
-
2327
- # source://rack//lib/rack/multipart/parser.rb#80
2328
- Rack::Multipart::Parser::EMPTY = T.let(T.unsafe(nil), Rack::Multipart::Parser::MultipartInfo)
2329
-
2330
- # source://rack//lib/rack/multipart/parser.rb#79
2331
- class Rack::Multipart::Parser::MultipartInfo < ::Struct
2332
- # Returns the value of attribute params
2333
- #
2334
- # @return [Object] the current value of params
2335
- def params; end
2336
-
2337
- # Sets the attribute params
2338
- #
2339
- # @param value [Object] the value to set the attribute params to.
2340
- # @return [Object] the newly set value
2341
- def params=(_); end
2342
-
2343
- # Returns the value of attribute tmp_files
2344
- #
2345
- # @return [Object] the current value of tmp_files
2346
- def tmp_files; end
2347
-
2348
- # Sets the attribute tmp_files
2349
- #
2350
- # @param value [Object] the value to set the attribute tmp_files to.
2351
- # @return [Object] the newly set value
2352
- def tmp_files=(_); end
2353
-
2354
- class << self
2355
- def [](*_arg0); end
2356
- def inspect; end
2357
- def keyword_init?; end
2358
- def members; end
2359
- def new(*_arg0); end
2360
- end
2361
- end
2362
-
2363
- # source://rack//lib/rack/multipart/parser.rb#44
2364
- Rack::Multipart::Parser::TEMPFILE_FACTORY = T.let(T.unsafe(nil), Proc)
2365
-
2366
- # source://rack//lib/rack/multipart/parser.rb#43
2367
- Rack::Multipart::Parser::TEXT_PLAIN = T.let(T.unsafe(nil), String)
2368
-
2369
- # source://rack//lib/rack/multipart/uploaded_file.rb#8
2370
- class Rack::Multipart::UploadedFile
2371
- # @return [UploadedFile] a new instance of UploadedFile
2372
- #
2373
- # source://rack//lib/rack/multipart/uploaded_file.rb#16
2374
- def initialize(filepath = T.unsafe(nil), ct = T.unsafe(nil), bin = T.unsafe(nil), path: T.unsafe(nil), content_type: T.unsafe(nil), binary: T.unsafe(nil), filename: T.unsafe(nil), io: T.unsafe(nil)); end
2375
-
2376
- # The content type of the "uploaded" file
2377
- #
2378
- # source://rack//lib/rack/multipart/uploaded_file.rb#14
2379
- def content_type; end
2380
-
2381
- # The content type of the "uploaded" file
2382
- #
2383
- # source://rack//lib/rack/multipart/uploaded_file.rb#14
2384
- def content_type=(_arg0); end
2385
-
2386
- # source://rack//lib/rack/multipart/uploaded_file.rb#31
2387
- def local_path; end
2388
-
2389
- # source://rack//lib/rack/multipart/uploaded_file.rb#40
2390
- def method_missing(method_name, *args, &block); end
2391
-
2392
- # The filename, *not* including the path, of the "uploaded" file
2393
- #
2394
- # source://rack//lib/rack/multipart/uploaded_file.rb#11
2395
- def original_filename; end
2396
-
2397
- # source://rack//lib/rack/multipart/uploaded_file.rb#31
2398
- def path; end
2399
-
2400
- # @return [Boolean]
2401
- #
2402
- # source://rack//lib/rack/multipart/uploaded_file.rb#36
2403
- def respond_to?(*args); end
2404
- end
2405
-
2406
- # source://rack//lib/rack/null_logger.rb#6
2407
- class Rack::NullLogger
2408
- # @return [NullLogger] a new instance of NullLogger
2409
- #
2410
- # source://rack//lib/rack/null_logger.rb#7
2411
- def initialize(app); end
2412
-
2413
- # source://rack//lib/rack/null_logger.rb#45
2414
- def <<(msg); end
2415
-
2416
- # source://rack//lib/rack/null_logger.rb#43
2417
- def add(severity, message = T.unsafe(nil), progname = T.unsafe(nil), &block); end
2418
-
2419
- # source://rack//lib/rack/null_logger.rb#11
2420
- def call(env); end
2421
-
2422
- # source://rack//lib/rack/null_logger.rb#42
2423
- def close; end
2424
-
2425
- # source://rack//lib/rack/null_logger.rb#34
2426
- def datetime_format; end
2427
-
2428
- # source://rack//lib/rack/null_logger.rb#39
2429
- def datetime_format=(datetime_format); end
2430
-
2431
- # source://rack//lib/rack/null_logger.rb#17
2432
- def debug(progname = T.unsafe(nil), &block); end
2433
-
2434
- # source://rack//lib/rack/null_logger.rb#27
2435
- def debug!; end
2436
-
2437
- # @return [Boolean]
2438
- #
2439
- # source://rack//lib/rack/null_logger.rb#23
2440
- def debug?; end
2441
-
2442
- # source://rack//lib/rack/null_logger.rb#19
2443
- def error(progname = T.unsafe(nil), &block); end
2444
-
2445
- # source://rack//lib/rack/null_logger.rb#28
2446
- def error!; end
2447
-
2448
- # @return [Boolean]
2449
- #
2450
- # source://rack//lib/rack/null_logger.rb#25
2451
- def error?; end
2452
-
2453
- # source://rack//lib/rack/null_logger.rb#20
2454
- def fatal(progname = T.unsafe(nil), &block); end
2455
-
2456
- # source://rack//lib/rack/null_logger.rb#29
2457
- def fatal!; end
2458
-
2459
- # @return [Boolean]
2460
- #
2461
- # source://rack//lib/rack/null_logger.rb#26
2462
- def fatal?; end
2463
-
2464
- # source://rack//lib/rack/null_logger.rb#35
2465
- def formatter; end
2466
-
2467
- # source://rack//lib/rack/null_logger.rb#40
2468
- def formatter=(formatter); end
2469
-
2470
- # source://rack//lib/rack/null_logger.rb#16
2471
- def info(progname = T.unsafe(nil), &block); end
2472
-
2473
- # source://rack//lib/rack/null_logger.rb#30
2474
- def info!; end
2475
-
2476
- # @return [Boolean]
2477
- #
2478
- # source://rack//lib/rack/null_logger.rb#22
2479
- def info?; end
2480
-
2481
- # source://rack//lib/rack/null_logger.rb#32
2482
- def level; end
2483
-
2484
- # source://rack//lib/rack/null_logger.rb#37
2485
- def level=(level); end
2486
-
2487
- # source://rack//lib/rack/null_logger.rb#44
2488
- def log(severity, message = T.unsafe(nil), progname = T.unsafe(nil), &block); end
2489
-
2490
- # source://rack//lib/rack/null_logger.rb#33
2491
- def progname; end
2492
-
2493
- # source://rack//lib/rack/null_logger.rb#38
2494
- def progname=(progname); end
2495
-
2496
- # source://rack//lib/rack/null_logger.rb#46
2497
- def reopen(logdev = T.unsafe(nil)); end
2498
-
2499
- # source://rack//lib/rack/null_logger.rb#36
2500
- def sev_threshold; end
2501
-
2502
- # source://rack//lib/rack/null_logger.rb#41
2503
- def sev_threshold=(sev_threshold); end
2504
-
2505
- # source://rack//lib/rack/null_logger.rb#21
2506
- def unknown(progname = T.unsafe(nil), &block); end
2507
-
2508
- # source://rack//lib/rack/null_logger.rb#18
2509
- def warn(progname = T.unsafe(nil), &block); end
2510
-
2511
- # source://rack//lib/rack/null_logger.rb#31
2512
- def warn!; end
2513
-
2514
- # @return [Boolean]
2515
- #
2516
- # source://rack//lib/rack/null_logger.rb#24
2517
- def warn?; end
2518
- end
2519
-
2520
- # source://rack//lib/rack/constants.rb#34
2521
- Rack::OPTIONS = T.let(T.unsafe(nil), String)
2522
-
2523
- # source://rack//lib/rack/constants.rb#31
2524
- Rack::PATCH = T.let(T.unsafe(nil), String)
2525
-
2526
- # source://rack//lib/rack/constants.rb#8
2527
- Rack::PATH_INFO = T.let(T.unsafe(nil), String)
2528
-
2529
- # source://rack//lib/rack/constants.rb#29
2530
- Rack::POST = T.let(T.unsafe(nil), String)
2531
-
2532
- # source://rack//lib/rack/constants.rb#30
2533
- Rack::PUT = T.let(T.unsafe(nil), String)
2534
-
2535
- # source://rack//lib/rack/constants.rb#12
2536
- Rack::QUERY_STRING = T.let(T.unsafe(nil), String)
2537
-
2538
- # source://rack//lib/rack/query_parser.rb#7
2539
- class Rack::QueryParser
2540
- # @return [QueryParser] a new instance of QueryParser
2541
- #
2542
- # source://rack//lib/rack/query_parser.rb#60
2543
- def initialize(params_class, param_depth_limit, bytesize_limit: T.unsafe(nil), params_limit: T.unsafe(nil)); end
2544
-
2545
- # source://rack//lib/rack/query_parser.rb#192
2546
- def make_params; end
2547
-
2548
- # source://rack//lib/rack/query_parser.rb#196
2549
- def new_depth_limit(param_depth_limit); end
2550
-
2551
- # normalize_params recursively expands parameters into structural types. If
2552
- # the structural types represented by two different parameter names are in
2553
- # conflict, a ParameterTypeError is raised. The depth argument is deprecated
2554
- # and should no longer be used, it is kept for backwards compatibility with
2555
- # earlier versions of rack.
2556
- #
2557
- # source://rack//lib/rack/query_parser.rb#120
2558
- def normalize_params(params, name, v, _depth = T.unsafe(nil)); end
2559
-
2560
- # Returns the value of attribute param_depth_limit.
2561
- #
2562
- # source://rack//lib/rack/query_parser.rb#40
2563
- def param_depth_limit; end
2564
-
2565
- # parse_nested_query expands a query string into structural types. Supported
2566
- # types are Arrays, Hashes and basic value types. It is possible to supply
2567
- # query strings with parameters of conflicting types, in this case a
2568
- # ParameterTypeError is raised. Users are encouraged to return a 400 in this
2569
- # case.
2570
- #
2571
- # source://rack//lib/rack/query_parser.rb#99
2572
- def parse_nested_query(qs, separator = T.unsafe(nil)); end
2573
-
2574
- # Stolen from Mongrel, with some small modifications:
2575
- # Parses a query string by breaking it up at the '&'. You can also use this
2576
- # to parse cookies by changing the characters used in the second parameter
2577
- # (which defaults to '&').
2578
- #
2579
- # source://rack//lib/rack/query_parser.rb#71
2580
- def parse_query(qs, separator = T.unsafe(nil), &unescaper); end
2581
-
2582
- private
2583
-
2584
- # @raise [ParamsTooDeepError]
2585
- #
2586
- # source://rack//lib/rack/query_parser.rb#124
2587
- def _normalize_params(params, name, v, depth); end
2588
-
2589
- # source://rack//lib/rack/query_parser.rb#218
2590
- def check_query_string(qs, sep); end
2591
-
2592
- # @return [Boolean]
2593
- #
2594
- # source://rack//lib/rack/query_parser.rb#206
2595
- def params_hash_has_key?(hash, key); end
2596
-
2597
- # @return [Boolean]
2598
- #
2599
- # source://rack//lib/rack/query_parser.rb#202
2600
- def params_hash_type?(obj); end
2601
-
2602
- # source://rack//lib/rack/query_parser.rb#234
2603
- def unescape(string, encoding = T.unsafe(nil)); end
2604
-
2605
- class << self
2606
- # source://rack//lib/rack/query_parser.rb#36
2607
- def make_default(param_depth_limit, **options); end
2608
- end
2609
- end
2610
-
2611
- # source://rack//lib/rack/query_parser.rb#54
2612
- Rack::QueryParser::BYTESIZE_LIMIT = T.let(T.unsafe(nil), Integer)
2613
-
2614
- # source://rack//lib/rack/query_parser.rb#9
2615
- Rack::QueryParser::COMMON_SEP = T.let(T.unsafe(nil), Hash)
2616
-
2617
- # source://rack//lib/rack/query_parser.rb#8
2618
- Rack::QueryParser::DEFAULT_SEP = T.let(T.unsafe(nil), Regexp)
2619
-
2620
- # InvalidParameterError is the error that is raised when incoming structural
2621
- # parameters (parsed by parse_nested_query) contain invalid format or byte
2622
- # sequence.
2623
- #
2624
- # source://rack//lib/rack/query_parser.rb#20
2625
- class Rack::QueryParser::InvalidParameterError < ::ArgumentError
2626
- include ::Rack::BadRequest
2627
- end
2628
-
2629
- # source://rack//lib/rack/query_parser.rb#57
2630
- Rack::QueryParser::PARAMS_LIMIT = T.let(T.unsafe(nil), Integer)
2631
-
2632
- # ParameterTypeError is the error that is raised when incoming structural
2633
- # parameters (parsed by parse_nested_query) contain conflicting types.
2634
- #
2635
- # source://rack//lib/rack/query_parser.rb#13
2636
- class Rack::QueryParser::ParameterTypeError < ::TypeError
2637
- include ::Rack::BadRequest
2638
- end
2639
-
2640
- # source://rack//lib/rack/query_parser.rb#238
2641
- class Rack::QueryParser::Params < ::Hash
2642
- def to_params_hash; end
2643
- end
2644
-
2645
- # ParamsTooDeepError is the old name for the error that is raised when params
2646
- # are recursively nested over the specified limit. Make it the same as
2647
- # as QueryLimitError, so that code that rescues ParamsTooDeepError error
2648
- # to handle bad query strings also now handles other limits.
2649
- #
2650
- # source://rack//lib/rack/query_parser.rb#34
2651
- Rack::QueryParser::ParamsTooDeepError = Rack::QueryParser::QueryLimitError
2652
-
2653
- # QueryLimitError is for errors raised when the query provided exceeds one
2654
- # of the query parser limits.
2655
- #
2656
- # source://rack//lib/rack/query_parser.rb#26
2657
- class Rack::QueryParser::QueryLimitError < ::RangeError
2658
- include ::Rack::BadRequest
2659
- end
2660
-
2661
- # source://rack//lib/rack/constants.rb#43
2662
- Rack::RACK_EARLY_HINTS = T.let(T.unsafe(nil), String)
2663
-
2664
- # source://rack//lib/rack/constants.rb#44
2665
- Rack::RACK_ERRORS = T.let(T.unsafe(nil), String)
2666
-
2667
- # source://rack//lib/rack/constants.rb#51
2668
- Rack::RACK_HIJACK = T.let(T.unsafe(nil), String)
2669
-
2670
- # source://rack//lib/rack/constants.rb#46
2671
- Rack::RACK_INPUT = T.let(T.unsafe(nil), String)
2672
-
2673
- # source://rack//lib/rack/constants.rb#52
2674
- Rack::RACK_IS_HIJACK = T.let(T.unsafe(nil), String)
2675
-
2676
- # source://rack//lib/rack/constants.rb#45
2677
- Rack::RACK_LOGGER = T.let(T.unsafe(nil), String)
2678
-
2679
- # source://rack//lib/rack/constants.rb#66
2680
- Rack::RACK_METHODOVERRIDE_ORIGINAL_METHOD = T.let(T.unsafe(nil), String)
2681
-
2682
- # source://rack//lib/rack/constants.rb#54
2683
- Rack::RACK_MULTIPART_BUFFER_SIZE = T.let(T.unsafe(nil), String)
2684
-
2685
- # source://rack//lib/rack/constants.rb#55
2686
- Rack::RACK_MULTIPART_TEMPFILE_FACTORY = T.let(T.unsafe(nil), String)
2687
-
2688
- # source://rack//lib/rack/constants.rb#53
2689
- Rack::RACK_RECURSIVE_INCLUDE = T.let(T.unsafe(nil), String)
2690
-
2691
- # source://rack//lib/rack/constants.rb#62
2692
- Rack::RACK_REQUEST_COOKIE_HASH = T.let(T.unsafe(nil), String)
2693
-
2694
- # source://rack//lib/rack/constants.rb#63
2695
- Rack::RACK_REQUEST_COOKIE_STRING = T.let(T.unsafe(nil), String)
2696
-
2697
- # source://rack//lib/rack/constants.rb#61
2698
- Rack::RACK_REQUEST_FORM_ERROR = T.let(T.unsafe(nil), String)
2699
-
2700
- # source://rack//lib/rack/constants.rb#58
2701
- Rack::RACK_REQUEST_FORM_HASH = T.let(T.unsafe(nil), String)
2702
-
2703
- # source://rack//lib/rack/constants.rb#57
2704
- Rack::RACK_REQUEST_FORM_INPUT = T.let(T.unsafe(nil), String)
2705
-
2706
- # source://rack//lib/rack/constants.rb#59
2707
- Rack::RACK_REQUEST_FORM_PAIRS = T.let(T.unsafe(nil), String)
2708
-
2709
- # source://rack//lib/rack/constants.rb#60
2710
- Rack::RACK_REQUEST_FORM_VARS = T.let(T.unsafe(nil), String)
2711
-
2712
- # source://rack//lib/rack/constants.rb#64
2713
- Rack::RACK_REQUEST_QUERY_HASH = T.let(T.unsafe(nil), String)
2714
-
2715
- # source://rack//lib/rack/constants.rb#65
2716
- Rack::RACK_REQUEST_QUERY_STRING = T.let(T.unsafe(nil), String)
2717
-
2718
- # source://rack//lib/rack/constants.rb#56
2719
- Rack::RACK_RESPONSE_FINISHED = T.let(T.unsafe(nil), String)
2720
-
2721
- # source://rack//lib/rack/constants.rb#47
2722
- Rack::RACK_SESSION = T.let(T.unsafe(nil), String)
2723
-
2724
- # source://rack//lib/rack/constants.rb#48
2725
- Rack::RACK_SESSION_OPTIONS = T.let(T.unsafe(nil), String)
2726
-
2727
- # source://rack//lib/rack/constants.rb#49
2728
- Rack::RACK_SHOWSTATUS_DETAIL = T.let(T.unsafe(nil), String)
2729
-
2730
- # source://rack//lib/rack/constants.rb#42
2731
- Rack::RACK_TEMPFILES = T.let(T.unsafe(nil), String)
2732
-
2733
- # source://rack//lib/rack/constants.rb#50
2734
- Rack::RACK_URL_SCHEME = T.let(T.unsafe(nil), String)
2735
-
2736
- # Rack environment variables
2737
- #
2738
- # source://rack//lib/rack/constants.rb#41
2739
- Rack::RACK_VERSION = T.let(T.unsafe(nil), String)
2740
-
2741
- # source://rack//lib/rack/version.rb#15
2742
- Rack::RELEASE = T.let(T.unsafe(nil), String)
2743
-
2744
- # source://rack//lib/rack/constants.rb#9
2745
- Rack::REQUEST_METHOD = T.let(T.unsafe(nil), String)
2746
-
2747
- # source://rack//lib/rack/constants.rb#10
2748
- Rack::REQUEST_PATH = T.let(T.unsafe(nil), String)
2749
-
2750
- # Rack::Recursive allows applications called down the chain to
2751
- # include data from other applications (by using
2752
- # <tt>rack['rack.recursive.include'][...]</tt> or raise a
2753
- # ForwardRequest to redirect internally.
2754
- #
2755
- # source://rack//lib/rack/recursive.rb#36
2756
- class Rack::Recursive
2757
- # @return [Recursive] a new instance of Recursive
2758
- #
2759
- # source://rack//lib/rack/recursive.rb#37
2760
- def initialize(app); end
2761
-
2762
- # source://rack//lib/rack/recursive.rb#45
2763
- def _call(env); end
2764
-
2765
- # source://rack//lib/rack/recursive.rb#41
2766
- def call(env); end
2767
-
2768
- # source://rack//lib/rack/recursive.rb#52
2769
- def include(env, path); end
2770
- end
2771
-
2772
- # High performant source reloader
2773
- #
2774
- # This class acts as Rack middleware.
2775
- #
2776
- # What makes it especially suited for use in a production environment is that
2777
- # any file will only be checked once and there will only be made one system
2778
- # call stat(2).
2779
- #
2780
- # Please note that this will not reload files in the background, it does so
2781
- # only when actively called.
2782
- #
2783
- # It is performing a check/reload cycle at the start of every request, but
2784
- # also respects a cool down time, during which nothing will be done.
2785
- #
2786
- # source://rack//lib/rack/reloader.rb#24
2787
- class Rack::Reloader
2788
- # @return [Reloader] a new instance of Reloader
2789
- #
2790
- # source://rack//lib/rack/reloader.rb#25
2791
- def initialize(app, cooldown = T.unsafe(nil), backend = T.unsafe(nil)); end
2792
-
2793
- # source://rack//lib/rack/reloader.rb#36
2794
- def call(env); end
2795
-
2796
- # source://rack//lib/rack/reloader.rb#50
2797
- def reload!(stderr = T.unsafe(nil)); end
2798
-
2799
- # A safe Kernel::load, issuing the hooks depending on the results
2800
- #
2801
- # source://rack//lib/rack/reloader.rb#58
2802
- def safe_load(file, mtime, stderr = T.unsafe(nil)); end
2803
- end
2804
-
2805
- # source://rack//lib/rack/reloader.rb#68
2806
- module Rack::Reloader::Stat
2807
- # Takes a relative or absolute +file+ name, a couple possible +paths+ that
2808
- # the +file+ might reside in. Returns the full path and File::Stat for the
2809
- # path.
2810
- #
2811
- # source://rack//lib/rack/reloader.rb#88
2812
- def figure_path(file, paths); end
2813
-
2814
- # source://rack//lib/rack/reloader.rb#69
2815
- def rotation; end
2816
-
2817
- # source://rack//lib/rack/reloader.rb#103
2818
- def safe_stat(file); end
2819
- end
2820
-
2821
- # Rack::Request provides a convenient interface to a Rack
2822
- # environment. It is stateless, the environment +env+ passed to the
2823
- # constructor will be directly modified.
2824
- #
2825
- # req = Rack::Request.new(env)
2826
- # req.post?
2827
- # req.params["data"]
2828
- #
2829
- # source://rack//lib/rack/request.rb#16
2830
- class Rack::Request
2831
- include ::Rack::Request::Env
2832
- include ::Rack::Request::Helpers
2833
-
2834
- # @return [Request] a new instance of Request
2835
- #
2836
- # source://rack//lib/rack/request.rb#62
2837
- def initialize(env); end
2838
-
2839
- # source://rack//lib/rack/request.rb#76
2840
- def delete_param(k); end
2841
-
2842
- # source://rack//lib/rack/request.rb#67
2843
- def params; end
2844
-
2845
- # source://rack//lib/rack/request.rb#67
2846
- def query; end
2847
-
2848
- # source://rack//lib/rack/request.rb#71
2849
- def update_param(k, v); end
2850
-
2851
- # source://yard/0.9.37/lib/yard/server/rack_adapter.rb#94
2852
- def version_supplied; end
2853
-
2854
- # source://yard/0.9.37/lib/yard/server/rack_adapter.rb#94
2855
- def version_supplied=(_arg0); end
2856
-
2857
- # source://yard/0.9.37/lib/yard/server/rack_adapter.rb#96
2858
- def xhr?; end
2859
-
2860
- class << self
2861
- # The priority when checking forwarded headers. The default
2862
- # is <tt>[:forwarded, :x_forwarded]</tt>, which means, check the
2863
- # +Forwarded+ header first, followed by the appropriate
2864
- # <tt>X-Forwarded-*</tt> header. You can revert the priority by
2865
- # reversing the priority, or remove checking of either
2866
- # or both headers by removing elements from the array.
2867
- #
2868
- # This should be set as appropriate in your environment
2869
- # based on what reverse proxies are in use. If you are not
2870
- # using reverse proxies, you should probably use an empty
2871
- # array.
2872
- #
2873
- # source://rack//lib/rack/request.rb#31
2874
- def forwarded_priority; end
2875
-
2876
- # The priority when checking forwarded headers. The default
2877
- # is <tt>[:forwarded, :x_forwarded]</tt>, which means, check the
2878
- # +Forwarded+ header first, followed by the appropriate
2879
- # <tt>X-Forwarded-*</tt> header. You can revert the priority by
2880
- # reversing the priority, or remove checking of either
2881
- # or both headers by removing elements from the array.
2882
- #
2883
- # This should be set as appropriate in your environment
2884
- # based on what reverse proxies are in use. If you are not
2885
- # using reverse proxies, you should probably use an empty
2886
- # array.
2887
- #
2888
- # source://rack//lib/rack/request.rb#31
2889
- def forwarded_priority=(_arg0); end
2890
-
2891
- # Returns the value of attribute ip_filter.
2892
- #
2893
- # source://rack//lib/rack/request.rb#18
2894
- def ip_filter; end
2895
-
2896
- # Sets the attribute ip_filter
2897
- #
2898
- # @param value the value to set the attribute ip_filter to.
2899
- #
2900
- # source://rack//lib/rack/request.rb#18
2901
- def ip_filter=(_arg0); end
2902
-
2903
- # The priority when checking either the <tt>X-Forwarded-Proto</tt>
2904
- # or <tt>X-Forwarded-Scheme</tt> header for the forwarded protocol.
2905
- # The default is <tt>[:proto, :scheme]</tt>, to try the
2906
- # <tt>X-Forwarded-Proto</tt> header before the
2907
- # <tt>X-Forwarded-Scheme</tt> header. Rack 2 had behavior
2908
- # similar to <tt>[:scheme, :proto]</tt>. You can remove either or
2909
- # both of the entries in array to ignore that respective header.
2910
- #
2911
- # source://rack//lib/rack/request.rb#40
2912
- def x_forwarded_proto_priority; end
2913
-
2914
- # The priority when checking either the <tt>X-Forwarded-Proto</tt>
2915
- # or <tt>X-Forwarded-Scheme</tt> header for the forwarded protocol.
2916
- # The default is <tt>[:proto, :scheme]</tt>, to try the
2917
- # <tt>X-Forwarded-Proto</tt> header before the
2918
- # <tt>X-Forwarded-Scheme</tt> header. Rack 2 had behavior
2919
- # similar to <tt>[:scheme, :proto]</tt>. You can remove either or
2920
- # both of the entries in array to ignore that respective header.
2921
- #
2922
- # source://rack//lib/rack/request.rb#40
2923
- def x_forwarded_proto_priority=(_arg0); end
2924
- end
2925
- end
2926
-
2927
- # source://rack//lib/rack/request.rb#60
2928
- Rack::Request::ALLOWED_SCHEMES = T.let(T.unsafe(nil), Array)
2929
-
2930
- # source://rack//lib/rack/request.rb#82
2931
- module Rack::Request::Env
2932
- # source://rack//lib/rack/request.rb#86
2933
- def initialize(env); end
2934
-
2935
- # Add a header that may have multiple values.
2936
- #
2937
- # Example:
2938
- # request.add_header 'Accept', 'image/png'
2939
- # request.add_header 'Accept', '*/*'
2940
- #
2941
- # assert_equal 'image/png,*/*', request.get_header('Accept')
2942
- #
2943
- # http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2
2944
- #
2945
- # source://rack//lib/rack/request.rb#129
2946
- def add_header(key, v); end
2947
-
2948
- # Delete a request specific value for `name`.
2949
- #
2950
- # source://rack//lib/rack/request.rb#140
2951
- def delete_header(name); end
2952
-
2953
- # Loops through each key / value pair in the request specific data.
2954
- #
2955
- # source://rack//lib/rack/request.rb#111
2956
- def each_header(&block); end
2957
-
2958
- # The environment of the request.
2959
- #
2960
- # source://rack//lib/rack/request.rb#84
2961
- def env; end
2962
-
2963
- # If a block is given, it yields to the block if the value hasn't been set
2964
- # on the request.
2965
- #
2966
- # source://rack//lib/rack/request.rb#106
2967
- def fetch_header(name, &block); end
2968
-
2969
- # Get a request specific value for `name`.
2970
- #
2971
- # source://rack//lib/rack/request.rb#100
2972
- def get_header(name); end
2973
-
2974
- # Predicate method to test to see if `name` has been set as request
2975
- # specific data
2976
- #
2977
- # @return [Boolean]
2978
- #
2979
- # source://rack//lib/rack/request.rb#95
2980
- def has_header?(name); end
2981
-
2982
- # Set a request specific value for `name` to `v`
2983
- #
2984
- # source://rack//lib/rack/request.rb#116
2985
- def set_header(name, v); end
2986
-
2987
- private
2988
-
2989
- # source://rack//lib/rack/request.rb#144
2990
- def initialize_copy(other); end
2991
- end
2992
-
2993
- # source://rack//lib/rack/request.rb#149
2994
- module Rack::Request::Helpers
2995
- # Returns the data received in the query string.
2996
- #
2997
- # source://rack//lib/rack/request.rb#484
2998
- def GET; end
2999
-
3000
- # Returns the data received in the request body.
3001
- #
3002
- # This method support both application/x-www-form-urlencoded and
3003
- # multipart/form-data.
3004
- #
3005
- # source://rack//lib/rack/request.rb#503
3006
- def POST; end
3007
-
3008
- # source://rack//lib/rack/request.rb#607
3009
- def accept_encoding; end
3010
-
3011
- # source://rack//lib/rack/request.rb#611
3012
- def accept_language; end
3013
-
3014
- # The authority of the incoming request as defined by RFC3976.
3015
- # https://tools.ietf.org/html/rfc3986#section-3.2
3016
- #
3017
- # In HTTP/1, this is the `host` header.
3018
- # In HTTP/2, this is the `:authority` pseudo-header.
3019
- #
3020
- # source://rack//lib/rack/request.rb#266
3021
- def authority; end
3022
-
3023
- # source://rack//lib/rack/request.rb#590
3024
- def base_url; end
3025
-
3026
- # source://rack//lib/rack/request.rb#190
3027
- def body; end
3028
-
3029
- # The character set of the request body if a "charset" media type
3030
- # parameter was given, or nil if no "charset" was specified. Note
3031
- # that, per RFC2616, text/* media types that specify no explicit
3032
- # charset are to be considered ISO-8859-1.
3033
- #
3034
- # source://rack//lib/rack/request.rb#458
3035
- def content_charset; end
3036
-
3037
- # source://rack//lib/rack/request.rb#199
3038
- def content_length; end
3039
-
3040
- # source://rack//lib/rack/request.rb#308
3041
- def content_type; end
3042
-
3043
- # source://rack//lib/rack/request.rb#293
3044
- def cookies; end
3045
-
3046
- # Checks the HTTP request method (or verb) to see if it was of type DELETE
3047
- #
3048
- # @return [Boolean]
3049
- #
3050
- # source://rack//lib/rack/request.rb#220
3051
- def delete?; end
3052
-
3053
- # Destructively delete a parameter, whether it's in GET or POST. Returns the value of the deleted parameter.
3054
- #
3055
- # If the parameter is in both GET and POST, the POST value takes precedence since that's how #params works.
3056
- #
3057
- # <tt>env['rack.input']</tt> is not touched.
3058
- #
3059
- # source://rack//lib/rack/request.rb#585
3060
- def delete_param(k); end
3061
-
3062
- # Determine whether the request body contains form-data by checking
3063
- # the request content-type for one of the media-types:
3064
- # "application/x-www-form-urlencoded" or "multipart/form-data". The
3065
- # list of form-data media types can be modified through the
3066
- # +FORM_DATA_MEDIA_TYPES+ array.
3067
- #
3068
- # A request body is also assumed to contain form-data when no
3069
- # content-type header is provided and the request_method is POST.
3070
- #
3071
- # @return [Boolean]
3072
- #
3073
- # source://rack//lib/rack/request.rb#470
3074
- def form_data?; end
3075
-
3076
- # source://rack//lib/rack/request.rb#393
3077
- def forwarded_authority; end
3078
-
3079
- # source://rack//lib/rack/request.rb#353
3080
- def forwarded_for; end
3081
-
3082
- # source://rack//lib/rack/request.rb#374
3083
- def forwarded_port; end
3084
-
3085
- # source://rack//lib/rack/request.rb#603
3086
- def fullpath; end
3087
-
3088
- # Checks the HTTP request method (or verb) to see if it was of type GET
3089
- #
3090
- # @return [Boolean]
3091
- #
3092
- # source://rack//lib/rack/request.rb#223
3093
- def get?; end
3094
-
3095
- # Checks the HTTP request method (or verb) to see if it was of type HEAD
3096
- #
3097
- # @return [Boolean]
3098
- #
3099
- # source://rack//lib/rack/request.rb#226
3100
- def head?; end
3101
-
3102
- # Returns a formatted host, suitable for being used in a URI.
3103
- #
3104
- # source://rack//lib/rack/request.rb#333
3105
- def host; end
3106
-
3107
- # The `HTTP_HOST` header.
3108
- #
3109
- # source://rack//lib/rack/request.rb#318
3110
- def host_authority; end
3111
-
3112
- # source://rack//lib/rack/request.rb#322
3113
- def host_with_port(authority = T.unsafe(nil)); end
3114
-
3115
- # Returns an address suitable for being to resolve to an address.
3116
- # In the case of a domain name or IPv4 address, the result is the same
3117
- # as +host+. In the case of IPv6 or future address formats, the square
3118
- # brackets are removed.
3119
- #
3120
- # source://rack//lib/rack/request.rb#341
3121
- def hostname; end
3122
-
3123
- # source://rack//lib/rack/request.rb#414
3124
- def ip; end
3125
-
3126
- # Checks the HTTP request method (or verb) to see if it was of type LINK
3127
- #
3128
- # @return [Boolean]
3129
- #
3130
- # source://rack//lib/rack/request.rb#232
3131
- def link?; end
3132
-
3133
- # source://rack//lib/rack/request.rb#200
3134
- def logger; end
3135
-
3136
- # The media type (type/subtype) portion of the CONTENT_TYPE header
3137
- # without any media type parameters. e.g., when CONTENT_TYPE is
3138
- # "text/plain;charset=utf-8", the media-type is "text/plain".
3139
- #
3140
- # For more information on the use of media types in HTTP, see:
3141
- # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7
3142
- #
3143
- # source://rack//lib/rack/request.rb#441
3144
- def media_type; end
3145
-
3146
- # The media type parameters provided in CONTENT_TYPE as a Hash, or
3147
- # an empty Hash if no CONTENT_TYPE or media-type parameters were
3148
- # provided. e.g., when the CONTENT_TYPE is "text/plain;charset=utf-8",
3149
- # this method responds with the following Hash:
3150
- # { 'charset' => 'utf-8' }
3151
- #
3152
- # source://rack//lib/rack/request.rb#450
3153
- def media_type_params; end
3154
-
3155
- # Checks the HTTP request method (or verb) to see if it was of type OPTIONS
3156
- #
3157
- # @return [Boolean]
3158
- #
3159
- # source://rack//lib/rack/request.rb#229
3160
- def options?; end
3161
-
3162
- # The union of GET and POST data.
3163
- #
3164
- # Note that modifications will not be persisted in the env. Use update_param or delete_param if you want to destructively modify params.
3165
- #
3166
- # source://rack//lib/rack/request.rb#556
3167
- def params; end
3168
-
3169
- # Determine whether the request body contains data by checking
3170
- # the request media_type against registered parse-data media-types
3171
- #
3172
- # @return [Boolean]
3173
- #
3174
- # source://rack//lib/rack/request.rb#479
3175
- def parseable_data?; end
3176
-
3177
- # Checks the HTTP request method (or verb) to see if it was of type PATCH
3178
- #
3179
- # @return [Boolean]
3180
- #
3181
- # source://rack//lib/rack/request.rb#235
3182
- def patch?; end
3183
-
3184
- # source://rack//lib/rack/request.rb#599
3185
- def path; end
3186
-
3187
- # source://rack//lib/rack/request.rb#194
3188
- def path_info; end
3189
-
3190
- # source://rack//lib/rack/request.rb#195
3191
- def path_info=(s); end
3192
-
3193
- # source://rack//lib/rack/request.rb#345
3194
- def port; end
3195
-
3196
- # Checks the HTTP request method (or verb) to see if it was of type POST
3197
- #
3198
- # @return [Boolean]
3199
- #
3200
- # source://rack//lib/rack/request.rb#238
3201
- def post?; end
3202
-
3203
- # Checks the HTTP request method (or verb) to see if it was of type PUT
3204
- #
3205
- # @return [Boolean]
3206
- #
3207
- # source://rack//lib/rack/request.rb#241
3208
- def put?; end
3209
-
3210
- # source://rack//lib/rack/request.rb#198
3211
- def query_string; end
3212
-
3213
- # the referer of the client
3214
- #
3215
- # source://rack//lib/rack/request.rb#204
3216
- def referer; end
3217
-
3218
- # the referer of the client
3219
- #
3220
- # source://rack//lib/rack/request.rb#204
3221
- def referrer; end
3222
-
3223
- # source://rack//lib/rack/request.rb#197
3224
- def request_method; end
3225
-
3226
- # source://rack//lib/rack/request.rb#249
3227
- def scheme; end
3228
-
3229
- # source://rack//lib/rack/request.rb#191
3230
- def script_name; end
3231
-
3232
- # source://rack//lib/rack/request.rb#192
3233
- def script_name=(s); end
3234
-
3235
- # The authority as defined by the `SERVER_NAME` and `SERVER_PORT`
3236
- # variables.
3237
- #
3238
- # source://rack//lib/rack/request.rb#272
3239
- def server_authority; end
3240
-
3241
- # source://rack//lib/rack/request.rb#285
3242
- def server_name; end
3243
-
3244
- # source://rack//lib/rack/request.rb#289
3245
- def server_port; end
3246
-
3247
- # source://rack//lib/rack/request.rb#207
3248
- def session; end
3249
-
3250
- # source://rack//lib/rack/request.rb#213
3251
- def session_options; end
3252
-
3253
- # @return [Boolean]
3254
- #
3255
- # source://rack//lib/rack/request.rb#410
3256
- def ssl?; end
3257
-
3258
- # Checks the HTTP request method (or verb) to see if it was of type TRACE
3259
- #
3260
- # @return [Boolean]
3261
- #
3262
- # source://rack//lib/rack/request.rb#244
3263
- def trace?; end
3264
-
3265
- # @return [Boolean]
3266
- #
3267
- # source://rack//lib/rack/request.rb#615
3268
- def trusted_proxy?(ip); end
3269
-
3270
- # Checks the HTTP request method (or verb) to see if it was of type UNLINK
3271
- #
3272
- # @return [Boolean]
3273
- #
3274
- # source://rack//lib/rack/request.rb#247
3275
- def unlink?; end
3276
-
3277
- # Destructively update a parameter, whether it's in GET and/or POST. Returns nil.
3278
- #
3279
- # The parameter is updated wherever it was previous defined, so GET, POST, or both. If it wasn't previously defined, it's inserted into GET.
3280
- #
3281
- # <tt>env['rack.input']</tt> is not touched.
3282
- #
3283
- # source://rack//lib/rack/request.rb#565
3284
- def update_param(k, v); end
3285
-
3286
- # Tries to return a remake of the original request URL as a string.
3287
- #
3288
- # source://rack//lib/rack/request.rb#595
3289
- def url; end
3290
-
3291
- # source://rack//lib/rack/request.rb#201
3292
- def user_agent; end
3293
-
3294
- # like Hash#values_at
3295
- #
3296
- # source://rack//lib/rack/request.rb#620
3297
- def values_at(*keys); end
3298
-
3299
- # @return [Boolean]
3300
- #
3301
- # source://rack//lib/rack/request.rb#313
3302
- def xhr?; end
3303
-
3304
- private
3305
-
3306
- # source://rack//lib/rack/request.rb#776
3307
- def allowed_scheme(header); end
3308
-
3309
- # source://rack//lib/rack/request.rb#628
3310
- def default_session; end
3311
-
3312
- # source://rack//lib/rack/request.rb#684
3313
- def expand_param_pairs(pairs, query_parser = T.unsafe(nil)); end
3314
-
3315
- # source://rack//lib/rack/request.rb#780
3316
- def forwarded_priority; end
3317
-
3318
- # source://rack//lib/rack/request.rb#752
3319
- def forwarded_scheme; end
3320
-
3321
- # Get an array of values set in the RFC 7239 `Forwarded` request header.
3322
- #
3323
- # source://rack//lib/rack/request.rb#668
3324
- def get_http_forwarded(token); end
3325
-
3326
- # source://rack//lib/rack/request.rb#644
3327
- def parse_http_accept_header(header); end
3328
-
3329
- # source://rack//lib/rack/request.rb#680
3330
- def parse_multipart; end
3331
-
3332
- # source://rack//lib/rack/request.rb#676
3333
- def parse_query(qs, d = T.unsafe(nil)); end
3334
-
3335
- # source://rack//lib/rack/request.rb#672
3336
- def query_parser; end
3337
-
3338
- # source://rack//lib/rack/request.rb#743
3339
- def reject_trusted_ip_addresses(ip_addresses); end
3340
-
3341
- # source://rack//lib/rack/request.rb#737
3342
- def split_authority(authority); end
3343
-
3344
- # source://rack//lib/rack/request.rb#694
3345
- def split_header(value); end
3346
-
3347
- # Assist with compatibility when processing `X-Forwarded-For`.
3348
- #
3349
- # source://rack//lib/rack/request.rb#631
3350
- def wrap_ipv6(host); end
3351
-
3352
- # source://rack//lib/rack/request.rb#784
3353
- def x_forwarded_proto_priority; end
3354
- end
3355
-
3356
- # source://rack//lib/rack/request.rb#722
3357
- Rack::Request::Helpers::AUTHORITY = T.let(T.unsafe(nil), Regexp)
3358
-
3359
- # Default ports depending on scheme. Used to decide whether or not
3360
- # to include the port in a generated URI.
3361
- #
3362
- # source://rack//lib/rack/request.rb#168
3363
- Rack::Request::Helpers::DEFAULT_PORTS = T.let(T.unsafe(nil), Hash)
3364
-
3365
- # The set of form-data media-types. Requests that do not indicate
3366
- # one of the media types present in this list will not be eligible
3367
- # for form-data / param parsing.
3368
- #
3369
- # source://rack//lib/rack/request.rb#153
3370
- Rack::Request::Helpers::FORM_DATA_MEDIA_TYPES = T.let(T.unsafe(nil), Array)
3371
-
3372
- # source://rack//lib/rack/request.rb#747
3373
- Rack::Request::Helpers::FORWARDED_SCHEME_HEADERS = T.let(T.unsafe(nil), Hash)
3374
-
3375
- # source://rack//lib/rack/request.rb#176
3376
- Rack::Request::Helpers::HTTP_FORWARDED = T.let(T.unsafe(nil), String)
3377
-
3378
- # The address of the client which connected to the proxy.
3379
- #
3380
- # source://rack//lib/rack/request.rb#171
3381
- Rack::Request::Helpers::HTTP_X_FORWARDED_FOR = T.let(T.unsafe(nil), String)
3382
-
3383
- # The contents of the host/:authority header sent to the proxy.
3384
- #
3385
- # source://rack//lib/rack/request.rb#174
3386
- Rack::Request::Helpers::HTTP_X_FORWARDED_HOST = T.let(T.unsafe(nil), String)
3387
-
3388
- # The port used to connect to the proxy.
3389
- #
3390
- # source://rack//lib/rack/request.rb#185
3391
- Rack::Request::Helpers::HTTP_X_FORWARDED_PORT = T.let(T.unsafe(nil), String)
3392
-
3393
- # The protocol used to connect to the proxy.
3394
- #
3395
- # source://rack//lib/rack/request.rb#182
3396
- Rack::Request::Helpers::HTTP_X_FORWARDED_PROTO = T.let(T.unsafe(nil), String)
3397
-
3398
- # The value of the scheme sent to the proxy.
3399
- #
3400
- # source://rack//lib/rack/request.rb#179
3401
- Rack::Request::Helpers::HTTP_X_FORWARDED_SCHEME = T.let(T.unsafe(nil), String)
3402
-
3403
- # Another way for specifying https scheme was used.
3404
- #
3405
- # source://rack//lib/rack/request.rb#188
3406
- Rack::Request::Helpers::HTTP_X_FORWARDED_SSL = T.let(T.unsafe(nil), String)
3407
-
3408
- # The set of media-types. Requests that do not indicate
3409
- # one of the media types present in this list will not be eligible
3410
- # for param parsing like soap attachments or generic multiparts
3411
- #
3412
- # source://rack//lib/rack/request.rb#161
3413
- Rack::Request::Helpers::PARSEABLE_DATA_MEDIA_TYPES = T.let(T.unsafe(nil), Array)
3414
-
3415
- # Rack::Response provides a convenient interface to create a Rack
3416
- # response.
3417
- #
3418
- # It allows setting of headers and cookies, and provides useful
3419
- # defaults (an OK response with empty headers and body).
3420
- #
3421
- # You can use Response#write to iteratively generate your response,
3422
- # but note that this is buffered by Rack::Response until you call
3423
- # +finish+. +finish+ however can take a block inside which calls to
3424
- # +write+ are synchronous with the Rack response.
3425
- #
3426
- # Your application's +call+ should end returning Response#finish.
3427
- #
3428
- # source://rack//lib/rack/response.rb#23
3429
- class Rack::Response
3430
- include ::Rack::Response::Helpers
3431
-
3432
- # Initialize the response object with the specified +body+, +status+
3433
- # and +headers+.
3434
- #
3435
- # If the +body+ is +nil+, construct an empty response object with internal
3436
- # buffering.
3437
- #
3438
- # If the +body+ responds to +to_str+, assume it's a string-like object and
3439
- # construct a buffered response object containing using that string as the
3440
- # initial contents of the buffer.
3441
- #
3442
- # Otherwise it is expected +body+ conforms to the normal requirements of a
3443
- # Rack response body, typically implementing one of +each+ (enumerable
3444
- # body) or +call+ (streaming body).
3445
- #
3446
- # The +status+ defaults to +200+ which is the "OK" HTTP status code. You
3447
- # can provide any other valid status code.
3448
- #
3449
- # The +headers+ must be a +Hash+ of key-value header pairs which conform to
3450
- # the Rack specification for response headers. The key must be a +String+
3451
- # instance and the value can be either a +String+ or +Array+ instance.
3452
- #
3453
- # @return [Response] a new instance of Response
3454
- # @yield [_self]
3455
- # @yieldparam _self [Rack::Response] the object that the method was called on
3456
- #
3457
- # source://rack//lib/rack/response.rb#54
3458
- def initialize(body = T.unsafe(nil), status = T.unsafe(nil), headers = T.unsafe(nil)); end
3459
-
3460
- # @raise [ArgumentError]
3461
- #
3462
- # source://rack//lib/rack/response.rb#164
3463
- def [](key); end
3464
-
3465
- # @raise [ArgumentError]
3466
- #
3467
- # source://rack//lib/rack/response.rb#168
3468
- def []=(key, value); end
3469
-
3470
- # Returns the value of attribute body.
3471
- #
3472
- # source://rack//lib/rack/response.rb#31
3473
- def body; end
3474
-
3475
- # Sets the attribute body
3476
- #
3477
- # @param value the value to set the attribute body to.
3478
- #
3479
- # source://rack//lib/rack/response.rb#31
3480
- def body=(_arg0); end
3481
-
3482
- # @return [Boolean]
3483
- #
3484
- # source://rack//lib/rack/response.rb#95
3485
- def chunked?; end
3486
-
3487
- # source://rack//lib/rack/response.rb#152
3488
- def close; end
3489
-
3490
- # @raise [ArgumentError]
3491
- #
3492
- # source://rack//lib/rack/response.rb#172
3493
- def delete_header(key); end
3494
-
3495
- # source://rack//lib/rack/response.rb#130
3496
- def each(&callback); end
3497
-
3498
- # @return [Boolean]
3499
- #
3500
- # source://rack//lib/rack/response.rb#156
3501
- def empty?; end
3502
-
3503
- # Generate a response array consistent with the requirements of the SPEC.
3504
- # which is suitable to be returned from the middleware `#call(env)` method.
3505
- #
3506
- # @return [Array] a 3-tuple suitable of `[status, headers, body]`
3507
- #
3508
- # source://rack//lib/rack/response.rb#107
3509
- def finish(&block); end
3510
-
3511
- # @raise [ArgumentError]
3512
- #
3513
- # source://rack//lib/rack/response.rb#164
3514
- def get_header(key); end
3515
-
3516
- # @raise [ArgumentError]
3517
- # @return [Boolean]
3518
- #
3519
- # source://rack//lib/rack/response.rb#160
3520
- def has_header?(key); end
3521
-
3522
- # Returns the value of attribute headers.
3523
- #
3524
- # source://rack//lib/rack/response.rb#32
3525
- def headers; end
3526
-
3527
- # Returns the value of attribute length.
3528
- #
3529
- # source://rack//lib/rack/response.rb#31
3530
- def length; end
3531
-
3532
- # Sets the attribute length
3533
- #
3534
- # @param value the value to set the attribute length to.
3535
- #
3536
- # source://rack//lib/rack/response.rb#31
3537
- def length=(_arg0); end
3538
-
3539
- # @return [Boolean]
3540
- #
3541
- # source://rack//lib/rack/response.rb#99
3542
- def no_entity_body?; end
3543
-
3544
- # source://rack//lib/rack/response.rb#90
3545
- def redirect(target, status = T.unsafe(nil)); end
3546
-
3547
- # @raise [ArgumentError]
3548
- #
3549
- # source://rack//lib/rack/response.rb#168
3550
- def set_header(key, value); end
3551
-
3552
- # Returns the value of attribute status.
3553
- #
3554
- # source://rack//lib/rack/response.rb#31
3555
- def status; end
3556
-
3557
- # Sets the attribute status
3558
- #
3559
- # @param value the value to set the attribute status to.
3560
- #
3561
- # source://rack//lib/rack/response.rb#31
3562
- def status=(_arg0); end
3563
-
3564
- # Generate a response array consistent with the requirements of the SPEC.
3565
- # which is suitable to be returned from the middleware `#call(env)` method.
3566
- # For *response
3567
- #
3568
- # @return [Array] a 3-tuple suitable of `[status, headers, body]`
3569
- #
3570
- # source://rack//lib/rack/response.rb#107
3571
- def to_a(&block); end
3572
-
3573
- # Append a chunk to the response body.
3574
- #
3575
- # Converts the response into a buffered response if it wasn't already.
3576
- #
3577
- # NOTE: Do not mix #write and direct #body access!
3578
- #
3579
- # source://rack//lib/rack/response.rb#146
3580
- def write(chunk); end
3581
-
3582
- class << self
3583
- # source://rack//lib/rack/response.rb#24
3584
- def [](status, headers, body); end
3585
- end
3586
- end
3587
-
3588
- # source://rack//lib/rack/response.rb#28
3589
- Rack::Response::CHUNKED = T.let(T.unsafe(nil), String)
3590
-
3591
- # source://rack//lib/rack/response.rb#180
3592
- module Rack::Response::Helpers
3593
- # @return [Boolean]
3594
- #
3595
- # source://rack//lib/rack/response.rb#191
3596
- def accepted?; end
3597
-
3598
- # Add a header that may have multiple values.
3599
- #
3600
- # Example:
3601
- # response.add_header 'vary', 'accept-encoding'
3602
- # response.add_header 'vary', 'cookie'
3603
- #
3604
- # assert_equal 'accept-encoding,cookie', response.get_header('vary')
3605
- #
3606
- # http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2
3607
- #
3608
- # @raise [ArgumentError]
3609
- #
3610
- # source://rack//lib/rack/response.rb#219
3611
- def add_header(key, value); end
3612
-
3613
- # @return [Boolean]
3614
- #
3615
- # source://rack//lib/rack/response.rb#194
3616
- def bad_request?; end
3617
-
3618
- # Specify that the content should be cached.
3619
- #
3620
- # @option directive
3621
- # @param duration [Integer] The number of seconds until the cache expires.
3622
- # @param directive [Hash] a customizable set of options
3623
- #
3624
- # source://rack//lib/rack/response.rb#307
3625
- def cache!(duration = T.unsafe(nil), directive: T.unsafe(nil)); end
3626
-
3627
- # source://rack//lib/rack/response.rb#290
3628
- def cache_control; end
3629
-
3630
- # source://rack//lib/rack/response.rb#294
3631
- def cache_control=(value); end
3632
-
3633
- # @return [Boolean]
3634
- #
3635
- # source://rack//lib/rack/response.rb#186
3636
- def client_error?; end
3637
-
3638
- # source://rack//lib/rack/response.rb#257
3639
- def content_length; end
3640
-
3641
- # Get the content type of the response.
3642
- #
3643
- # source://rack//lib/rack/response.rb#240
3644
- def content_type; end
3645
-
3646
- # Set the content type of the response.
3647
- #
3648
- # source://rack//lib/rack/response.rb#245
3649
- def content_type=(content_type); end
3650
-
3651
- # @return [Boolean]
3652
- #
3653
- # source://rack//lib/rack/response.rb#190
3654
- def created?; end
3655
-
3656
- # source://rack//lib/rack/response.rb#274
3657
- def delete_cookie(key, value = T.unsafe(nil)); end
3658
-
3659
- # Specifies that the content shouldn't be cached. Overrides `cache!` if already called.
3660
- #
3661
- # source://rack//lib/rack/response.rb#299
3662
- def do_not_cache!; end
3663
-
3664
- # source://rack//lib/rack/response.rb#314
3665
- def etag; end
3666
-
3667
- # source://rack//lib/rack/response.rb#318
3668
- def etag=(value); end
3669
-
3670
- # @return [Boolean]
3671
- #
3672
- # source://rack//lib/rack/response.rb#196
3673
- def forbidden?; end
3674
-
3675
- # @return [Boolean]
3676
- #
3677
- # source://rack//lib/rack/response.rb#206
3678
- def include?(header); end
3679
-
3680
- # @return [Boolean]
3681
- #
3682
- # source://rack//lib/rack/response.rb#183
3683
- def informational?; end
3684
-
3685
- # @return [Boolean]
3686
- #
3687
- # source://rack//lib/rack/response.rb#181
3688
- def invalid?; end
3689
-
3690
- # source://rack//lib/rack/response.rb#262
3691
- def location; end
3692
-
3693
- # source://rack//lib/rack/response.rb#266
3694
- def location=(location); end
3695
-
3696
- # source://rack//lib/rack/response.rb#249
3697
- def media_type; end
3698
-
3699
- # source://rack//lib/rack/response.rb#253
3700
- def media_type_params; end
3701
-
3702
- # @return [Boolean]
3703
- #
3704
- # source://rack//lib/rack/response.rb#198
3705
- def method_not_allowed?; end
3706
-
3707
- # @return [Boolean]
3708
- #
3709
- # source://rack//lib/rack/response.rb#193
3710
- def moved_permanently?; end
3711
-
3712
- # @return [Boolean]
3713
- #
3714
- # source://rack//lib/rack/response.rb#192
3715
- def no_content?; end
3716
-
3717
- # @return [Boolean]
3718
- #
3719
- # source://rack//lib/rack/response.rb#199
3720
- def not_acceptable?; end
3721
-
3722
- # @return [Boolean]
3723
- #
3724
- # source://rack//lib/rack/response.rb#197
3725
- def not_found?; end
3726
-
3727
- # @return [Boolean]
3728
- #
3729
- # source://rack//lib/rack/response.rb#189
3730
- def ok?; end
3731
-
3732
- # @return [Boolean]
3733
- #
3734
- # source://rack//lib/rack/response.rb#201
3735
- def precondition_failed?; end
3736
-
3737
- # @return [Boolean]
3738
- #
3739
- # source://rack//lib/rack/response.rb#204
3740
- def redirect?; end
3741
-
3742
- # @return [Boolean]
3743
- #
3744
- # source://rack//lib/rack/response.rb#185
3745
- def redirection?; end
3746
-
3747
- # @return [Boolean]
3748
- #
3749
- # source://rack//lib/rack/response.rb#200
3750
- def request_timeout?; end
3751
-
3752
- # @return [Boolean]
3753
- #
3754
- # source://rack//lib/rack/response.rb#187
3755
- def server_error?; end
3756
-
3757
- # source://rack//lib/rack/response.rb#270
3758
- def set_cookie(key, value); end
3759
-
3760
- # source://rack//lib/rack/response.rb#282
3761
- def set_cookie_header; end
3762
-
3763
- # source://rack//lib/rack/response.rb#286
3764
- def set_cookie_header=(value); end
3765
-
3766
- # @return [Boolean]
3767
- #
3768
- # source://rack//lib/rack/response.rb#184
3769
- def successful?; end
3770
-
3771
- # @return [Boolean]
3772
- #
3773
- # source://rack//lib/rack/response.rb#195
3774
- def unauthorized?; end
3775
-
3776
- # @return [Boolean]
3777
- #
3778
- # source://rack//lib/rack/response.rb#202
3779
- def unprocessable?; end
3780
-
3781
- protected
3782
-
3783
- # source://rack//lib/rack/response.rb#359
3784
- def append(chunk); end
3785
-
3786
- # Convert the body of this response into an internally buffered Array if possible.
3787
- #
3788
- # `@buffered` is a ternary value which indicates whether the body is buffered. It can be:
3789
- # * `nil` - The body has not been buffered yet.
3790
- # * `true` - The body is buffered as an Array instance.
3791
- # * `false` - The body is not buffered and cannot be buffered.
3792
- #
3793
- # @return [Boolean] whether the body is buffered as an Array instance.
3794
- #
3795
- # source://rack//lib/rack/response.rb#332
3796
- def buffered_body!; end
3797
- end
3798
-
3799
- # source://rack//lib/rack/response.rb#375
3800
- class Rack::Response::Raw
3801
- include ::Rack::Response::Helpers
3802
-
3803
- # @return [Raw] a new instance of Raw
3804
- #
3805
- # source://rack//lib/rack/response.rb#381
3806
- def initialize(status, headers); end
3807
-
3808
- # source://rack//lib/rack/response.rb#398
3809
- def delete_header(key); end
3810
-
3811
- # source://rack//lib/rack/response.rb#390
3812
- def get_header(key); end
3813
-
3814
- # @return [Boolean]
3815
- #
3816
- # source://rack//lib/rack/response.rb#386
3817
- def has_header?(key); end
3818
-
3819
- # Returns the value of attribute headers.
3820
- #
3821
- # source://rack//lib/rack/response.rb#378
3822
- def headers; end
3823
-
3824
- # source://rack//lib/rack/response.rb#394
3825
- def set_header(key, value); end
3826
-
3827
- # Returns the value of attribute status.
3828
- #
3829
- # source://rack//lib/rack/response.rb#379
3830
- def status; end
3831
-
3832
- # Sets the attribute status
3833
- #
3834
- # @param value the value to set the attribute status to.
3835
- #
3836
- # source://rack//lib/rack/response.rb#379
3837
- def status=(_arg0); end
3838
- end
3839
-
3840
- # source://rack//lib/rack/response.rb#29
3841
- Rack::Response::STATUS_WITH_NO_ENTITY_BODY = T.let(T.unsafe(nil), Hash)
3842
-
3843
- # Class which can make any IO object rewindable, including non-rewindable ones. It does
3844
- # this by buffering the data into a tempfile, which is rewindable.
3845
- #
3846
- # Don't forget to call #close when you're done. This frees up temporary resources that
3847
- # RewindableInput uses, though it does *not* close the original IO object.
3848
- #
3849
- # source://rack//lib/rack/rewindable_input.rb#14
3850
- class Rack::RewindableInput
3851
- # @return [RewindableInput] a new instance of RewindableInput
3852
- #
3853
- # source://rack//lib/rack/rewindable_input.rb#29
3854
- def initialize(io); end
3855
-
3856
- # Closes this RewindableInput object without closing the originally
3857
- # wrapped IO object. Cleans up any temporary resources that this RewindableInput
3858
- # has created.
3859
- #
3860
- # This method may be called multiple times. It does nothing on subsequent calls.
3861
- #
3862
- # source://rack//lib/rack/rewindable_input.rb#65
3863
- def close; end
3864
-
3865
- # source://rack//lib/rack/rewindable_input.rb#45
3866
- def each(&block); end
3867
-
3868
- # source://rack//lib/rack/rewindable_input.rb#35
3869
- def gets; end
3870
-
3871
- # source://rack//lib/rack/rewindable_input.rb#40
3872
- def read(*args); end
3873
-
3874
- # source://rack//lib/rack/rewindable_input.rb#50
3875
- def rewind; end
3876
-
3877
- # source://rack//lib/rack/rewindable_input.rb#55
3878
- def size; end
3879
-
3880
- private
3881
-
3882
- # @return [Boolean]
3883
- #
3884
- # source://rack//lib/rack/rewindable_input.rb#109
3885
- def filesystem_has_posix_semantics?; end
3886
-
3887
- # source://rack//lib/rack/rewindable_input.rb#78
3888
- def make_rewindable; end
3889
- end
3890
-
3891
- # Makes rack.input rewindable, for compatibility with applications and middleware
3892
- # designed for earlier versions of Rack (where rack.input was required to be
3893
- # rewindable).
3894
- #
3895
- # source://rack//lib/rack/rewindable_input.rb#18
3896
- class Rack::RewindableInput::Middleware
3897
- # @return [Middleware] a new instance of Middleware
3898
- #
3899
- # source://rack//lib/rack/rewindable_input.rb#19
3900
- def initialize(app); end
3901
-
3902
- # source://rack//lib/rack/rewindable_input.rb#23
3903
- def call(env); end
3904
- end
3905
-
3906
- # Sets an "x-runtime" response header, indicating the response
3907
- # time of the request, in seconds
3908
- #
3909
- # You can put it right before the application to see the processing
3910
- # time, or before all the other middlewares to include time for them,
3911
- # too.
3912
- #
3913
- # source://rack//lib/rack/runtime.rb#12
3914
- class Rack::Runtime
3915
- # @return [Runtime] a new instance of Runtime
3916
- #
3917
- # source://rack//lib/rack/runtime.rb#16
3918
- def initialize(app, name = T.unsafe(nil)); end
3919
-
3920
- # source://rack//lib/rack/runtime.rb#22
3921
- def call(env); end
3922
- end
3923
-
3924
- # source://rack//lib/rack/runtime.rb#13
3925
- Rack::Runtime::FORMAT_STRING = T.let(T.unsafe(nil), String)
3926
-
3927
- # source://rack//lib/rack/runtime.rb#14
3928
- Rack::Runtime::HEADER_NAME = T.let(T.unsafe(nil), String)
3929
-
3930
- # source://rack//lib/rack/constants.rb#11
3931
- Rack::SCRIPT_NAME = T.let(T.unsafe(nil), String)
3932
-
3933
- # source://rack//lib/rack/constants.rb#14
3934
- Rack::SERVER_NAME = T.let(T.unsafe(nil), String)
3935
-
3936
- # source://rack//lib/rack/constants.rb#15
3937
- Rack::SERVER_PORT = T.let(T.unsafe(nil), String)
3938
-
3939
- # source://rack//lib/rack/constants.rb#13
3940
- Rack::SERVER_PROTOCOL = T.let(T.unsafe(nil), String)
3941
-
3942
- # source://rack//lib/rack/constants.rb#24
3943
- Rack::SET_COOKIE = T.let(T.unsafe(nil), String)
3944
-
3945
- # = Sendfile
3946
- #
3947
- # The Sendfile middleware intercepts responses whose body is being
3948
- # served from a file and replaces it with a server specific x-sendfile
3949
- # header. The web server is then responsible for writing the file contents
3950
- # to the client. This can dramatically reduce the amount of work required
3951
- # by the Ruby backend and takes advantage of the web server's optimized file
3952
- # delivery code.
3953
- #
3954
- # In order to take advantage of this middleware, the response body must
3955
- # respond to +to_path+ and the request must include an x-sendfile-type
3956
- # header. Rack::Files and other components implement +to_path+ so there's
3957
- # rarely anything you need to do in your application. The x-sendfile-type
3958
- # header is typically set in your web servers configuration. The following
3959
- # sections attempt to document
3960
- #
3961
- # === Nginx
3962
- #
3963
- # Nginx supports the x-accel-redirect header. This is similar to x-sendfile
3964
- # but requires parts of the filesystem to be mapped into a private URL
3965
- # hierarchy.
3966
- #
3967
- # The following example shows the Nginx configuration required to create
3968
- # a private "/files/" area, enable x-accel-redirect, and pass the special
3969
- # x-sendfile-type and x-accel-mapping headers to the backend:
3970
- #
3971
- # location ~ /files/(.*) {
3972
- # internal;
3973
- # alias /var/www/$1;
3974
- # }
3975
- #
3976
- # location / {
3977
- # proxy_redirect off;
3978
- #
3979
- # proxy_set_header Host $host;
3980
- # proxy_set_header X-Real-IP $remote_addr;
3981
- # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
3982
- #
3983
- # proxy_set_header x-sendfile-type x-accel-redirect;
3984
- # proxy_set_header x-accel-mapping /var/www/=/files/;
3985
- #
3986
- # proxy_pass http://127.0.0.1:8080/;
3987
- # }
3988
- #
3989
- # Note that the x-sendfile-type header must be set exactly as shown above.
3990
- # The x-accel-mapping header should specify the location on the file system,
3991
- # followed by an equals sign (=), followed name of the private URL pattern
3992
- # that it maps to. The middleware performs a simple substitution on the
3993
- # resulting path.
3994
- #
3995
- # See Also: https://www.nginx.com/resources/wiki/start/topics/examples/xsendfile
3996
- #
3997
- # === lighttpd
3998
- #
3999
- # Lighttpd has supported some variation of the x-sendfile header for some
4000
- # time, although only recent version support x-sendfile in a reverse proxy
4001
- # configuration.
4002
- #
4003
- # $HTTP["host"] == "example.com" {
4004
- # proxy-core.protocol = "http"
4005
- # proxy-core.balancer = "round-robin"
4006
- # proxy-core.backends = (
4007
- # "127.0.0.1:8000",
4008
- # "127.0.0.1:8001",
4009
- # ...
4010
- # )
4011
- #
4012
- # proxy-core.allow-x-sendfile = "enable"
4013
- # proxy-core.rewrite-request = (
4014
- # "x-sendfile-type" => (".*" => "x-sendfile")
4015
- # )
4016
- # }
4017
- #
4018
- # See Also: http://redmine.lighttpd.net/wiki/lighttpd/Docs:ModProxyCore
4019
- #
4020
- # === Apache
4021
- #
4022
- # x-sendfile is supported under Apache 2.x using a separate module:
4023
- #
4024
- # https://tn123.org/mod_xsendfile/
4025
- #
4026
- # Once the module is compiled and installed, you can enable it using
4027
- # XSendFile config directive:
4028
- #
4029
- # RequestHeader Set x-sendfile-type x-sendfile
4030
- # ProxyPassReverse / http://localhost:8001/
4031
- # XSendFile on
4032
- #
4033
- # === Mapping parameter
4034
- #
4035
- # The third parameter allows for an overriding extension of the
4036
- # x-accel-mapping header. Mappings should be provided in tuples of internal to
4037
- # external. The internal values may contain regular expression syntax, they
4038
- # will be matched with case indifference.
4039
- #
4040
- # source://rack//lib/rack/sendfile.rb#104
4041
- class Rack::Sendfile
4042
- # @return [Sendfile] a new instance of Sendfile
4043
- #
4044
- # source://rack//lib/rack/sendfile.rb#105
4045
- def initialize(app, variation = T.unsafe(nil), mappings = T.unsafe(nil)); end
4046
-
4047
- # source://rack//lib/rack/sendfile.rb#113
4048
- def call(env); end
4049
-
4050
- private
4051
-
4052
- # source://rack//lib/rack/sendfile.rb#154
4053
- def map_accel_path(env, path); end
4054
-
4055
- # source://rack//lib/rack/sendfile.rb#148
4056
- def variation(env); end
4057
- end
4058
-
4059
- # Rack::ShowExceptions catches all exceptions raised from the app it
4060
- # wraps. It shows a useful backtrace with the sourcefile and
4061
- # clickable context, the whole Rack environment and the request
4062
- # data.
4063
- #
4064
- # Be careful when you use this on public-facing sites as it could
4065
- # reveal information helpful to attackers.
4066
- #
4067
- # source://rack//lib/rack/show_exceptions.rb#18
4068
- class Rack::ShowExceptions
4069
- # @return [ShowExceptions] a new instance of ShowExceptions
4070
- #
4071
- # source://rack//lib/rack/show_exceptions.rb#26
4072
- def initialize(app); end
4073
-
4074
- # source://rack//lib/rack/show_exceptions.rb#30
4075
- def call(env); end
4076
-
4077
- # source://rack//lib/rack/show_exceptions.rb#65
4078
- def dump_exception(exception); end
4079
-
4080
- # source://rack//lib/rack/show_exceptions.rb#116
4081
- def h(obj); end
4082
-
4083
- # @return [Boolean]
4084
- #
4085
- # source://rack//lib/rack/show_exceptions.rb#56
4086
- def prefers_plaintext?(env); end
4087
-
4088
- # source://rack//lib/rack/show_exceptions.rb#76
4089
- def pretty(env, exception); end
4090
-
4091
- # source://rack//lib/rack/show_exceptions.rb#112
4092
- def template; end
4093
-
4094
- private
4095
-
4096
- # @return [Boolean]
4097
- #
4098
- # source://rack//lib/rack/show_exceptions.rb#60
4099
- def accepts_html?(env); end
4100
- end
4101
-
4102
- # source://rack//lib/rack/show_exceptions.rb#19
4103
- Rack::ShowExceptions::CONTEXT = T.let(T.unsafe(nil), Integer)
4104
-
4105
- # source://rack//lib/rack/show_exceptions.rb#21
4106
- class Rack::ShowExceptions::Frame < ::Struct
4107
- # Returns the value of attribute context_line
4108
- #
4109
- # @return [Object] the current value of context_line
4110
- def context_line; end
4111
-
4112
- # Sets the attribute context_line
4113
- #
4114
- # @param value [Object] the value to set the attribute context_line to.
4115
- # @return [Object] the newly set value
4116
- def context_line=(_); end
4117
-
4118
- # Returns the value of attribute filename
4119
- #
4120
- # @return [Object] the current value of filename
4121
- def filename; end
4122
-
4123
- # Sets the attribute filename
4124
- #
4125
- # @param value [Object] the value to set the attribute filename to.
4126
- # @return [Object] the newly set value
4127
- def filename=(_); end
4128
-
4129
- # Returns the value of attribute function
4130
- #
4131
- # @return [Object] the current value of function
4132
- def function; end
4133
-
4134
- # Sets the attribute function
4135
- #
4136
- # @param value [Object] the value to set the attribute function to.
4137
- # @return [Object] the newly set value
4138
- def function=(_); end
4139
-
4140
- # Returns the value of attribute lineno
4141
- #
4142
- # @return [Object] the current value of lineno
4143
- def lineno; end
4144
-
4145
- # Sets the attribute lineno
4146
- #
4147
- # @param value [Object] the value to set the attribute lineno to.
4148
- # @return [Object] the newly set value
4149
- def lineno=(_); end
4150
-
4151
- # Returns the value of attribute post_context
4152
- #
4153
- # @return [Object] the current value of post_context
4154
- def post_context; end
4155
-
4156
- # Sets the attribute post_context
4157
- #
4158
- # @param value [Object] the value to set the attribute post_context to.
4159
- # @return [Object] the newly set value
4160
- def post_context=(_); end
4161
-
4162
- # Returns the value of attribute post_context_lineno
4163
- #
4164
- # @return [Object] the current value of post_context_lineno
4165
- def post_context_lineno; end
4166
-
4167
- # Sets the attribute post_context_lineno
4168
- #
4169
- # @param value [Object] the value to set the attribute post_context_lineno to.
4170
- # @return [Object] the newly set value
4171
- def post_context_lineno=(_); end
4172
-
4173
- # Returns the value of attribute pre_context
4174
- #
4175
- # @return [Object] the current value of pre_context
4176
- def pre_context; end
4177
-
4178
- # Sets the attribute pre_context
4179
- #
4180
- # @param value [Object] the value to set the attribute pre_context to.
4181
- # @return [Object] the newly set value
4182
- def pre_context=(_); end
4183
-
4184
- # Returns the value of attribute pre_context_lineno
4185
- #
4186
- # @return [Object] the current value of pre_context_lineno
4187
- def pre_context_lineno; end
4188
-
4189
- # Sets the attribute pre_context_lineno
4190
- #
4191
- # @param value [Object] the value to set the attribute pre_context_lineno to.
4192
- # @return [Object] the newly set value
4193
- def pre_context_lineno=(_); end
4194
-
4195
- class << self
4196
- def [](*_arg0); end
4197
- def inspect; end
4198
- def keyword_init?; end
4199
- def members; end
4200
- def new(*_arg0); end
4201
- end
4202
- end
4203
-
4204
- # source://rack//lib/rack/show_exceptions.rb#131
4205
- Rack::ShowExceptions::TEMPLATE = T.let(T.unsafe(nil), ERB)
4206
-
4207
- # Rack::ShowStatus catches all empty responses and replaces them
4208
- # with a site explaining the error.
4209
- #
4210
- # Additional details can be put into <tt>rack.showstatus.detail</tt>
4211
- # and will be shown as HTML. If such details exist, the error page
4212
- # is always rendered, even if the reply was not empty.
4213
- #
4214
- # source://rack//lib/rack/show_status.rb#18
4215
- class Rack::ShowStatus
4216
- # @return [ShowStatus] a new instance of ShowStatus
4217
- #
4218
- # source://rack//lib/rack/show_status.rb#19
4219
- def initialize(app); end
4220
-
4221
- # source://rack//lib/rack/show_status.rb#24
4222
- def call(env); end
4223
-
4224
- # source://rack//lib/rack/show_status.rb#54
4225
- def h(obj); end
4226
- end
4227
-
4228
- # source://rack//lib/rack/show_status.rb#69
4229
- Rack::ShowStatus::TEMPLATE = T.let(T.unsafe(nil), String)
4230
-
4231
- # The Rack::Static middleware intercepts requests for static files
4232
- # (javascript files, images, stylesheets, etc) based on the url prefixes or
4233
- # route mappings passed in the options, and serves them using a Rack::Files
4234
- # object. This allows a Rack stack to serve both static and dynamic content.
4235
- #
4236
- # Examples:
4237
- #
4238
- # Serve all requests beginning with /media from the "media" folder located
4239
- # in the current directory (ie media/*):
4240
- #
4241
- # use Rack::Static, :urls => ["/media"]
4242
- #
4243
- # Same as previous, but instead of returning 404 for missing files under
4244
- # /media, call the next middleware:
4245
- #
4246
- # use Rack::Static, :urls => ["/media"], :cascade => true
4247
- #
4248
- # Serve all requests beginning with /css or /images from the folder "public"
4249
- # in the current directory (ie public/css/* and public/images/*):
4250
- #
4251
- # use Rack::Static, :urls => ["/css", "/images"], :root => "public"
4252
- #
4253
- # Serve all requests to / with "index.html" from the folder "public" in the
4254
- # current directory (ie public/index.html):
4255
- #
4256
- # use Rack::Static, :urls => {"/" => 'index.html'}, :root => 'public'
4257
- #
4258
- # Serve all requests normally from the folder "public" in the current
4259
- # directory but uses index.html as default route for "/"
4260
- #
4261
- # use Rack::Static, :urls => [""], :root => 'public', :index =>
4262
- # 'index.html'
4263
- #
4264
- # Set custom HTTP Headers for based on rules:
4265
- #
4266
- # use Rack::Static, :root => 'public',
4267
- # :header_rules => [
4268
- # [rule, {header_field => content, header_field => content}],
4269
- # [rule, {header_field => content}]
4270
- # ]
4271
- #
4272
- # Rules for selecting files:
4273
- #
4274
- # 1) All files
4275
- # Provide the :all symbol
4276
- # :all => Matches every file
4277
- #
4278
- # 2) Folders
4279
- # Provide the folder path as a string
4280
- # '/folder' or '/folder/subfolder' => Matches files in a certain folder
4281
- #
4282
- # 3) File Extensions
4283
- # Provide the file extensions as an array
4284
- # ['css', 'js'] or %w(css js) => Matches files ending in .css or .js
4285
- #
4286
- # 4) Regular Expressions / Regexp
4287
- # Provide a regular expression
4288
- # %r{\.(?:css|js)\z} => Matches files ending in .css or .js
4289
- # /\.(?:eot|ttf|otf|woff2|woff|svg)\z/ => Matches files ending in
4290
- # the most common web font formats (.eot, .ttf, .otf, .woff2, .woff, .svg)
4291
- # Note: This Regexp is available as a shortcut, using the :fonts rule
4292
- #
4293
- # 5) Font Shortcut
4294
- # Provide the :fonts symbol
4295
- # :fonts => Uses the Regexp rule stated right above to match all common web font endings
4296
- #
4297
- # Rule Ordering:
4298
- # Rules are applied in the order that they are provided.
4299
- # List rather general rules above special ones.
4300
- #
4301
- # Complete example use case including HTTP header rules:
4302
- #
4303
- # use Rack::Static, :root => 'public',
4304
- # :header_rules => [
4305
- # # Cache all static files in public caches (e.g. Rack::Cache)
4306
- # # as well as in the browser
4307
- # [:all, {'cache-control' => 'public, max-age=31536000'}],
4308
- #
4309
- # # Provide web fonts with cross-origin access-control-headers
4310
- # # Firefox requires this when serving assets using a Content Delivery Network
4311
- # [:fonts, {'access-control-allow-origin' => '*'}]
4312
- # ]
4313
- #
4314
- # source://rack//lib/rack/static.rb#92
4315
- class Rack::Static
4316
- # @return [Static] a new instance of Static
4317
- #
4318
- # source://rack//lib/rack/static.rb#93
4319
- def initialize(app, options = T.unsafe(nil)); end
4320
-
4321
- # @return [Boolean]
4322
- #
4323
- # source://rack//lib/rack/static.rb#109
4324
- def add_index_root?(path); end
4325
-
4326
- # Convert HTTP header rules to HTTP headers
4327
- #
4328
- # source://rack//lib/rack/static.rb#167
4329
- def applicable_rules(path); end
4330
-
4331
- # source://rack//lib/rack/static.rb#125
4332
- def call(env); end
4333
-
4334
- # source://rack//lib/rack/static.rb#121
4335
- def can_serve(path); end
4336
-
4337
- # source://rack//lib/rack/static.rb#113
4338
- def overwrite_file_path(path); end
4339
-
4340
- # source://rack//lib/rack/static.rb#117
4341
- def route_file(path); end
4342
- end
4343
-
4344
- # source://rack//lib/rack/constants.rb#38
4345
- Rack::TRACE = T.let(T.unsafe(nil), String)
4346
-
4347
- # source://rack//lib/rack/constants.rb#25
4348
- Rack::TRANSFER_ENCODING = T.let(T.unsafe(nil), String)
4349
-
4350
- # Middleware tracks and cleans Tempfiles created throughout a request (i.e. Rack::Multipart)
4351
- # Ideas/strategy based on posts by Eric Wong and Charles Oliver Nutter
4352
- # https://groups.google.com/forum/#!searchin/rack-devel/temp/rack-devel/brK8eh-MByw/sw61oJJCGRMJ
4353
- #
4354
- # source://rack//lib/rack/tempfile_reaper.rb#11
4355
- class Rack::TempfileReaper
4356
- # @return [TempfileReaper] a new instance of TempfileReaper
4357
- #
4358
- # source://rack//lib/rack/tempfile_reaper.rb#12
4359
- def initialize(app); end
4360
-
4361
- # source://rack//lib/rack/tempfile_reaper.rb#16
4362
- def call(env); end
4363
- end
4364
-
4365
- # source://rack//lib/rack/constants.rb#37
4366
- Rack::UNLINK = T.let(T.unsafe(nil), String)
4367
-
4368
- # Rack::URLMap takes a hash mapping urls or paths to apps, and
4369
- # dispatches accordingly. Support for HTTP/1.1 host names exists if
4370
- # the URLs start with <tt>http://</tt> or <tt>https://</tt>.
4371
- #
4372
- # URLMap modifies the SCRIPT_NAME and PATH_INFO such that the part
4373
- # relevant for dispatch is in the SCRIPT_NAME, and the rest in the
4374
- # PATH_INFO. This should be taken care of when you need to
4375
- # reconstruct the URL in order to create links.
4376
- #
4377
- # URLMap dispatches in such a way that the longest paths are tried
4378
- # first, since they are most specific.
4379
- #
4380
- # source://rack//lib/rack/urlmap.rb#20
4381
- class Rack::URLMap
4382
- # @return [URLMap] a new instance of URLMap
4383
- #
4384
- # source://rack//lib/rack/urlmap.rb#21
4385
- def initialize(map = T.unsafe(nil)); end
4386
-
4387
- # source://rack//lib/rack/urlmap.rb#48
4388
- def call(env); end
4389
-
4390
- # source://rack//lib/rack/urlmap.rb#25
4391
- def remap(map); end
4392
-
4393
- private
4394
-
4395
- # @return [Boolean]
4396
- #
4397
- # source://rack//lib/rack/urlmap.rb#87
4398
- def casecmp?(v1, v2); end
4399
- end
4400
-
4401
- # Rack::Utils contains a grab-bag of useful methods for writing web
4402
- # applications adopted from all kinds of Ruby libraries.
4403
- #
4404
- # source://rack//lib/rack/utils.rb#20
4405
- module Rack::Utils
4406
- private
4407
-
4408
- # Return best accept value to use, based on the algorithm
4409
- # in RFC 2616 Section 14. If there are multiple best
4410
- # matches (same specificity and quality), the value returned
4411
- # is arbitrary.
4412
- #
4413
- # source://rack//lib/rack/utils.rb#167
4414
- def best_q_match(q_value_header, available_mimes); end
4415
-
4416
- # source://rack//lib/rack/utils.rb#120
4417
- def build_nested_query(value, prefix = T.unsafe(nil)); end
4418
-
4419
- # source://rack//lib/rack/utils.rb#110
4420
- def build_query(params); end
4421
-
4422
- # Parses the "Range:" header, if present, into an array of Range objects.
4423
- # Returns nil if the header is missing or syntactically invalid.
4424
- # Returns an empty array if none of the ranges are satisfiable.
4425
- #
4426
- # source://rack//lib/rack/utils.rb#409
4427
- def byte_ranges(env, size); end
4428
-
4429
- # source://rack//lib/rack/utils.rb#609
4430
- def clean_path_info(path_info); end
4431
-
4432
- # :nocov:
4433
- #
4434
- # source://rack//lib/rack/utils.rb#91
4435
- def clock_time; end
4436
-
4437
- # source://rack//lib/rack/utils.rb#367
4438
- def delete_cookie_header!(headers, key, value = T.unsafe(nil)); end
4439
-
4440
- # :call-seq:
4441
- # delete_set_cookie_header(key, value = {}) -> encoded string
4442
- #
4443
- # Generate an encoded string based on the given +key+ and +value+ using
4444
- # set_cookie_header for the purpose of causing the specified cookie to be
4445
- # deleted. The +value+ may be an instance of +Hash+ and can include
4446
- # attributes as outlined by set_cookie_header. The encoded cookie will have
4447
- # a +max_age+ of 0 seconds, an +expires+ date in the past and an empty
4448
- # +value+. When used with the +set-cookie+ header, it will cause the client
4449
- # to *remove* any matching cookie.
4450
- #
4451
- # delete_set_cookie_header("myname")
4452
- # # => "myname=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"
4453
- #
4454
- # source://rack//lib/rack/utils.rb#363
4455
- def delete_set_cookie_header(key, value = T.unsafe(nil)); end
4456
-
4457
- # :call-seq:
4458
- # delete_set_cookie_header!(header, key, value = {}) -> header value
4459
- #
4460
- # Set an expired cookie in the specified headers with the given cookie
4461
- # +key+ and +value+ using delete_set_cookie_header. This causes
4462
- # the client to immediately delete the specified cookie.
4463
- #
4464
- # delete_set_cookie_header!(nil, "mycookie")
4465
- # # => "mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"
4466
- #
4467
- # If the header is non-nil, it will be modified in place.
4468
- #
4469
- # header = []
4470
- # delete_set_cookie_header!(header, "mycookie")
4471
- # # => ["mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"]
4472
- # header
4473
- # # => ["mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"]
4474
- #
4475
- # source://rack//lib/rack/utils.rb#391
4476
- def delete_set_cookie_header!(header, key, value = T.unsafe(nil)); end
4477
-
4478
- # URI escapes. (CGI style space to +)
4479
- #
4480
- # source://rack//lib/rack/utils.rb#40
4481
- def escape(s); end
4482
-
4483
- # source://rack//lib/rack/utils.rb#262
4484
- def escape_cookie_key(key); end
4485
-
4486
- # Escape ampersands, brackets and quotes to their HTML/XML entities.
4487
- def escape_html(_arg0); end
4488
-
4489
- # Like URI escaping, but with %20 instead of +. Strictly speaking this is
4490
- # true URI escaping.
4491
- #
4492
- # source://rack//lib/rack/utils.rb#46
4493
- def escape_path(s); end
4494
-
4495
- # source://rack//lib/rack/utils.rb#149
4496
- def forwarded_values(forwarded_header); end
4497
-
4498
- # source://rack//lib/rack/utils.rb#413
4499
- def get_byte_ranges(http_range, size); end
4500
-
4501
- # :call-seq:
4502
- # parse_cookies(env) -> hash
4503
- #
4504
- # Parse cookies from the provided request environment using
4505
- # parse_cookies_header. Returns a map of cookie +key+ to cookie +value+.
4506
- #
4507
- # parse_cookies({'HTTP_COOKIE' => 'myname=myvalue'})
4508
- # # => {'myname' => 'myvalue'}
4509
- #
4510
- # source://rack//lib/rack/utils.rb#253
4511
- def parse_cookies(env); end
4512
-
4513
- # :call-seq:
4514
- # parse_cookies_header(value) -> hash
4515
- #
4516
- # Parse cookies from the provided header +value+ according to RFC6265. The
4517
- # syntax for cookie headers only supports semicolons. Returns a map of
4518
- # cookie +key+ to cookie +value+.
4519
- #
4520
- # parse_cookies_header('myname=myvalue; max-age=0')
4521
- # # => {"myname"=>"myvalue", "max-age"=>"0"}
4522
- #
4523
- # source://rack//lib/rack/utils.rb#234
4524
- def parse_cookies_header(value); end
4525
-
4526
- # source://rack//lib/rack/utils.rb#106
4527
- def parse_nested_query(qs, d = T.unsafe(nil)); end
4528
-
4529
- # source://rack//lib/rack/utils.rb#102
4530
- def parse_query(qs, d = T.unsafe(nil), &unescaper); end
4531
-
4532
- # source://rack//lib/rack/utils.rb#138
4533
- def q_values(q_value_header); end
4534
-
4535
- # source://rack//lib/rack/utils.rb#402
4536
- def rfc2822(time); end
4537
-
4538
- # :nocov:
4539
- #
4540
- # source://rack//lib/rack/utils.rb#455
4541
- def secure_compare(a, b); end
4542
-
4543
- # source://rack//lib/rack/utils.rb#192
4544
- def select_best_encoding(available_encodings, accept_encoding); end
4545
-
4546
- # :call-seq:
4547
- # set_cookie_header(key, value) -> encoded string
4548
- #
4549
- # Generate an encoded string using the provided +key+ and +value+ suitable
4550
- # for the +set-cookie+ header according to RFC6265. The +value+ may be an
4551
- # instance of either +String+ or +Hash+.
4552
- #
4553
- # If the cookie +value+ is an instance of +Hash+, it considers the following
4554
- # cookie attribute keys: +domain+, +max_age+, +expires+ (must be instance
4555
- # of +Time+), +secure+, +http_only+, +same_site+ and +value+. For more
4556
- # details about the interpretation of these fields, consult
4557
- # [RFC6265 Section 5.2](https://datatracker.ietf.org/doc/html/rfc6265#section-5.2).
4558
- #
4559
- # An extra cookie attribute +escape_key+ can be provided to control whether
4560
- # or not the cookie key is URL encoded. If explicitly set to +false+, the
4561
- # cookie key name will not be url encoded (escaped). The default is +true+.
4562
- #
4563
- # set_cookie_header("myname", "myvalue")
4564
- # # => "myname=myvalue"
4565
- #
4566
- # set_cookie_header("myname", {value: "myvalue", max_age: 10})
4567
- # # => "myname=myvalue; max-age=10"
4568
- #
4569
- # source://rack//lib/rack/utils.rb#294
4570
- def set_cookie_header(key, value); end
4571
-
4572
- # :call-seq:
4573
- # set_cookie_header!(headers, key, value) -> header value
4574
- #
4575
- # Append a cookie in the specified headers with the given cookie +key+ and
4576
- # +value+ using set_cookie_header.
4577
- #
4578
- # If the headers already contains a +set-cookie+ key, it will be converted
4579
- # to an +Array+ if not already, and appended to.
4580
- #
4581
- # source://rack//lib/rack/utils.rb#337
4582
- def set_cookie_header!(headers, key, value); end
4583
-
4584
- # source://rack//lib/rack/utils.rb#589
4585
- def status_code(status); end
4586
-
4587
- # Unescapes a URI escaped string with +encoding+. +encoding+ will be the
4588
- # target encoding of the string returned, and it defaults to UTF-8
4589
- #
4590
- # source://rack//lib/rack/utils.rb#58
4591
- def unescape(s, encoding = T.unsafe(nil)); end
4592
-
4593
- # Unescapes the **path** component of a URI. See Rack::Utils.unescape for
4594
- # unescaping query parameters or form components.
4595
- #
4596
- # source://rack//lib/rack/utils.rb#52
4597
- def unescape_path(s); end
4598
-
4599
- # source://rack//lib/rack/utils.rb#626
4600
- def valid_path?(path); end
4601
-
4602
- class << self
4603
- # Return best accept value to use, based on the algorithm
4604
- # in RFC 2616 Section 14. If there are multiple best
4605
- # matches (same specificity and quality), the value returned
4606
- # is arbitrary.
4607
- #
4608
- # source://rack//lib/rack/utils.rb#167
4609
- def best_q_match(q_value_header, available_mimes); end
4610
-
4611
- # source://rack//lib/rack/utils.rb#120
4612
- def build_nested_query(value, prefix = T.unsafe(nil)); end
4613
-
4614
- # source://rack//lib/rack/utils.rb#110
4615
- def build_query(params); end
4616
-
4617
- # Parses the "Range:" header, if present, into an array of Range objects.
4618
- # Returns nil if the header is missing or syntactically invalid.
4619
- # Returns an empty array if none of the ranges are satisfiable.
4620
- #
4621
- # source://rack//lib/rack/utils.rb#409
4622
- def byte_ranges(env, size); end
4623
-
4624
- # source://rack//lib/rack/utils.rb#609
4625
- def clean_path_info(path_info); end
4626
-
4627
- # source://rack//lib/rack/utils.rb#91
4628
- def clock_time; end
4629
-
4630
- # Returns the value of attribute default_query_parser.
4631
- #
4632
- # source://rack//lib/rack/utils.rb#30
4633
- def default_query_parser; end
4634
-
4635
- # Sets the attribute default_query_parser
4636
- #
4637
- # @param value the value to set the attribute default_query_parser to.
4638
- #
4639
- # source://rack//lib/rack/utils.rb#30
4640
- def default_query_parser=(_arg0); end
4641
-
4642
- # source://rack//lib/rack/utils.rb#367
4643
- def delete_cookie_header!(headers, key, value = T.unsafe(nil)); end
4644
-
4645
- # :call-seq:
4646
- # delete_set_cookie_header(key, value = {}) -> encoded string
4647
- #
4648
- # Generate an encoded string based on the given +key+ and +value+ using
4649
- # set_cookie_header for the purpose of causing the specified cookie to be
4650
- # deleted. The +value+ may be an instance of +Hash+ and can include
4651
- # attributes as outlined by set_cookie_header. The encoded cookie will have
4652
- # a +max_age+ of 0 seconds, an +expires+ date in the past and an empty
4653
- # +value+. When used with the +set-cookie+ header, it will cause the client
4654
- # to *remove* any matching cookie.
4655
- #
4656
- # delete_set_cookie_header("myname")
4657
- # # => "myname=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"
4658
- #
4659
- # source://rack//lib/rack/utils.rb#363
4660
- def delete_set_cookie_header(key, value = T.unsafe(nil)); end
4661
-
4662
- # :call-seq:
4663
- # delete_set_cookie_header!(header, key, value = {}) -> header value
4664
- #
4665
- # Set an expired cookie in the specified headers with the given cookie
4666
- # +key+ and +value+ using delete_set_cookie_header. This causes
4667
- # the client to immediately delete the specified cookie.
4668
- #
4669
- # delete_set_cookie_header!(nil, "mycookie")
4670
- # # => "mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"
4671
- #
4672
- # If the header is non-nil, it will be modified in place.
4673
- #
4674
- # header = []
4675
- # delete_set_cookie_header!(header, "mycookie")
4676
- # # => ["mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"]
4677
- # header
4678
- # # => ["mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"]
4679
- #
4680
- # source://rack//lib/rack/utils.rb#391
4681
- def delete_set_cookie_header!(header, key, value = T.unsafe(nil)); end
4682
-
4683
- # URI escapes. (CGI style space to +)
4684
- #
4685
- # source://rack//lib/rack/utils.rb#40
4686
- def escape(s); end
4687
-
4688
- # source://rack//lib/rack/utils.rb#262
4689
- def escape_cookie_key(key); end
4690
-
4691
- def escape_html(_arg0); end
4692
-
4693
- # Like URI escaping, but with %20 instead of +. Strictly speaking this is
4694
- # true URI escaping.
4695
- #
4696
- # source://rack//lib/rack/utils.rb#46
4697
- def escape_path(s); end
4698
-
4699
- # source://rack//lib/rack/utils.rb#149
4700
- def forwarded_values(forwarded_header); end
4701
-
4702
- # source://rack//lib/rack/utils.rb#413
4703
- def get_byte_ranges(http_range, size); end
4704
-
4705
- # Returns the value of attribute multipart_file_limit.
4706
- #
4707
- # source://rack//lib/rack/utils.rb#65
4708
- def multipart_file_limit; end
4709
-
4710
- # Sets the attribute multipart_file_limit
4711
- #
4712
- # @param value the value to set the attribute multipart_file_limit to.
4713
- #
4714
- # source://rack//lib/rack/utils.rb#65
4715
- def multipart_file_limit=(_arg0); end
4716
-
4717
- # Returns the value of attribute multipart_file_limit.
4718
- # multipart_part_limit is the original name of multipart_file_limit, but
4719
- # the limit only counts parts with filenames.
4720
- #
4721
- # source://rack//lib/rack/utils.rb#65
4722
- def multipart_part_limit; end
4723
-
4724
- # Sets the attribute multipart_file_limit
4725
- #
4726
- # @param value the value to set the attribute multipart_file_limit to.
4727
- #
4728
- # source://rack//lib/rack/utils.rb#65
4729
- def multipart_part_limit=(_arg0); end
4730
-
4731
- # Returns the value of attribute multipart_total_part_limit.
4732
- #
4733
- # source://rack//lib/rack/utils.rb#63
4734
- def multipart_total_part_limit; end
4735
-
4736
- # Sets the attribute multipart_total_part_limit
4737
- #
4738
- # @param value the value to set the attribute multipart_total_part_limit to.
4739
- #
4740
- # source://rack//lib/rack/utils.rb#63
4741
- def multipart_total_part_limit=(_arg0); end
4742
-
4743
- # source://rack//lib/rack/utils.rb#82
4744
- def param_depth_limit; end
4745
-
4746
- # source://rack//lib/rack/utils.rb#86
4747
- def param_depth_limit=(v); end
4748
-
4749
- # :call-seq:
4750
- # parse_cookies(env) -> hash
4751
- #
4752
- # Parse cookies from the provided request environment using
4753
- # parse_cookies_header. Returns a map of cookie +key+ to cookie +value+.
4754
- #
4755
- # parse_cookies({'HTTP_COOKIE' => 'myname=myvalue'})
4756
- # # => {'myname' => 'myvalue'}
4757
- #
4758
- # source://rack//lib/rack/utils.rb#253
4759
- def parse_cookies(env); end
4760
-
4761
- # :call-seq:
4762
- # parse_cookies_header(value) -> hash
4763
- #
4764
- # Parse cookies from the provided header +value+ according to RFC6265. The
4765
- # syntax for cookie headers only supports semicolons. Returns a map of
4766
- # cookie +key+ to cookie +value+.
4767
- #
4768
- # parse_cookies_header('myname=myvalue; max-age=0')
4769
- # # => {"myname"=>"myvalue", "max-age"=>"0"}
4770
- #
4771
- # source://rack//lib/rack/utils.rb#234
4772
- def parse_cookies_header(value); end
4773
-
4774
- # source://rack//lib/rack/utils.rb#106
4775
- def parse_nested_query(qs, d = T.unsafe(nil)); end
4776
-
4777
- # source://rack//lib/rack/utils.rb#102
4778
- def parse_query(qs, d = T.unsafe(nil), &unescaper); end
4779
-
4780
- # source://rack//lib/rack/utils.rb#138
4781
- def q_values(q_value_header); end
4782
-
4783
- # source://rack//lib/rack/utils.rb#402
4784
- def rfc2822(time); end
4785
-
4786
- # source://rack//lib/rack/utils.rb#455
4787
- def secure_compare(a, b); end
4788
-
4789
- # source://rack//lib/rack/utils.rb#192
4790
- def select_best_encoding(available_encodings, accept_encoding); end
4791
-
4792
- # :call-seq:
4793
- # set_cookie_header(key, value) -> encoded string
4794
- #
4795
- # Generate an encoded string using the provided +key+ and +value+ suitable
4796
- # for the +set-cookie+ header according to RFC6265. The +value+ may be an
4797
- # instance of either +String+ or +Hash+.
4798
- #
4799
- # If the cookie +value+ is an instance of +Hash+, it considers the following
4800
- # cookie attribute keys: +domain+, +max_age+, +expires+ (must be instance
4801
- # of +Time+), +secure+, +http_only+, +same_site+ and +value+. For more
4802
- # details about the interpretation of these fields, consult
4803
- # [RFC6265 Section 5.2](https://datatracker.ietf.org/doc/html/rfc6265#section-5.2).
4804
- #
4805
- # An extra cookie attribute +escape_key+ can be provided to control whether
4806
- # or not the cookie key is URL encoded. If explicitly set to +false+, the
4807
- # cookie key name will not be url encoded (escaped). The default is +true+.
4808
- #
4809
- # set_cookie_header("myname", "myvalue")
4810
- # # => "myname=myvalue"
4811
- #
4812
- # set_cookie_header("myname", {value: "myvalue", max_age: 10})
4813
- # # => "myname=myvalue; max-age=10"
4814
- #
4815
- # source://rack//lib/rack/utils.rb#294
4816
- def set_cookie_header(key, value); end
4817
-
4818
- # :call-seq:
4819
- # set_cookie_header!(headers, key, value) -> header value
4820
- #
4821
- # Append a cookie in the specified headers with the given cookie +key+ and
4822
- # +value+ using set_cookie_header.
4823
- #
4824
- # If the headers already contains a +set-cookie+ key, it will be converted
4825
- # to an +Array+ if not already, and appended to.
4826
- #
4827
- # source://rack//lib/rack/utils.rb#337
4828
- def set_cookie_header!(headers, key, value); end
4829
-
4830
- # source://rack//lib/rack/utils.rb#589
4831
- def status_code(status); end
4832
-
4833
- # Unescapes a URI escaped string with +encoding+. +encoding+ will be the
4834
- # target encoding of the string returned, and it defaults to UTF-8
4835
- #
4836
- # source://rack//lib/rack/utils.rb#58
4837
- def unescape(s, encoding = T.unsafe(nil)); end
4838
-
4839
- # Unescapes the **path** component of a URI. See Rack::Utils.unescape for
4840
- # unescaping query parameters or form components.
4841
- #
4842
- # source://rack//lib/rack/utils.rb#52
4843
- def unescape_path(s); end
4844
-
4845
- # @return [Boolean]
4846
- #
4847
- # source://rack//lib/rack/utils.rb#626
4848
- def valid_path?(path); end
4849
- end
4850
- end
4851
-
4852
- # source://rack//lib/rack/utils.rb#25
4853
- Rack::Utils::COMMON_SEP = T.let(T.unsafe(nil), Hash)
4854
-
4855
- # Context allows the use of a compatible middleware at different points
4856
- # in a request handling stack. A compatible middleware must define
4857
- # #context which should take the arguments env and app. The first of which
4858
- # would be the request environment. The second of which would be the rack
4859
- # application that the request would be forwarded to.
4860
- #
4861
- # source://rack//lib/rack/utils.rb#478
4862
- class Rack::Utils::Context
4863
- # @return [Context] a new instance of Context
4864
- #
4865
- # source://rack//lib/rack/utils.rb#481
4866
- def initialize(app_f, app_r); end
4867
-
4868
- # Returns the value of attribute app.
4869
- #
4870
- # source://rack//lib/rack/utils.rb#479
4871
- def app; end
4872
-
4873
- # source://rack//lib/rack/utils.rb#486
4874
- def call(env); end
4875
-
4876
- # source://rack//lib/rack/utils.rb#494
4877
- def context(env, app = T.unsafe(nil)); end
4878
-
4879
- # Returns the value of attribute for.
4880
- #
4881
- # source://rack//lib/rack/utils.rb#479
4882
- def for; end
4883
-
4884
- # source://rack//lib/rack/utils.rb#490
4885
- def recontext(app); end
4886
- end
4887
-
4888
- # source://rack//lib/rack/utils.rb#24
4889
- Rack::Utils::DEFAULT_SEP = T.let(T.unsafe(nil), Regexp)
4890
-
4891
- # Every standard HTTP code mapped to the appropriate message.
4892
- # Generated with:
4893
- # curl -s https://www.iana.org/assignments/http-status-codes/http-status-codes-1.csv \
4894
- # | ruby -rcsv -e "puts CSV.parse(STDIN, headers: true) \
4895
- # .reject {|v| v['Description'] == 'Unassigned' or v['Description'].include? '(' } \
4896
- # .map {|v| %Q/#{v['Value']} => '#{v['Description']}'/ }.join(','+?\n)"
4897
- #
4898
- # source://rack//lib/rack/utils.rb#505
4899
- Rack::Utils::HTTP_STATUS_CODES = T.let(T.unsafe(nil), Hash)
4900
-
4901
- # source://rack//lib/rack/utils.rb#22
4902
- Rack::Utils::InvalidParameterError = Rack::QueryParser::InvalidParameterError
4903
-
4904
- # source://rack//lib/rack/utils.rb#26
4905
- Rack::Utils::KeySpaceConstrainedParams = Rack::QueryParser::Params
4906
-
4907
- # source://rack//lib/rack/utils.rb#624
4908
- Rack::Utils::NULL_BYTE = T.let(T.unsafe(nil), String)
4909
-
4910
- # source://rack//lib/rack/utils.rb#575
4911
- Rack::Utils::OBSOLETE_SYMBOLS_TO_STATUS_CODES = T.let(T.unsafe(nil), Hash)
4912
-
4913
- # source://rack//lib/rack/utils.rb#583
4914
- Rack::Utils::OBSOLETE_SYMBOL_MAPPINGS = T.let(T.unsafe(nil), Hash)
4915
-
4916
- # source://rack//lib/rack/utils.rb#607
4917
- Rack::Utils::PATH_SEPS = T.let(T.unsafe(nil), Regexp)
4918
-
4919
- # source://rack//lib/rack/utils.rb#21
4920
- Rack::Utils::ParameterTypeError = Rack::QueryParser::ParameterTypeError
4921
-
4922
- # source://rack//lib/rack/utils.rb#23
4923
- Rack::Utils::ParamsTooDeepError = Rack::QueryParser::QueryLimitError
4924
-
4925
- # Responses with HTTP status codes that should not have an entity body
4926
- #
4927
- # source://rack//lib/rack/utils.rb#569
4928
- Rack::Utils::STATUS_WITH_NO_ENTITY_BODY = T.let(T.unsafe(nil), Hash)
4929
-
4930
- # source://rack//lib/rack/utils.rb#571
4931
- Rack::Utils::SYMBOL_TO_STATUS_CODE = T.let(T.unsafe(nil), Hash)
4932
-
4933
- # source://rack//lib/rack/utils.rb#27
4934
- Rack::Utils::URI_PARSER = T.let(T.unsafe(nil), URI::RFC2396_Parser)
4935
-
4936
- # A valid cookie key according to RFC2616.
4937
- # A <cookie-name> can be any US-ASCII characters, except control characters, spaces, or tabs. It also must not contain a separator character like the following: ( ) < > @ , ; : \ " / [ ] ? = { }.
4938
- #
4939
- # source://rack//lib/rack/utils.rb#259
4940
- Rack::Utils::VALID_COOKIE_KEY = T.let(T.unsafe(nil), Regexp)