active_cached_resource 0.0.1.pre → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (310) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/LICENSE +21 -0
  4. data/lib/active_cached_resource/caching.rb +104 -1
  5. data/lib/active_cached_resource/configuration.rb +22 -1
  6. data/lib/active_cached_resource/logger.rb +14 -0
  7. data/lib/active_cached_resource/model.rb +18 -0
  8. data/lib/active_cached_resource/version.rb +1 -8
  9. data/lib/activeresource/lib/active_resource/collection.rb +14 -1
  10. data/lib/activeresource/lib/active_resource/railtie.rb +2 -2
  11. data/lib/activeresource/lib/active_resource.rb +1 -1
  12. metadata +5 -401
  13. data/.rspec +0 -3
  14. data/.rubocop.yml +0 -22
  15. data/.standard.yml +0 -2
  16. data/Rakefile +0 -21
  17. data/example/consumer/.dockerignore +0 -41
  18. data/example/consumer/.gitattributes +0 -9
  19. data/example/consumer/.gitignore +0 -36
  20. data/example/consumer/.kamal/hooks/docker-setup.sample +0 -3
  21. data/example/consumer/.kamal/hooks/post-deploy.sample +0 -14
  22. data/example/consumer/.kamal/hooks/post-proxy-reboot.sample +0 -3
  23. data/example/consumer/.kamal/hooks/pre-build.sample +0 -51
  24. data/example/consumer/.kamal/hooks/pre-connect.sample +0 -47
  25. data/example/consumer/.kamal/hooks/pre-deploy.sample +0 -109
  26. data/example/consumer/.kamal/hooks/pre-proxy-reboot.sample +0 -3
  27. data/example/consumer/.kamal/secrets +0 -17
  28. data/example/consumer/Dockerfile +0 -65
  29. data/example/consumer/Gemfile +0 -17
  30. data/example/consumer/Rakefile +0 -6
  31. data/example/consumer/app/controllers/application_controller.rb +0 -2
  32. data/example/consumer/app/controllers/concerns/.keep +0 -0
  33. data/example/consumer/app/jobs/application_job.rb +0 -7
  34. data/example/consumer/app/mailers/application_mailer.rb +0 -4
  35. data/example/consumer/app/models/application_record.rb +0 -3
  36. data/example/consumer/app/models/concerns/.keep +0 -0
  37. data/example/consumer/app/models/person.rb +0 -9
  38. data/example/consumer/app/views/layouts/mailer.html.erb +0 -13
  39. data/example/consumer/app/views/layouts/mailer.text.erb +0 -1
  40. data/example/consumer/bin/brakeman +0 -7
  41. data/example/consumer/bin/bundle +0 -109
  42. data/example/consumer/bin/dev +0 -2
  43. data/example/consumer/bin/docker-entrypoint +0 -14
  44. data/example/consumer/bin/jobs +0 -6
  45. data/example/consumer/bin/kamal +0 -27
  46. data/example/consumer/bin/rails +0 -4
  47. data/example/consumer/bin/rake +0 -4
  48. data/example/consumer/bin/rubocop +0 -8
  49. data/example/consumer/bin/setup +0 -34
  50. data/example/consumer/bin/thrust +0 -5
  51. data/example/consumer/config/application.rb +0 -20
  52. data/example/consumer/config/boot.rb +0 -3
  53. data/example/consumer/config/cache.yml +0 -16
  54. data/example/consumer/config/credentials.yml.enc +0 -1
  55. data/example/consumer/config/database.yml +0 -14
  56. data/example/consumer/config/deploy.yml +0 -116
  57. data/example/consumer/config/environment.rb +0 -5
  58. data/example/consumer/config/environments/development.rb +0 -64
  59. data/example/consumer/config/environments/production.rb +0 -85
  60. data/example/consumer/config/environments/test.rb +0 -50
  61. data/example/consumer/config/initializers/cors.rb +0 -16
  62. data/example/consumer/config/initializers/filter_parameter_logging.rb +0 -8
  63. data/example/consumer/config/initializers/inflections.rb +0 -16
  64. data/example/consumer/config/locales/en.yml +0 -31
  65. data/example/consumer/config/puma.rb +0 -41
  66. data/example/consumer/config/queue.yml +0 -18
  67. data/example/consumer/config/recurring.yml +0 -10
  68. data/example/consumer/config/routes.rb +0 -10
  69. data/example/consumer/config.ru +0 -6
  70. data/example/consumer/db/cache_schema.rb +0 -14
  71. data/example/consumer/db/queue_schema.rb +0 -129
  72. data/example/consumer/db/seeds.rb +0 -0
  73. data/example/consumer/lib/tasks/.keep +0 -0
  74. data/example/consumer/log/.keep +0 -0
  75. data/example/consumer/public/robots.txt +0 -1
  76. data/example/consumer/script/.keep +0 -0
  77. data/example/consumer/storage/.keep +0 -0
  78. data/example/consumer/tmp/.keep +0 -0
  79. data/example/consumer/tmp/cache/.keep +0 -0
  80. data/example/consumer/tmp/pids/.keep +0 -0
  81. data/example/consumer/tmp/storage/.keep +0 -0
  82. data/example/consumer/vendor/.keep +0 -0
  83. data/example/provider/.dockerignore +0 -41
  84. data/example/provider/.gitattributes +0 -9
  85. data/example/provider/.gitignore +0 -32
  86. data/example/provider/.kamal/hooks/docker-setup.sample +0 -3
  87. data/example/provider/.kamal/hooks/post-deploy.sample +0 -14
  88. data/example/provider/.kamal/hooks/post-proxy-reboot.sample +0 -3
  89. data/example/provider/.kamal/hooks/pre-build.sample +0 -51
  90. data/example/provider/.kamal/hooks/pre-connect.sample +0 -47
  91. data/example/provider/.kamal/hooks/pre-deploy.sample +0 -109
  92. data/example/provider/.kamal/hooks/pre-proxy-reboot.sample +0 -3
  93. data/example/provider/.kamal/secrets +0 -17
  94. data/example/provider/Dockerfile +0 -65
  95. data/example/provider/Gemfile +0 -14
  96. data/example/provider/Rakefile +0 -6
  97. data/example/provider/app/controllers/application_controller.rb +0 -2
  98. data/example/provider/app/controllers/concerns/.keep +0 -0
  99. data/example/provider/app/controllers/people_controller.rb +0 -68
  100. data/example/provider/app/jobs/application_job.rb +0 -7
  101. data/example/provider/app/mailers/application_mailer.rb +0 -4
  102. data/example/provider/app/models/address.rb +0 -3
  103. data/example/provider/app/models/application_record.rb +0 -3
  104. data/example/provider/app/models/company.rb +0 -3
  105. data/example/provider/app/models/concerns/.keep +0 -0
  106. data/example/provider/app/models/person.rb +0 -6
  107. data/example/provider/app/views/layouts/mailer.html.erb +0 -13
  108. data/example/provider/app/views/layouts/mailer.text.erb +0 -1
  109. data/example/provider/bin/brakeman +0 -7
  110. data/example/provider/bin/bundle +0 -109
  111. data/example/provider/bin/dev +0 -2
  112. data/example/provider/bin/docker-entrypoint +0 -14
  113. data/example/provider/bin/jobs +0 -6
  114. data/example/provider/bin/kamal +0 -27
  115. data/example/provider/bin/rails +0 -4
  116. data/example/provider/bin/rake +0 -4
  117. data/example/provider/bin/rubocop +0 -8
  118. data/example/provider/bin/setup +0 -34
  119. data/example/provider/bin/thrust +0 -5
  120. data/example/provider/config/application.rb +0 -44
  121. data/example/provider/config/boot.rb +0 -3
  122. data/example/provider/config/cache.yml +0 -16
  123. data/example/provider/config/credentials.yml.enc +0 -1
  124. data/example/provider/config/database.yml +0 -20
  125. data/example/provider/config/deploy.yml +0 -116
  126. data/example/provider/config/environment.rb +0 -5
  127. data/example/provider/config/environments/development.rb +0 -64
  128. data/example/provider/config/environments/production.rb +0 -85
  129. data/example/provider/config/environments/test.rb +0 -50
  130. data/example/provider/config/initializers/cors.rb +0 -16
  131. data/example/provider/config/initializers/filter_parameter_logging.rb +0 -8
  132. data/example/provider/config/initializers/inflections.rb +0 -16
  133. data/example/provider/config/locales/en.yml +0 -31
  134. data/example/provider/config/puma.rb +0 -41
  135. data/example/provider/config/queue.yml +0 -18
  136. data/example/provider/config/recurring.yml +0 -10
  137. data/example/provider/config/routes.rb +0 -4
  138. data/example/provider/config.ru +0 -6
  139. data/example/provider/db/cache_schema.rb +0 -14
  140. data/example/provider/db/migrate/20241202183937_create_people.rb +0 -11
  141. data/example/provider/db/migrate/20241202183955_create_addresses.rb +0 -13
  142. data/example/provider/db/migrate/20241202184017_create_companies.rb +0 -14
  143. data/example/provider/db/queue_schema.rb +0 -129
  144. data/example/provider/db/schema.rb +0 -47
  145. data/example/provider/db/seeds.rb +0 -18
  146. data/example/provider/lib/tasks/.keep +0 -0
  147. data/example/provider/log/.keep +0 -0
  148. data/example/provider/public/robots.txt +0 -1
  149. data/example/provider/script/.keep +0 -0
  150. data/example/provider/storage/.keep +0 -0
  151. data/example/provider/tmp/.keep +0 -0
  152. data/example/provider/tmp/pids/.keep +0 -0
  153. data/example/provider/tmp/storage/.keep +0 -0
  154. data/example/provider/vendor/.keep +0 -0
  155. data/lib/activeresource/.gitignore +0 -15
  156. data/lib/activeresource/examples/performance.rb +0 -72
  157. data/lib/activeresource/test/abstract_unit.rb +0 -153
  158. data/lib/activeresource/test/cases/active_job_serializer_test.rb +0 -53
  159. data/lib/activeresource/test/cases/association_test.rb +0 -104
  160. data/lib/activeresource/test/cases/associations/builder/belongs_to_test.rb +0 -42
  161. data/lib/activeresource/test/cases/associations/builder/has_many_test.rb +0 -28
  162. data/lib/activeresource/test/cases/associations/builder/has_one_test.rb +0 -28
  163. data/lib/activeresource/test/cases/authorization_test.rb +0 -276
  164. data/lib/activeresource/test/cases/base/custom_methods_test.rb +0 -155
  165. data/lib/activeresource/test/cases/base/equality_test.rb +0 -53
  166. data/lib/activeresource/test/cases/base/load_test.rb +0 -249
  167. data/lib/activeresource/test/cases/base/schema_test.rb +0 -428
  168. data/lib/activeresource/test/cases/base_errors_test.rb +0 -129
  169. data/lib/activeresource/test/cases/base_test.rb +0 -1622
  170. data/lib/activeresource/test/cases/callbacks_test.rb +0 -155
  171. data/lib/activeresource/test/cases/collection_test.rb +0 -172
  172. data/lib/activeresource/test/cases/connection_test.rb +0 -357
  173. data/lib/activeresource/test/cases/finder_test.rb +0 -217
  174. data/lib/activeresource/test/cases/format_test.rb +0 -137
  175. data/lib/activeresource/test/cases/http_mock_test.rb +0 -213
  176. data/lib/activeresource/test/cases/inheritence_test.rb +0 -19
  177. data/lib/activeresource/test/cases/inheriting_hash_test.rb +0 -25
  178. data/lib/activeresource/test/cases/log_subscriber_test.rb +0 -63
  179. data/lib/activeresource/test/cases/reflection_test.rb +0 -65
  180. data/lib/activeresource/test/cases/validations_test.rb +0 -78
  181. data/lib/activeresource/test/fixtures/address.rb +0 -20
  182. data/lib/activeresource/test/fixtures/beast.rb +0 -16
  183. data/lib/activeresource/test/fixtures/comment.rb +0 -5
  184. data/lib/activeresource/test/fixtures/customer.rb +0 -5
  185. data/lib/activeresource/test/fixtures/inventory.rb +0 -14
  186. data/lib/activeresource/test/fixtures/person.rb +0 -15
  187. data/lib/activeresource/test/fixtures/pet.rb +0 -6
  188. data/lib/activeresource/test/fixtures/post.rb +0 -5
  189. data/lib/activeresource/test/fixtures/product.rb +0 -11
  190. data/lib/activeresource/test/fixtures/project.rb +0 -19
  191. data/lib/activeresource/test/fixtures/proxy.rb +0 -6
  192. data/lib/activeresource/test/fixtures/sound.rb +0 -11
  193. data/lib/activeresource/test/fixtures/street_address.rb +0 -6
  194. data/lib/activeresource/test/fixtures/subscription_plan.rb +0 -7
  195. data/lib/activeresource/test/fixtures/weather.rb +0 -21
  196. data/lib/activeresource/test/setter_trap.rb +0 -28
  197. data/lib/activeresource/test/singleton_test.rb +0 -138
  198. data/lib/activeresource/test/threadsafe_attributes_test.rb +0 -91
  199. data/sorbet/config +0 -4
  200. data/sorbet/rbi/annotations/.gitattributes +0 -1
  201. data/sorbet/rbi/annotations/activemodel.rbi +0 -89
  202. data/sorbet/rbi/annotations/activesupport.rbi +0 -457
  203. data/sorbet/rbi/annotations/minitest.rbi +0 -119
  204. data/sorbet/rbi/annotations/rainbow.rbi +0 -269
  205. data/sorbet/rbi/dsl/.gitattributes +0 -1
  206. data/sorbet/rbi/dsl/active_support/callbacks.rbi +0 -21
  207. data/sorbet/rbi/gems/.gitattributes +0 -1
  208. data/sorbet/rbi/gems/actioncable@8.0.0.rbi +0 -252
  209. data/sorbet/rbi/gems/actionmailbox@8.0.0.rbi +0 -9
  210. data/sorbet/rbi/gems/actionmailer@8.0.0.rbi +0 -9
  211. data/sorbet/rbi/gems/actionpack@8.0.0.rbi +0 -20909
  212. data/sorbet/rbi/gems/actiontext@8.0.0.rbi +0 -9
  213. data/sorbet/rbi/gems/actionview@8.0.0.rbi +0 -16207
  214. data/sorbet/rbi/gems/activejob@8.0.0.rbi +0 -9
  215. data/sorbet/rbi/gems/activemodel-serializers-xml@1.0.3.rbi +0 -166
  216. data/sorbet/rbi/gems/activemodel@8.0.0.rbi +0 -6857
  217. data/sorbet/rbi/gems/activerecord@8.0.0.rbi +0 -42896
  218. data/sorbet/rbi/gems/activeresource@6.1.4.rbi +0 -3944
  219. data/sorbet/rbi/gems/activestorage@8.0.0.rbi +0 -9
  220. data/sorbet/rbi/gems/activesupport@8.0.0.rbi +0 -21251
  221. data/sorbet/rbi/gems/ast@2.4.2.rbi +0 -585
  222. data/sorbet/rbi/gems/base64@0.2.0.rbi +0 -509
  223. data/sorbet/rbi/gems/benchmark@0.4.0.rbi +0 -618
  224. data/sorbet/rbi/gems/bigdecimal@3.1.8.rbi +0 -78
  225. data/sorbet/rbi/gems/builder@3.3.0.rbi +0 -9
  226. data/sorbet/rbi/gems/bump@0.10.0.rbi +0 -169
  227. data/sorbet/rbi/gems/byebug@11.1.3.rbi +0 -3607
  228. data/sorbet/rbi/gems/coderay@1.1.3.rbi +0 -3427
  229. data/sorbet/rbi/gems/concurrent-ruby@1.3.4.rbi +0 -11645
  230. data/sorbet/rbi/gems/connection_pool@2.4.1.rbi +0 -9
  231. data/sorbet/rbi/gems/crass@1.0.6.rbi +0 -623
  232. data/sorbet/rbi/gems/date@3.4.0.rbi +0 -75
  233. data/sorbet/rbi/gems/diff-lcs@1.5.1.rbi +0 -1131
  234. data/sorbet/rbi/gems/docile@1.4.1.rbi +0 -377
  235. data/sorbet/rbi/gems/drb@2.2.1.rbi +0 -1347
  236. data/sorbet/rbi/gems/erubi@1.13.0.rbi +0 -150
  237. data/sorbet/rbi/gems/globalid@1.2.1.rbi +0 -9
  238. data/sorbet/rbi/gems/i18n@1.14.6.rbi +0 -2359
  239. data/sorbet/rbi/gems/io-console@0.7.2.rbi +0 -9
  240. data/sorbet/rbi/gems/json@2.8.2.rbi +0 -1901
  241. data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +0 -14238
  242. data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +0 -240
  243. data/sorbet/rbi/gems/logger@1.6.1.rbi +0 -920
  244. data/sorbet/rbi/gems/loofah@2.23.1.rbi +0 -1081
  245. data/sorbet/rbi/gems/mail@2.8.1.rbi +0 -9
  246. data/sorbet/rbi/gems/marcel@1.0.4.rbi +0 -9
  247. data/sorbet/rbi/gems/method_source@1.1.0.rbi +0 -304
  248. data/sorbet/rbi/gems/mini_mime@1.1.5.rbi +0 -9
  249. data/sorbet/rbi/gems/minitest@5.25.2.rbi +0 -1547
  250. data/sorbet/rbi/gems/net-imap@0.5.1.rbi +0 -9
  251. data/sorbet/rbi/gems/net-pop@0.1.2.rbi +0 -9
  252. data/sorbet/rbi/gems/net-protocol@0.2.2.rbi +0 -292
  253. data/sorbet/rbi/gems/net-smtp@0.5.0.rbi +0 -9
  254. data/sorbet/rbi/gems/netrc@0.11.0.rbi +0 -159
  255. data/sorbet/rbi/gems/nio4r@2.7.4.rbi +0 -9
  256. data/sorbet/rbi/gems/nokogiri@1.16.7.rbi +0 -7311
  257. data/sorbet/rbi/gems/parallel@1.26.3.rbi +0 -291
  258. data/sorbet/rbi/gems/parser@3.3.6.0.rbi +0 -5519
  259. data/sorbet/rbi/gems/prism@1.2.0.rbi +0 -39085
  260. data/sorbet/rbi/gems/pry-byebug@3.10.1.rbi +0 -1151
  261. data/sorbet/rbi/gems/pry@0.14.2.rbi +0 -10076
  262. data/sorbet/rbi/gems/psych@5.2.0.rbi +0 -1785
  263. data/sorbet/rbi/gems/racc@1.8.1.rbi +0 -162
  264. data/sorbet/rbi/gems/rack-session@2.0.0.rbi +0 -727
  265. data/sorbet/rbi/gems/rack-test@2.1.0.rbi +0 -747
  266. data/sorbet/rbi/gems/rack@3.1.8.rbi +0 -4905
  267. data/sorbet/rbi/gems/rackup@2.2.1.rbi +0 -230
  268. data/sorbet/rbi/gems/rails-dom-testing@2.2.0.rbi +0 -758
  269. data/sorbet/rbi/gems/rails-html-sanitizer@1.6.0.rbi +0 -785
  270. data/sorbet/rbi/gems/rails@8.0.0.rbi +0 -9
  271. data/sorbet/rbi/gems/railties@8.0.0.rbi +0 -6287
  272. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +0 -403
  273. data/sorbet/rbi/gems/rake@13.2.1.rbi +0 -3091
  274. data/sorbet/rbi/gems/rbi@0.2.1.rbi +0 -4535
  275. data/sorbet/rbi/gems/rdoc@6.8.1.rbi +0 -12572
  276. data/sorbet/rbi/gems/regexp_parser@2.9.2.rbi +0 -3772
  277. data/sorbet/rbi/gems/reline@0.5.12.rbi +0 -2416
  278. data/sorbet/rbi/gems/rexml@3.3.9.rbi +0 -4858
  279. data/sorbet/rbi/gems/rspec-core@3.13.2.rbi +0 -11287
  280. data/sorbet/rbi/gems/rspec-expectations@3.13.3.rbi +0 -8183
  281. data/sorbet/rbi/gems/rspec-mocks@3.13.2.rbi +0 -5341
  282. data/sorbet/rbi/gems/rspec-support@3.13.1.rbi +0 -1630
  283. data/sorbet/rbi/gems/rspec@3.13.0.rbi +0 -83
  284. data/sorbet/rbi/gems/rubocop-ast@1.36.1.rbi +0 -7303
  285. data/sorbet/rbi/gems/rubocop-performance@1.21.1.rbi +0 -9
  286. data/sorbet/rbi/gems/rubocop@1.65.1.rbi +0 -58170
  287. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +0 -1318
  288. data/sorbet/rbi/gems/securerandom@0.3.2.rbi +0 -395
  289. data/sorbet/rbi/gems/simplecov-html@0.13.1.rbi +0 -225
  290. data/sorbet/rbi/gems/simplecov@0.22.0.rbi +0 -2149
  291. data/sorbet/rbi/gems/simplecov_json_formatter@0.1.4.rbi +0 -9
  292. data/sorbet/rbi/gems/spoom@1.5.0.rbi +0 -4932
  293. data/sorbet/rbi/gems/standard-custom@1.0.2.rbi +0 -9
  294. data/sorbet/rbi/gems/standard-performance@1.4.0.rbi +0 -9
  295. data/sorbet/rbi/gems/standard@1.40.0.rbi +0 -929
  296. data/sorbet/rbi/gems/stringio@3.1.2.rbi +0 -9
  297. data/sorbet/rbi/gems/tapioca@0.16.4.rbi +0 -3597
  298. data/sorbet/rbi/gems/thor@1.3.2.rbi +0 -4378
  299. data/sorbet/rbi/gems/timeout@0.4.2.rbi +0 -151
  300. data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +0 -5918
  301. data/sorbet/rbi/gems/unicode-display_width@2.6.0.rbi +0 -66
  302. data/sorbet/rbi/gems/uri@1.0.2.rbi +0 -2377
  303. data/sorbet/rbi/gems/useragent@0.16.10.rbi +0 -9
  304. data/sorbet/rbi/gems/websocket-driver@0.7.6.rbi +0 -9
  305. data/sorbet/rbi/gems/websocket-extensions@0.1.5.rbi +0 -9
  306. data/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +0 -435
  307. data/sorbet/rbi/gems/yard@0.9.37.rbi +0 -18504
  308. data/sorbet/rbi/gems/zeitwerk@2.7.1.rbi +0 -9
  309. data/sorbet/tapioca/config.yml +0 -13
  310. data/sorbet/tapioca/require.rb +0 -12
@@ -1,4905 +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#83
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#58
881
- def digest_body(body); end
882
-
883
- # @return [Boolean]
884
- #
885
- # source://rack//lib/rack/etag.rb#50
886
- def etag_status?(status); end
887
-
888
- # @return [Boolean]
889
- #
890
- # source://rack//lib/rack/etag.rb#54
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
- # source://rack//lib/rack/media_type.rb#30
1721
- def params(content_type); end
1722
-
1723
- # The media type (type/subtype) portion of the CONTENT_TYPE header
1724
- # without any media type parameters. e.g., when CONTENT_TYPE is
1725
- # "text/plain;charset=utf-8", the media-type is "text/plain".
1726
- #
1727
- # For more information on the use of media types in HTTP, see:
1728
- # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7
1729
- #
1730
- # source://rack//lib/rack/media_type.rb#16
1731
- def type(content_type); end
1732
-
1733
- private
1734
-
1735
- # source://rack//lib/rack/media_type.rb#43
1736
- def strip_doublequotes(str); end
1737
- end
1738
- end
1739
-
1740
- # source://rack//lib/rack/media_type.rb#7
1741
- Rack::MediaType::SPLIT_PATTERN = T.let(T.unsafe(nil), Regexp)
1742
-
1743
- # source://rack//lib/rack/method_override.rb#8
1744
- class Rack::MethodOverride
1745
- # @return [MethodOverride] a new instance of MethodOverride
1746
- #
1747
- # source://rack//lib/rack/method_override.rb#15
1748
- def initialize(app); end
1749
-
1750
- # source://rack//lib/rack/method_override.rb#19
1751
- def call(env); end
1752
-
1753
- # source://rack//lib/rack/method_override.rb#31
1754
- def method_override(env); end
1755
-
1756
- private
1757
-
1758
- # source://rack//lib/rack/method_override.rb#44
1759
- def allowed_methods; end
1760
-
1761
- # source://rack//lib/rack/method_override.rb#48
1762
- def method_override_param(req); end
1763
- end
1764
-
1765
- # source://rack//lib/rack/method_override.rb#13
1766
- Rack::MethodOverride::ALLOWED_METHODS = T.let(T.unsafe(nil), Array)
1767
-
1768
- # source://rack//lib/rack/method_override.rb#9
1769
- Rack::MethodOverride::HTTP_METHODS = T.let(T.unsafe(nil), Array)
1770
-
1771
- # source://rack//lib/rack/method_override.rb#12
1772
- Rack::MethodOverride::HTTP_METHOD_OVERRIDE_HEADER = T.let(T.unsafe(nil), String)
1773
-
1774
- # source://rack//lib/rack/method_override.rb#11
1775
- Rack::MethodOverride::METHOD_OVERRIDE_PARAM_KEY = T.let(T.unsafe(nil), String)
1776
-
1777
- # source://rack//lib/rack/mime.rb#4
1778
- module Rack::Mime
1779
- private
1780
-
1781
- # Returns true if the given value is a mime match for the given mime match
1782
- # specification, false otherwise.
1783
- #
1784
- # Rack::Mime.match?('text/html', 'text/*') => true
1785
- # Rack::Mime.match?('text/plain', '*') => true
1786
- # Rack::Mime.match?('text/html', 'application/json') => false
1787
- #
1788
- # @return [Boolean]
1789
- #
1790
- # source://rack//lib/rack/mime.rb#30
1791
- def match?(value, matcher); end
1792
-
1793
- # Returns String with mime type if found, otherwise use +fallback+.
1794
- # +ext+ should be filename extension in the '.ext' format that
1795
- # File.extname(file) returns.
1796
- # +fallback+ may be any object
1797
- #
1798
- # Also see the documentation for MIME_TYPES
1799
- #
1800
- # Usage:
1801
- # Rack::Mime.mime_type('.foo')
1802
- #
1803
- # This is a shortcut for:
1804
- # Rack::Mime::MIME_TYPES.fetch('.foo', 'application/octet-stream')
1805
- #
1806
- # source://rack//lib/rack/mime.rb#18
1807
- def mime_type(ext, fallback = T.unsafe(nil)); end
1808
-
1809
- class << self
1810
- # Returns true if the given value is a mime match for the given mime match
1811
- # specification, false otherwise.
1812
- #
1813
- # Rack::Mime.match?('text/html', 'text/*') => true
1814
- # Rack::Mime.match?('text/plain', '*') => true
1815
- # Rack::Mime.match?('text/html', 'application/json') => false
1816
- #
1817
- # @return [Boolean]
1818
- #
1819
- # source://rack//lib/rack/mime.rb#30
1820
- def match?(value, matcher); end
1821
-
1822
- # Returns String with mime type if found, otherwise use +fallback+.
1823
- # +ext+ should be filename extension in the '.ext' format that
1824
- # File.extname(file) returns.
1825
- # +fallback+ may be any object
1826
- #
1827
- # Also see the documentation for MIME_TYPES
1828
- #
1829
- # Usage:
1830
- # Rack::Mime.mime_type('.foo')
1831
- #
1832
- # This is a shortcut for:
1833
- # Rack::Mime::MIME_TYPES.fetch('.foo', 'application/octet-stream')
1834
- #
1835
- # source://rack//lib/rack/mime.rb#18
1836
- def mime_type(ext, fallback = T.unsafe(nil)); end
1837
- end
1838
- end
1839
-
1840
- # List of most common mime-types, selected various sources
1841
- # according to their usefulness in a webserving scope for Ruby
1842
- # users.
1843
- #
1844
- # To amend this list with your local mime.types list you can use:
1845
- #
1846
- # require 'webrick/httputils'
1847
- # list = WEBrick::HTTPUtils.load_mime_types('/etc/mime.types')
1848
- # Rack::Mime::MIME_TYPES.merge!(list)
1849
- #
1850
- # N.B. On Ubuntu the mime.types file does not include the leading period, so
1851
- # users may need to modify the data before merging into the hash.
1852
- #
1853
- # source://rack//lib/rack/mime.rb#51
1854
- Rack::Mime::MIME_TYPES = T.let(T.unsafe(nil), Hash)
1855
-
1856
- # Rack::MockRequest helps testing your Rack application without
1857
- # actually using HTTP.
1858
- #
1859
- # After performing a request on a URL with get/post/put/patch/delete, it
1860
- # returns a MockResponse with useful helper methods for effective
1861
- # testing.
1862
- #
1863
- # You can pass a hash with additional configuration to the
1864
- # get/post/put/patch/delete.
1865
- # <tt>:input</tt>:: A String or IO-like to be used as rack.input.
1866
- # <tt>:fatal</tt>:: Raise a FatalWarning if the app writes to rack.errors.
1867
- # <tt>:lint</tt>:: If true, wrap the application in a Rack::Lint.
1868
- #
1869
- # source://rack//lib/rack/mock_request.rb#23
1870
- class Rack::MockRequest
1871
- # @return [MockRequest] a new instance of MockRequest
1872
- #
1873
- # source://rack//lib/rack/mock_request.rb#44
1874
- def initialize(app); end
1875
-
1876
- # Make a DELETE request and return a MockResponse. See #request.
1877
- #
1878
- # source://rack//lib/rack/mock_request.rb#57
1879
- def delete(uri, opts = T.unsafe(nil)); end
1880
-
1881
- # Make a GET request and return a MockResponse. See #request.
1882
- #
1883
- # source://rack//lib/rack/mock_request.rb#49
1884
- def get(uri, opts = T.unsafe(nil)); end
1885
-
1886
- # Make a HEAD request and return a MockResponse. See #request.
1887
- #
1888
- # source://rack//lib/rack/mock_request.rb#59
1889
- def head(uri, opts = T.unsafe(nil)); end
1890
-
1891
- # Make an OPTIONS request and return a MockResponse. See #request.
1892
- #
1893
- # source://rack//lib/rack/mock_request.rb#61
1894
- def options(uri, opts = T.unsafe(nil)); end
1895
-
1896
- # Make a PATCH request and return a MockResponse. See #request.
1897
- #
1898
- # source://rack//lib/rack/mock_request.rb#55
1899
- def patch(uri, opts = T.unsafe(nil)); end
1900
-
1901
- # Make a POST request and return a MockResponse. See #request.
1902
- #
1903
- # source://rack//lib/rack/mock_request.rb#51
1904
- def post(uri, opts = T.unsafe(nil)); end
1905
-
1906
- # Make a PUT request and return a MockResponse. See #request.
1907
- #
1908
- # source://rack//lib/rack/mock_request.rb#53
1909
- def put(uri, opts = T.unsafe(nil)); end
1910
-
1911
- # Make a request using the given request method for the given
1912
- # uri to the rack application and return a MockResponse.
1913
- # Options given are passed to MockRequest.env_for.
1914
- #
1915
- # source://rack//lib/rack/mock_request.rb#66
1916
- def request(method = T.unsafe(nil), uri = T.unsafe(nil), opts = T.unsafe(nil)); end
1917
-
1918
- class << self
1919
- # Return the Rack environment used for a request to +uri+.
1920
- # All options that are strings are added to the returned environment.
1921
- # Options:
1922
- # :fatal :: Whether to raise an exception if request outputs to rack.errors
1923
- # :input :: The rack.input to set
1924
- # :http_version :: The SERVER_PROTOCOL to set
1925
- # :method :: The HTTP request method to use
1926
- # :params :: The params to use
1927
- # :script_name :: The SCRIPT_NAME to set
1928
- #
1929
- # source://rack//lib/rack/mock_request.rb#98
1930
- def env_for(uri = T.unsafe(nil), opts = T.unsafe(nil)); end
1931
-
1932
- # For historical reasons, we're pinning to RFC 2396.
1933
- # URI::Parser = URI::RFC2396_Parser
1934
- #
1935
- # source://rack//lib/rack/mock_request.rb#84
1936
- def parse_uri_rfc2396(uri); end
1937
- end
1938
- end
1939
-
1940
- # source://rack//lib/rack/mock_request.rb#27
1941
- class Rack::MockRequest::FatalWarner
1942
- # source://rack//lib/rack/mock_request.rb#36
1943
- def flush; end
1944
-
1945
- # @raise [FatalWarning]
1946
- #
1947
- # source://rack//lib/rack/mock_request.rb#28
1948
- def puts(warning); end
1949
-
1950
- # source://rack//lib/rack/mock_request.rb#39
1951
- def string; end
1952
-
1953
- # @raise [FatalWarning]
1954
- #
1955
- # source://rack//lib/rack/mock_request.rb#32
1956
- def write(warning); end
1957
- end
1958
-
1959
- # source://rack//lib/rack/mock_request.rb#24
1960
- class Rack::MockRequest::FatalWarning < ::RuntimeError; end
1961
-
1962
- # Rack::MockResponse provides useful helpers for testing your apps.
1963
- # Usually, you don't create the MockResponse on your own, but use
1964
- # MockRequest.
1965
- #
1966
- # source://rack//lib/rack/mock_response.rb#13
1967
- class Rack::MockResponse < ::Rack::Response
1968
- # @return [MockResponse] a new instance of MockResponse
1969
- #
1970
- # source://rack//lib/rack/mock_response.rb#24
1971
- def initialize(status, headers, body, errors = T.unsafe(nil)); end
1972
-
1973
- # source://rack//lib/rack/mock_response.rb#39
1974
- def =~(other); end
1975
-
1976
- # source://rack//lib/rack/mock_response.rb#47
1977
- def body; end
1978
-
1979
- # source://rack//lib/rack/mock_response.rb#73
1980
- def cookie(name); end
1981
-
1982
- # Headers
1983
- #
1984
- # source://rack//lib/rack/mock_response.rb#19
1985
- def cookies; end
1986
-
1987
- # @return [Boolean]
1988
- #
1989
- # source://rack//lib/rack/mock_response.rb#69
1990
- def empty?; end
1991
-
1992
- # Errors
1993
- #
1994
- # source://rack//lib/rack/mock_response.rb#22
1995
- def errors; end
1996
-
1997
- # Errors
1998
- #
1999
- # source://rack//lib/rack/mock_response.rb#22
2000
- def errors=(_arg0); end
2001
-
2002
- # source://rack//lib/rack/mock_response.rb#43
2003
- def match(other); end
2004
-
2005
- # Headers
2006
- #
2007
- # source://rack//lib/rack/mock_response.rb#19
2008
- def original_headers; end
2009
-
2010
- private
2011
-
2012
- # source://rack//lib/rack/mock_response.rb#100
2013
- def identify_cookie_attributes(cookie_filling); end
2014
-
2015
- # source://rack//lib/rack/mock_response.rb#79
2016
- def parse_cookies_from_header; end
2017
-
2018
- class << self
2019
- def [](*_arg0); end
2020
- end
2021
- end
2022
-
2023
- # A multipart form data parser, adapted from IOWA.
2024
- #
2025
- # Usually, Rack::Request#POST takes care of calling this.
2026
- #
2027
- # source://rack//lib/rack/multipart/parser.rb#9
2028
- module Rack::Multipart
2029
- class << self
2030
- # source://rack//lib/rack/multipart.rb#72
2031
- def build_multipart(params, first = T.unsafe(nil)); end
2032
-
2033
- # source://rack//lib/rack/multipart.rb#68
2034
- def extract_multipart(request, params = T.unsafe(nil)); end
2035
-
2036
- # source://rack//lib/rack/multipart.rb#48
2037
- def parse_multipart(env, params = T.unsafe(nil)); end
2038
- end
2039
- end
2040
-
2041
- # Base class for multipart exceptions that do not subclass from
2042
- # other exception classes for backwards compatibility.
2043
- #
2044
- # source://rack//lib/rack/multipart/parser.rb#26
2045
- class Rack::Multipart::BoundaryTooLongError < ::StandardError
2046
- include ::Rack::BadRequest
2047
- end
2048
-
2049
- # source://rack//lib/rack/multipart/parser.rb#33
2050
- Rack::Multipart::EOL = T.let(T.unsafe(nil), String)
2051
-
2052
- # Use specific error class when parsing multipart request
2053
- # that ends early.
2054
- #
2055
- # source://rack//lib/rack/multipart/parser.rb#20
2056
- class Rack::Multipart::EmptyContentError < ::EOFError
2057
- include ::Rack::BadRequest
2058
- end
2059
-
2060
- # Prefer to use the BoundaryTooLongError class or Rack::BadRequest.
2061
- #
2062
- # source://rack//lib/rack/multipart/parser.rb#31
2063
- Rack::Multipart::Error = Rack::Multipart::BoundaryTooLongError
2064
-
2065
- # source://rack//lib/rack/multipart/generator.rb#7
2066
- class Rack::Multipart::Generator
2067
- # @return [Generator] a new instance of Generator
2068
- #
2069
- # source://rack//lib/rack/multipart/generator.rb#8
2070
- def initialize(params, first = T.unsafe(nil)); end
2071
-
2072
- # source://rack//lib/rack/multipart/generator.rb#16
2073
- def dump; end
2074
-
2075
- private
2076
-
2077
- # source://rack//lib/rack/multipart/generator.rb#89
2078
- def content_for_other(file, name); end
2079
-
2080
- # source://rack//lib/rack/multipart/generator.rb#77
2081
- def content_for_tempfile(io, file, name); end
2082
-
2083
- # source://rack//lib/rack/multipart/generator.rb#52
2084
- def flattened_params; end
2085
-
2086
- # @return [Boolean]
2087
- #
2088
- # source://rack//lib/rack/multipart/generator.rb#37
2089
- def multipart?; end
2090
- end
2091
-
2092
- # source://rack//lib/rack/multipart/parser.rb#34
2093
- Rack::Multipart::MULTIPART = T.let(T.unsafe(nil), Regexp)
2094
-
2095
- # source://rack//lib/rack/multipart.rb#16
2096
- Rack::Multipart::MULTIPART_BOUNDARY = T.let(T.unsafe(nil), String)
2097
-
2098
- # source://rack//lib/rack/multipart/parser.rb#36
2099
- Rack::Multipart::MULTIPART_CONTENT_DISPOSITION = T.let(T.unsafe(nil), Regexp)
2100
-
2101
- # source://rack//lib/rack/multipart/parser.rb#37
2102
- Rack::Multipart::MULTIPART_CONTENT_ID = T.let(T.unsafe(nil), Regexp)
2103
-
2104
- # source://rack//lib/rack/multipart/parser.rb#35
2105
- Rack::Multipart::MULTIPART_CONTENT_TYPE = T.let(T.unsafe(nil), Regexp)
2106
-
2107
- # source://rack//lib/rack/multipart.rb#18
2108
- class Rack::Multipart::MissingInputError < ::StandardError
2109
- include ::Rack::BadRequest
2110
- end
2111
-
2112
- # source://rack//lib/rack/multipart/parser.rb#10
2113
- class Rack::Multipart::MultipartPartLimitError < ::Errno::EMFILE
2114
- include ::Rack::BadRequest
2115
- end
2116
-
2117
- # source://rack//lib/rack/multipart/parser.rb#14
2118
- class Rack::Multipart::MultipartTotalPartLimitError < ::StandardError
2119
- include ::Rack::BadRequest
2120
- end
2121
-
2122
- # Accumulator for multipart form data, conforming to the QueryParser API.
2123
- # In future, the Parser could return the pair list directly, but that would
2124
- # change its API.
2125
- #
2126
- # source://rack//lib/rack/multipart.rb#25
2127
- class Rack::Multipart::ParamList
2128
- # @return [ParamList] a new instance of ParamList
2129
- #
2130
- # source://rack//lib/rack/multipart.rb#34
2131
- def initialize; end
2132
-
2133
- # source://rack//lib/rack/multipart.rb#38
2134
- def <<(pair); end
2135
-
2136
- # source://rack//lib/rack/multipart.rb#42
2137
- def to_params_hash; end
2138
-
2139
- class << self
2140
- # source://rack//lib/rack/multipart.rb#26
2141
- def make_params; end
2142
-
2143
- # source://rack//lib/rack/multipart.rb#30
2144
- def normalize_params(params, key, value); end
2145
- end
2146
- end
2147
-
2148
- # source://rack//lib/rack/multipart/parser.rb#39
2149
- class Rack::Multipart::Parser
2150
- # @return [Parser] a new instance of Parser
2151
- #
2152
- # source://rack//lib/rack/multipart/parser.rb#200
2153
- def initialize(boundary, tempfile, bufsize, query_parser); end
2154
-
2155
- # source://rack//lib/rack/multipart/parser.rb#217
2156
- def parse(io); end
2157
-
2158
- # source://rack//lib/rack/multipart/parser.rb#240
2159
- def result; end
2160
-
2161
- # Returns the value of attribute state.
2162
- #
2163
- # source://rack//lib/rack/multipart/parser.rb#198
2164
- def state; end
2165
-
2166
- private
2167
-
2168
- # Scan until the we find the start or end of the boundary.
2169
- # If we find it, return the appropriate symbol for the start or
2170
- # end of the boundary. If we don't find the start or end of the
2171
- # boundary, clear the buffer and return nil.
2172
- #
2173
- # source://rack//lib/rack/multipart/parser.rb#434
2174
- def consume_boundary; end
2175
-
2176
- # From WEBrick::HTTPUtils
2177
- #
2178
- # source://rack//lib/rack/multipart/parser.rb#252
2179
- def dequote(str); end
2180
-
2181
- # Return the related Encoding object. However, because
2182
- # enc is submitted by the user, it may be invalid, so
2183
- # use a binary encoding in that case.
2184
- #
2185
- # source://rack//lib/rack/multipart/parser.rb#489
2186
- def find_encoding(enc); end
2187
-
2188
- # source://rack//lib/rack/multipart/parser.rb#294
2189
- def handle_consume_token; end
2190
-
2191
- # source://rack//lib/rack/multipart/parser.rb#495
2192
- def handle_empty_content!(content); end
2193
-
2194
- # This handles the initial parser state. We read until we find the starting
2195
- # boundary, then we can transition to the next state. If we find the ending
2196
- # boundary, this is an invalid multipart upload, but keep scanning for opening
2197
- # boundary in that case. If no boundary found, we need to keep reading data
2198
- # and retry. It's highly unlikely the initial read will not consume the
2199
- # boundary. The client would have to deliberately craft a response
2200
- # with the opening boundary beyond the buffer size for that to happen.
2201
- #
2202
- # source://rack//lib/rack/multipart/parser.rb#271
2203
- def handle_fast_forward; end
2204
-
2205
- # source://rack//lib/rack/multipart/parser.rb#411
2206
- def handle_mime_body; end
2207
-
2208
- # source://rack//lib/rack/multipart/parser.rb#306
2209
- def handle_mime_head; end
2210
-
2211
- # source://rack//lib/rack/multipart/parser.rb#443
2212
- def normalize_filename(filename); end
2213
-
2214
- # source://rack//lib/rack/multipart/parser.rb#258
2215
- def read_data(io, outbuf); end
2216
-
2217
- # source://rack//lib/rack/multipart/parser.rb#456
2218
- def tag_multipart_encoding(filename, content_type, name, body); end
2219
-
2220
- class << self
2221
- # source://rack//lib/rack/multipart/parser.rb#87
2222
- def parse(io, content_length, content_type, tmpfile, bufsize, qp); end
2223
-
2224
- # source://rack//lib/rack/multipart/parser.rb#80
2225
- def parse_boundary(content_type); end
2226
- end
2227
- end
2228
-
2229
- # source://rack//lib/rack/multipart/parser.rb#40
2230
- Rack::Multipart::Parser::BUFSIZE = T.let(T.unsafe(nil), Integer)
2231
-
2232
- # source://rack//lib/rack/multipart/parser.rb#48
2233
- class Rack::Multipart::Parser::BoundedIO
2234
- # @return [BoundedIO] a new instance of BoundedIO
2235
- #
2236
- # source://rack//lib/rack/multipart/parser.rb#49
2237
- def initialize(io, content_length); end
2238
-
2239
- # source://rack//lib/rack/multipart/parser.rb#55
2240
- def read(size, outbuf = T.unsafe(nil)); end
2241
- end
2242
-
2243
- # source://rack//lib/rack/multipart/parser.rb#453
2244
- Rack::Multipart::Parser::CHARSET = T.let(T.unsafe(nil), String)
2245
-
2246
- # source://rack//lib/rack/multipart/parser.rb#305
2247
- Rack::Multipart::Parser::CONTENT_DISPOSITION_MAX_BYTES = T.let(T.unsafe(nil), Integer)
2248
-
2249
- # source://rack//lib/rack/multipart/parser.rb#304
2250
- Rack::Multipart::Parser::CONTENT_DISPOSITION_MAX_PARAMS = T.let(T.unsafe(nil), Integer)
2251
-
2252
- # source://rack//lib/rack/multipart/parser.rb#107
2253
- class Rack::Multipart::Parser::Collector
2254
- include ::Enumerable
2255
-
2256
- # @return [Collector] a new instance of Collector
2257
- #
2258
- # source://rack//lib/rack/multipart/parser.rb#143
2259
- def initialize(tempfile); end
2260
-
2261
- # source://rack//lib/rack/multipart/parser.rb#149
2262
- def each; end
2263
-
2264
- # source://rack//lib/rack/multipart/parser.rb#169
2265
- def on_mime_body(mime_index, content); end
2266
-
2267
- # source://rack//lib/rack/multipart/parser.rb#173
2268
- def on_mime_finish(mime_index); end
2269
-
2270
- # source://rack//lib/rack/multipart/parser.rb#153
2271
- def on_mime_head(mime_index, head, filename, content_type, name); end
2272
-
2273
- private
2274
-
2275
- # source://rack//lib/rack/multipart/parser.rb#178
2276
- def check_part_limits; end
2277
- end
2278
-
2279
- # source://rack//lib/rack/multipart/parser.rb#131
2280
- class Rack::Multipart::Parser::Collector::BufferPart < ::Rack::Multipart::Parser::Collector::MimePart
2281
- # source://rack//lib/rack/multipart/parser.rb#133
2282
- def close; end
2283
-
2284
- # @return [Boolean]
2285
- #
2286
- # source://rack//lib/rack/multipart/parser.rb#132
2287
- def file?; end
2288
- end
2289
-
2290
- # source://rack//lib/rack/multipart/parser.rb#108
2291
- class Rack::Multipart::Parser::Collector::MimePart < ::Struct
2292
- # @yield [data]
2293
- #
2294
- # source://rack//lib/rack/multipart/parser.rb#109
2295
- def get_data; end
2296
- end
2297
-
2298
- # source://rack//lib/rack/multipart/parser.rb#136
2299
- class Rack::Multipart::Parser::Collector::TempfilePart < ::Rack::Multipart::Parser::Collector::MimePart
2300
- # source://rack//lib/rack/multipart/parser.rb#138
2301
- def close; end
2302
-
2303
- # @return [Boolean]
2304
- #
2305
- # source://rack//lib/rack/multipart/parser.rb#137
2306
- def file?; end
2307
- end
2308
-
2309
- # source://rack//lib/rack/multipart/parser.rb#78
2310
- Rack::Multipart::Parser::EMPTY = T.let(T.unsafe(nil), Rack::Multipart::Parser::MultipartInfo)
2311
-
2312
- # source://rack//lib/rack/multipart/parser.rb#77
2313
- class Rack::Multipart::Parser::MultipartInfo < ::Struct
2314
- # Returns the value of attribute params
2315
- #
2316
- # @return [Object] the current value of params
2317
- def params; end
2318
-
2319
- # Sets the attribute params
2320
- #
2321
- # @param value [Object] the value to set the attribute params to.
2322
- # @return [Object] the newly set value
2323
- def params=(_); end
2324
-
2325
- # Returns the value of attribute tmp_files
2326
- #
2327
- # @return [Object] the current value of tmp_files
2328
- def tmp_files; end
2329
-
2330
- # Sets the attribute tmp_files
2331
- #
2332
- # @param value [Object] the value to set the attribute tmp_files to.
2333
- # @return [Object] the newly set value
2334
- def tmp_files=(_); end
2335
-
2336
- class << self
2337
- def [](*_arg0); end
2338
- def inspect; end
2339
- def keyword_init?; end
2340
- def members; end
2341
- def new(*_arg0); end
2342
- end
2343
- end
2344
-
2345
- # source://rack//lib/rack/multipart/parser.rb#42
2346
- Rack::Multipart::Parser::TEMPFILE_FACTORY = T.let(T.unsafe(nil), Proc)
2347
-
2348
- # source://rack//lib/rack/multipart/parser.rb#41
2349
- Rack::Multipart::Parser::TEXT_PLAIN = T.let(T.unsafe(nil), String)
2350
-
2351
- # source://rack//lib/rack/multipart/uploaded_file.rb#8
2352
- class Rack::Multipart::UploadedFile
2353
- # @return [UploadedFile] a new instance of UploadedFile
2354
- #
2355
- # source://rack//lib/rack/multipart/uploaded_file.rb#16
2356
- 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
2357
-
2358
- # The content type of the "uploaded" file
2359
- #
2360
- # source://rack//lib/rack/multipart/uploaded_file.rb#14
2361
- def content_type; end
2362
-
2363
- # The content type of the "uploaded" file
2364
- #
2365
- # source://rack//lib/rack/multipart/uploaded_file.rb#14
2366
- def content_type=(_arg0); end
2367
-
2368
- # source://rack//lib/rack/multipart/uploaded_file.rb#31
2369
- def local_path; end
2370
-
2371
- # source://rack//lib/rack/multipart/uploaded_file.rb#40
2372
- def method_missing(method_name, *args, &block); end
2373
-
2374
- # The filename, *not* including the path, of the "uploaded" file
2375
- #
2376
- # source://rack//lib/rack/multipart/uploaded_file.rb#11
2377
- def original_filename; end
2378
-
2379
- # source://rack//lib/rack/multipart/uploaded_file.rb#31
2380
- def path; end
2381
-
2382
- # @return [Boolean]
2383
- #
2384
- # source://rack//lib/rack/multipart/uploaded_file.rb#36
2385
- def respond_to?(*args); end
2386
- end
2387
-
2388
- # source://rack//lib/rack/null_logger.rb#6
2389
- class Rack::NullLogger
2390
- # @return [NullLogger] a new instance of NullLogger
2391
- #
2392
- # source://rack//lib/rack/null_logger.rb#7
2393
- def initialize(app); end
2394
-
2395
- # source://rack//lib/rack/null_logger.rb#45
2396
- def <<(msg); end
2397
-
2398
- # source://rack//lib/rack/null_logger.rb#43
2399
- def add(severity, message = T.unsafe(nil), progname = T.unsafe(nil), &block); end
2400
-
2401
- # source://rack//lib/rack/null_logger.rb#11
2402
- def call(env); end
2403
-
2404
- # source://rack//lib/rack/null_logger.rb#42
2405
- def close; end
2406
-
2407
- # source://rack//lib/rack/null_logger.rb#34
2408
- def datetime_format; end
2409
-
2410
- # source://rack//lib/rack/null_logger.rb#39
2411
- def datetime_format=(datetime_format); end
2412
-
2413
- # source://rack//lib/rack/null_logger.rb#17
2414
- def debug(progname = T.unsafe(nil), &block); end
2415
-
2416
- # source://rack//lib/rack/null_logger.rb#27
2417
- def debug!; end
2418
-
2419
- # @return [Boolean]
2420
- #
2421
- # source://rack//lib/rack/null_logger.rb#23
2422
- def debug?; end
2423
-
2424
- # source://rack//lib/rack/null_logger.rb#19
2425
- def error(progname = T.unsafe(nil), &block); end
2426
-
2427
- # source://rack//lib/rack/null_logger.rb#28
2428
- def error!; end
2429
-
2430
- # @return [Boolean]
2431
- #
2432
- # source://rack//lib/rack/null_logger.rb#25
2433
- def error?; end
2434
-
2435
- # source://rack//lib/rack/null_logger.rb#20
2436
- def fatal(progname = T.unsafe(nil), &block); end
2437
-
2438
- # source://rack//lib/rack/null_logger.rb#29
2439
- def fatal!; end
2440
-
2441
- # @return [Boolean]
2442
- #
2443
- # source://rack//lib/rack/null_logger.rb#26
2444
- def fatal?; end
2445
-
2446
- # source://rack//lib/rack/null_logger.rb#35
2447
- def formatter; end
2448
-
2449
- # source://rack//lib/rack/null_logger.rb#40
2450
- def formatter=(formatter); end
2451
-
2452
- # source://rack//lib/rack/null_logger.rb#16
2453
- def info(progname = T.unsafe(nil), &block); end
2454
-
2455
- # source://rack//lib/rack/null_logger.rb#30
2456
- def info!; end
2457
-
2458
- # @return [Boolean]
2459
- #
2460
- # source://rack//lib/rack/null_logger.rb#22
2461
- def info?; end
2462
-
2463
- # source://rack//lib/rack/null_logger.rb#32
2464
- def level; end
2465
-
2466
- # source://rack//lib/rack/null_logger.rb#37
2467
- def level=(level); end
2468
-
2469
- # source://rack//lib/rack/null_logger.rb#44
2470
- def log(severity, message = T.unsafe(nil), progname = T.unsafe(nil), &block); end
2471
-
2472
- # source://rack//lib/rack/null_logger.rb#33
2473
- def progname; end
2474
-
2475
- # source://rack//lib/rack/null_logger.rb#38
2476
- def progname=(progname); end
2477
-
2478
- # source://rack//lib/rack/null_logger.rb#46
2479
- def reopen(logdev = T.unsafe(nil)); end
2480
-
2481
- # source://rack//lib/rack/null_logger.rb#36
2482
- def sev_threshold; end
2483
-
2484
- # source://rack//lib/rack/null_logger.rb#41
2485
- def sev_threshold=(sev_threshold); end
2486
-
2487
- # source://rack//lib/rack/null_logger.rb#21
2488
- def unknown(progname = T.unsafe(nil), &block); end
2489
-
2490
- # source://rack//lib/rack/null_logger.rb#18
2491
- def warn(progname = T.unsafe(nil), &block); end
2492
-
2493
- # source://rack//lib/rack/null_logger.rb#31
2494
- def warn!; end
2495
-
2496
- # @return [Boolean]
2497
- #
2498
- # source://rack//lib/rack/null_logger.rb#24
2499
- def warn?; end
2500
- end
2501
-
2502
- # source://rack//lib/rack/constants.rb#34
2503
- Rack::OPTIONS = T.let(T.unsafe(nil), String)
2504
-
2505
- # source://rack//lib/rack/constants.rb#31
2506
- Rack::PATCH = T.let(T.unsafe(nil), String)
2507
-
2508
- # source://rack//lib/rack/constants.rb#8
2509
- Rack::PATH_INFO = T.let(T.unsafe(nil), String)
2510
-
2511
- # source://rack//lib/rack/constants.rb#29
2512
- Rack::POST = T.let(T.unsafe(nil), String)
2513
-
2514
- # source://rack//lib/rack/constants.rb#30
2515
- Rack::PUT = T.let(T.unsafe(nil), String)
2516
-
2517
- # source://rack//lib/rack/constants.rb#12
2518
- Rack::QUERY_STRING = T.let(T.unsafe(nil), String)
2519
-
2520
- # source://rack//lib/rack/query_parser.rb#7
2521
- class Rack::QueryParser
2522
- # @return [QueryParser] a new instance of QueryParser
2523
- #
2524
- # source://rack//lib/rack/query_parser.rb#36
2525
- def initialize(params_class, param_depth_limit); end
2526
-
2527
- # source://rack//lib/rack/query_parser.rb#166
2528
- def make_params; end
2529
-
2530
- # source://rack//lib/rack/query_parser.rb#170
2531
- def new_depth_limit(param_depth_limit); end
2532
-
2533
- # normalize_params recursively expands parameters into structural types. If
2534
- # the structural types represented by two different parameter names are in
2535
- # conflict, a ParameterTypeError is raised. The depth argument is deprecated
2536
- # and should no longer be used, it is kept for backwards compatibility with
2537
- # earlier versions of rack.
2538
- #
2539
- # source://rack//lib/rack/query_parser.rb#94
2540
- def normalize_params(params, name, v, _depth = T.unsafe(nil)); end
2541
-
2542
- # Returns the value of attribute param_depth_limit.
2543
- #
2544
- # source://rack//lib/rack/query_parser.rb#34
2545
- def param_depth_limit; end
2546
-
2547
- # parse_nested_query expands a query string into structural types. Supported
2548
- # types are Arrays, Hashes and basic value types. It is possible to supply
2549
- # query strings with parameters of conflicting types, in this case a
2550
- # ParameterTypeError is raised. Users are encouraged to return a 400 in this
2551
- # case.
2552
- #
2553
- # source://rack//lib/rack/query_parser.rb#73
2554
- def parse_nested_query(qs, separator = T.unsafe(nil)); end
2555
-
2556
- # Stolen from Mongrel, with some small modifications:
2557
- # Parses a query string by breaking it up at the '&'. You can also use this
2558
- # to parse cookies by changing the characters used in the second parameter
2559
- # (which defaults to '&').
2560
- #
2561
- # source://rack//lib/rack/query_parser.rb#45
2562
- def parse_query(qs, separator = T.unsafe(nil), &unescaper); end
2563
-
2564
- private
2565
-
2566
- # @raise [ParamsTooDeepError]
2567
- #
2568
- # source://rack//lib/rack/query_parser.rb#98
2569
- def _normalize_params(params, name, v, depth); end
2570
-
2571
- # @return [Boolean]
2572
- #
2573
- # source://rack//lib/rack/query_parser.rb#180
2574
- def params_hash_has_key?(hash, key); end
2575
-
2576
- # @return [Boolean]
2577
- #
2578
- # source://rack//lib/rack/query_parser.rb#176
2579
- def params_hash_type?(obj); end
2580
-
2581
- # source://rack//lib/rack/query_parser.rb#192
2582
- def unescape(string, encoding = T.unsafe(nil)); end
2583
-
2584
- class << self
2585
- # source://rack//lib/rack/query_parser.rb#30
2586
- def make_default(param_depth_limit); end
2587
- end
2588
- end
2589
-
2590
- # source://rack//lib/rack/query_parser.rb#9
2591
- Rack::QueryParser::COMMON_SEP = T.let(T.unsafe(nil), Hash)
2592
-
2593
- # source://rack//lib/rack/query_parser.rb#8
2594
- Rack::QueryParser::DEFAULT_SEP = T.let(T.unsafe(nil), Regexp)
2595
-
2596
- # InvalidParameterError is the error that is raised when incoming structural
2597
- # parameters (parsed by parse_nested_query) contain invalid format or byte
2598
- # sequence.
2599
- #
2600
- # source://rack//lib/rack/query_parser.rb#20
2601
- class Rack::QueryParser::InvalidParameterError < ::ArgumentError
2602
- include ::Rack::BadRequest
2603
- end
2604
-
2605
- # ParameterTypeError is the error that is raised when incoming structural
2606
- # parameters (parsed by parse_nested_query) contain conflicting types.
2607
- #
2608
- # source://rack//lib/rack/query_parser.rb#13
2609
- class Rack::QueryParser::ParameterTypeError < ::TypeError
2610
- include ::Rack::BadRequest
2611
- end
2612
-
2613
- # source://rack//lib/rack/query_parser.rb#196
2614
- class Rack::QueryParser::Params < ::Hash
2615
- def to_params_hash; end
2616
- end
2617
-
2618
- # ParamsTooDeepError is the error that is raised when params are recursively
2619
- # nested over the specified limit.
2620
- #
2621
- # source://rack//lib/rack/query_parser.rb#26
2622
- class Rack::QueryParser::ParamsTooDeepError < ::RangeError
2623
- include ::Rack::BadRequest
2624
- end
2625
-
2626
- # source://rack//lib/rack/constants.rb#43
2627
- Rack::RACK_EARLY_HINTS = T.let(T.unsafe(nil), String)
2628
-
2629
- # source://rack//lib/rack/constants.rb#44
2630
- Rack::RACK_ERRORS = T.let(T.unsafe(nil), String)
2631
-
2632
- # source://rack//lib/rack/constants.rb#51
2633
- Rack::RACK_HIJACK = T.let(T.unsafe(nil), String)
2634
-
2635
- # source://rack//lib/rack/constants.rb#46
2636
- Rack::RACK_INPUT = T.let(T.unsafe(nil), String)
2637
-
2638
- # source://rack//lib/rack/constants.rb#52
2639
- Rack::RACK_IS_HIJACK = T.let(T.unsafe(nil), String)
2640
-
2641
- # source://rack//lib/rack/constants.rb#45
2642
- Rack::RACK_LOGGER = T.let(T.unsafe(nil), String)
2643
-
2644
- # source://rack//lib/rack/constants.rb#66
2645
- Rack::RACK_METHODOVERRIDE_ORIGINAL_METHOD = T.let(T.unsafe(nil), String)
2646
-
2647
- # source://rack//lib/rack/constants.rb#54
2648
- Rack::RACK_MULTIPART_BUFFER_SIZE = T.let(T.unsafe(nil), String)
2649
-
2650
- # source://rack//lib/rack/constants.rb#55
2651
- Rack::RACK_MULTIPART_TEMPFILE_FACTORY = T.let(T.unsafe(nil), String)
2652
-
2653
- # source://rack//lib/rack/constants.rb#53
2654
- Rack::RACK_RECURSIVE_INCLUDE = T.let(T.unsafe(nil), String)
2655
-
2656
- # source://rack//lib/rack/constants.rb#62
2657
- Rack::RACK_REQUEST_COOKIE_HASH = T.let(T.unsafe(nil), String)
2658
-
2659
- # source://rack//lib/rack/constants.rb#63
2660
- Rack::RACK_REQUEST_COOKIE_STRING = T.let(T.unsafe(nil), String)
2661
-
2662
- # source://rack//lib/rack/constants.rb#61
2663
- Rack::RACK_REQUEST_FORM_ERROR = T.let(T.unsafe(nil), String)
2664
-
2665
- # source://rack//lib/rack/constants.rb#58
2666
- Rack::RACK_REQUEST_FORM_HASH = T.let(T.unsafe(nil), String)
2667
-
2668
- # source://rack//lib/rack/constants.rb#57
2669
- Rack::RACK_REQUEST_FORM_INPUT = T.let(T.unsafe(nil), String)
2670
-
2671
- # source://rack//lib/rack/constants.rb#59
2672
- Rack::RACK_REQUEST_FORM_PAIRS = T.let(T.unsafe(nil), String)
2673
-
2674
- # source://rack//lib/rack/constants.rb#60
2675
- Rack::RACK_REQUEST_FORM_VARS = T.let(T.unsafe(nil), String)
2676
-
2677
- # source://rack//lib/rack/constants.rb#64
2678
- Rack::RACK_REQUEST_QUERY_HASH = T.let(T.unsafe(nil), String)
2679
-
2680
- # source://rack//lib/rack/constants.rb#65
2681
- Rack::RACK_REQUEST_QUERY_STRING = T.let(T.unsafe(nil), String)
2682
-
2683
- # source://rack//lib/rack/constants.rb#56
2684
- Rack::RACK_RESPONSE_FINISHED = T.let(T.unsafe(nil), String)
2685
-
2686
- # source://rack//lib/rack/constants.rb#47
2687
- Rack::RACK_SESSION = T.let(T.unsafe(nil), String)
2688
-
2689
- # source://rack//lib/rack/constants.rb#48
2690
- Rack::RACK_SESSION_OPTIONS = T.let(T.unsafe(nil), String)
2691
-
2692
- # source://rack//lib/rack/constants.rb#49
2693
- Rack::RACK_SHOWSTATUS_DETAIL = T.let(T.unsafe(nil), String)
2694
-
2695
- # source://rack//lib/rack/constants.rb#42
2696
- Rack::RACK_TEMPFILES = T.let(T.unsafe(nil), String)
2697
-
2698
- # source://rack//lib/rack/constants.rb#50
2699
- Rack::RACK_URL_SCHEME = T.let(T.unsafe(nil), String)
2700
-
2701
- # Rack environment variables
2702
- #
2703
- # source://rack//lib/rack/constants.rb#41
2704
- Rack::RACK_VERSION = T.let(T.unsafe(nil), String)
2705
-
2706
- # source://rack//lib/rack/version.rb#15
2707
- Rack::RELEASE = T.let(T.unsafe(nil), String)
2708
-
2709
- # source://rack//lib/rack/constants.rb#9
2710
- Rack::REQUEST_METHOD = T.let(T.unsafe(nil), String)
2711
-
2712
- # source://rack//lib/rack/constants.rb#10
2713
- Rack::REQUEST_PATH = T.let(T.unsafe(nil), String)
2714
-
2715
- # Rack::Recursive allows applications called down the chain to
2716
- # include data from other applications (by using
2717
- # <tt>rack['rack.recursive.include'][...]</tt> or raise a
2718
- # ForwardRequest to redirect internally.
2719
- #
2720
- # source://rack//lib/rack/recursive.rb#36
2721
- class Rack::Recursive
2722
- # @return [Recursive] a new instance of Recursive
2723
- #
2724
- # source://rack//lib/rack/recursive.rb#37
2725
- def initialize(app); end
2726
-
2727
- # source://rack//lib/rack/recursive.rb#45
2728
- def _call(env); end
2729
-
2730
- # source://rack//lib/rack/recursive.rb#41
2731
- def call(env); end
2732
-
2733
- # source://rack//lib/rack/recursive.rb#52
2734
- def include(env, path); end
2735
- end
2736
-
2737
- # High performant source reloader
2738
- #
2739
- # This class acts as Rack middleware.
2740
- #
2741
- # What makes it especially suited for use in a production environment is that
2742
- # any file will only be checked once and there will only be made one system
2743
- # call stat(2).
2744
- #
2745
- # Please note that this will not reload files in the background, it does so
2746
- # only when actively called.
2747
- #
2748
- # It is performing a check/reload cycle at the start of every request, but
2749
- # also respects a cool down time, during which nothing will be done.
2750
- #
2751
- # source://rack//lib/rack/reloader.rb#24
2752
- class Rack::Reloader
2753
- # @return [Reloader] a new instance of Reloader
2754
- #
2755
- # source://rack//lib/rack/reloader.rb#25
2756
- def initialize(app, cooldown = T.unsafe(nil), backend = T.unsafe(nil)); end
2757
-
2758
- # source://rack//lib/rack/reloader.rb#36
2759
- def call(env); end
2760
-
2761
- # source://rack//lib/rack/reloader.rb#50
2762
- def reload!(stderr = T.unsafe(nil)); end
2763
-
2764
- # A safe Kernel::load, issuing the hooks depending on the results
2765
- #
2766
- # source://rack//lib/rack/reloader.rb#58
2767
- def safe_load(file, mtime, stderr = T.unsafe(nil)); end
2768
- end
2769
-
2770
- # source://rack//lib/rack/reloader.rb#68
2771
- module Rack::Reloader::Stat
2772
- # Takes a relative or absolute +file+ name, a couple possible +paths+ that
2773
- # the +file+ might reside in. Returns the full path and File::Stat for the
2774
- # path.
2775
- #
2776
- # source://rack//lib/rack/reloader.rb#88
2777
- def figure_path(file, paths); end
2778
-
2779
- # source://rack//lib/rack/reloader.rb#69
2780
- def rotation; end
2781
-
2782
- # source://rack//lib/rack/reloader.rb#103
2783
- def safe_stat(file); end
2784
- end
2785
-
2786
- # Rack::Request provides a convenient interface to a Rack
2787
- # environment. It is stateless, the environment +env+ passed to the
2788
- # constructor will be directly modified.
2789
- #
2790
- # req = Rack::Request.new(env)
2791
- # req.post?
2792
- # req.params["data"]
2793
- #
2794
- # source://rack//lib/rack/request.rb#16
2795
- class Rack::Request
2796
- include ::Rack::Request::Env
2797
- include ::Rack::Request::Helpers
2798
-
2799
- # @return [Request] a new instance of Request
2800
- #
2801
- # source://rack//lib/rack/request.rb#62
2802
- def initialize(env); end
2803
-
2804
- # source://rack//lib/rack/request.rb#76
2805
- def delete_param(k); end
2806
-
2807
- # source://rack//lib/rack/request.rb#67
2808
- def params; end
2809
-
2810
- # source://rack//lib/rack/request.rb#67
2811
- def query; end
2812
-
2813
- # source://rack//lib/rack/request.rb#71
2814
- def update_param(k, v); end
2815
-
2816
- # source://yard/0.9.37/lib/yard/server/rack_adapter.rb#94
2817
- def version_supplied; end
2818
-
2819
- # source://yard/0.9.37/lib/yard/server/rack_adapter.rb#94
2820
- def version_supplied=(_arg0); end
2821
-
2822
- # source://yard/0.9.37/lib/yard/server/rack_adapter.rb#96
2823
- def xhr?; end
2824
-
2825
- class << self
2826
- # The priority when checking forwarded headers. The default
2827
- # is <tt>[:forwarded, :x_forwarded]</tt>, which means, check the
2828
- # +Forwarded+ header first, followed by the appropriate
2829
- # <tt>X-Forwarded-*</tt> header. You can revert the priority by
2830
- # reversing the priority, or remove checking of either
2831
- # or both headers by removing elements from the array.
2832
- #
2833
- # This should be set as appropriate in your environment
2834
- # based on what reverse proxies are in use. If you are not
2835
- # using reverse proxies, you should probably use an empty
2836
- # array.
2837
- #
2838
- # source://rack//lib/rack/request.rb#31
2839
- def forwarded_priority; end
2840
-
2841
- # The priority when checking forwarded headers. The default
2842
- # is <tt>[:forwarded, :x_forwarded]</tt>, which means, check the
2843
- # +Forwarded+ header first, followed by the appropriate
2844
- # <tt>X-Forwarded-*</tt> header. You can revert the priority by
2845
- # reversing the priority, or remove checking of either
2846
- # or both headers by removing elements from the array.
2847
- #
2848
- # This should be set as appropriate in your environment
2849
- # based on what reverse proxies are in use. If you are not
2850
- # using reverse proxies, you should probably use an empty
2851
- # array.
2852
- #
2853
- # source://rack//lib/rack/request.rb#31
2854
- def forwarded_priority=(_arg0); end
2855
-
2856
- # Returns the value of attribute ip_filter.
2857
- #
2858
- # source://rack//lib/rack/request.rb#18
2859
- def ip_filter; end
2860
-
2861
- # Sets the attribute ip_filter
2862
- #
2863
- # @param value the value to set the attribute ip_filter to.
2864
- #
2865
- # source://rack//lib/rack/request.rb#18
2866
- def ip_filter=(_arg0); end
2867
-
2868
- # The priority when checking either the <tt>X-Forwarded-Proto</tt>
2869
- # or <tt>X-Forwarded-Scheme</tt> header for the forwarded protocol.
2870
- # The default is <tt>[:proto, :scheme]</tt>, to try the
2871
- # <tt>X-Forwarded-Proto</tt> header before the
2872
- # <tt>X-Forwarded-Scheme</tt> header. Rack 2 had behavior
2873
- # similar to <tt>[:scheme, :proto]</tt>. You can remove either or
2874
- # both of the entries in array to ignore that respective header.
2875
- #
2876
- # source://rack//lib/rack/request.rb#40
2877
- def x_forwarded_proto_priority; end
2878
-
2879
- # The priority when checking either the <tt>X-Forwarded-Proto</tt>
2880
- # or <tt>X-Forwarded-Scheme</tt> header for the forwarded protocol.
2881
- # The default is <tt>[:proto, :scheme]</tt>, to try the
2882
- # <tt>X-Forwarded-Proto</tt> header before the
2883
- # <tt>X-Forwarded-Scheme</tt> header. Rack 2 had behavior
2884
- # similar to <tt>[:scheme, :proto]</tt>. You can remove either or
2885
- # both of the entries in array to ignore that respective header.
2886
- #
2887
- # source://rack//lib/rack/request.rb#40
2888
- def x_forwarded_proto_priority=(_arg0); end
2889
- end
2890
- end
2891
-
2892
- # source://rack//lib/rack/request.rb#60
2893
- Rack::Request::ALLOWED_SCHEMES = T.let(T.unsafe(nil), Array)
2894
-
2895
- # source://rack//lib/rack/request.rb#82
2896
- module Rack::Request::Env
2897
- # source://rack//lib/rack/request.rb#86
2898
- def initialize(env); end
2899
-
2900
- # Add a header that may have multiple values.
2901
- #
2902
- # Example:
2903
- # request.add_header 'Accept', 'image/png'
2904
- # request.add_header 'Accept', '*/*'
2905
- #
2906
- # assert_equal 'image/png,*/*', request.get_header('Accept')
2907
- #
2908
- # http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2
2909
- #
2910
- # source://rack//lib/rack/request.rb#129
2911
- def add_header(key, v); end
2912
-
2913
- # Delete a request specific value for `name`.
2914
- #
2915
- # source://rack//lib/rack/request.rb#140
2916
- def delete_header(name); end
2917
-
2918
- # Loops through each key / value pair in the request specific data.
2919
- #
2920
- # source://rack//lib/rack/request.rb#111
2921
- def each_header(&block); end
2922
-
2923
- # The environment of the request.
2924
- #
2925
- # source://rack//lib/rack/request.rb#84
2926
- def env; end
2927
-
2928
- # If a block is given, it yields to the block if the value hasn't been set
2929
- # on the request.
2930
- #
2931
- # source://rack//lib/rack/request.rb#106
2932
- def fetch_header(name, &block); end
2933
-
2934
- # Get a request specific value for `name`.
2935
- #
2936
- # source://rack//lib/rack/request.rb#100
2937
- def get_header(name); end
2938
-
2939
- # Predicate method to test to see if `name` has been set as request
2940
- # specific data
2941
- #
2942
- # @return [Boolean]
2943
- #
2944
- # source://rack//lib/rack/request.rb#95
2945
- def has_header?(name); end
2946
-
2947
- # Set a request specific value for `name` to `v`
2948
- #
2949
- # source://rack//lib/rack/request.rb#116
2950
- def set_header(name, v); end
2951
-
2952
- private
2953
-
2954
- # source://rack//lib/rack/request.rb#144
2955
- def initialize_copy(other); end
2956
- end
2957
-
2958
- # source://rack//lib/rack/request.rb#149
2959
- module Rack::Request::Helpers
2960
- # Returns the data received in the query string.
2961
- #
2962
- # source://rack//lib/rack/request.rb#484
2963
- def GET; end
2964
-
2965
- # Returns the data received in the request body.
2966
- #
2967
- # This method support both application/x-www-form-urlencoded and
2968
- # multipart/form-data.
2969
- #
2970
- # source://rack//lib/rack/request.rb#503
2971
- def POST; end
2972
-
2973
- # source://rack//lib/rack/request.rb#607
2974
- def accept_encoding; end
2975
-
2976
- # source://rack//lib/rack/request.rb#611
2977
- def accept_language; end
2978
-
2979
- # The authority of the incoming request as defined by RFC3976.
2980
- # https://tools.ietf.org/html/rfc3986#section-3.2
2981
- #
2982
- # In HTTP/1, this is the `host` header.
2983
- # In HTTP/2, this is the `:authority` pseudo-header.
2984
- #
2985
- # source://rack//lib/rack/request.rb#266
2986
- def authority; end
2987
-
2988
- # source://rack//lib/rack/request.rb#590
2989
- def base_url; end
2990
-
2991
- # source://rack//lib/rack/request.rb#190
2992
- def body; end
2993
-
2994
- # The character set of the request body if a "charset" media type
2995
- # parameter was given, or nil if no "charset" was specified. Note
2996
- # that, per RFC2616, text/* media types that specify no explicit
2997
- # charset are to be considered ISO-8859-1.
2998
- #
2999
- # source://rack//lib/rack/request.rb#458
3000
- def content_charset; end
3001
-
3002
- # source://rack//lib/rack/request.rb#199
3003
- def content_length; end
3004
-
3005
- # source://rack//lib/rack/request.rb#308
3006
- def content_type; end
3007
-
3008
- # source://rack//lib/rack/request.rb#293
3009
- def cookies; end
3010
-
3011
- # Checks the HTTP request method (or verb) to see if it was of type DELETE
3012
- #
3013
- # @return [Boolean]
3014
- #
3015
- # source://rack//lib/rack/request.rb#220
3016
- def delete?; end
3017
-
3018
- # Destructively delete a parameter, whether it's in GET or POST. Returns the value of the deleted parameter.
3019
- #
3020
- # If the parameter is in both GET and POST, the POST value takes precedence since that's how #params works.
3021
- #
3022
- # <tt>env['rack.input']</tt> is not touched.
3023
- #
3024
- # source://rack//lib/rack/request.rb#585
3025
- def delete_param(k); end
3026
-
3027
- # Determine whether the request body contains form-data by checking
3028
- # the request content-type for one of the media-types:
3029
- # "application/x-www-form-urlencoded" or "multipart/form-data". The
3030
- # list of form-data media types can be modified through the
3031
- # +FORM_DATA_MEDIA_TYPES+ array.
3032
- #
3033
- # A request body is also assumed to contain form-data when no
3034
- # content-type header is provided and the request_method is POST.
3035
- #
3036
- # @return [Boolean]
3037
- #
3038
- # source://rack//lib/rack/request.rb#470
3039
- def form_data?; end
3040
-
3041
- # source://rack//lib/rack/request.rb#393
3042
- def forwarded_authority; end
3043
-
3044
- # source://rack//lib/rack/request.rb#353
3045
- def forwarded_for; end
3046
-
3047
- # source://rack//lib/rack/request.rb#374
3048
- def forwarded_port; end
3049
-
3050
- # source://rack//lib/rack/request.rb#603
3051
- def fullpath; end
3052
-
3053
- # Checks the HTTP request method (or verb) to see if it was of type GET
3054
- #
3055
- # @return [Boolean]
3056
- #
3057
- # source://rack//lib/rack/request.rb#223
3058
- def get?; end
3059
-
3060
- # Checks the HTTP request method (or verb) to see if it was of type HEAD
3061
- #
3062
- # @return [Boolean]
3063
- #
3064
- # source://rack//lib/rack/request.rb#226
3065
- def head?; end
3066
-
3067
- # Returns a formatted host, suitable for being used in a URI.
3068
- #
3069
- # source://rack//lib/rack/request.rb#333
3070
- def host; end
3071
-
3072
- # The `HTTP_HOST` header.
3073
- #
3074
- # source://rack//lib/rack/request.rb#318
3075
- def host_authority; end
3076
-
3077
- # source://rack//lib/rack/request.rb#322
3078
- def host_with_port(authority = T.unsafe(nil)); end
3079
-
3080
- # Returns an address suitable for being to resolve to an address.
3081
- # In the case of a domain name or IPv4 address, the result is the same
3082
- # as +host+. In the case of IPv6 or future address formats, the square
3083
- # brackets are removed.
3084
- #
3085
- # source://rack//lib/rack/request.rb#341
3086
- def hostname; end
3087
-
3088
- # source://rack//lib/rack/request.rb#414
3089
- def ip; end
3090
-
3091
- # Checks the HTTP request method (or verb) to see if it was of type LINK
3092
- #
3093
- # @return [Boolean]
3094
- #
3095
- # source://rack//lib/rack/request.rb#232
3096
- def link?; end
3097
-
3098
- # source://rack//lib/rack/request.rb#200
3099
- def logger; end
3100
-
3101
- # The media type (type/subtype) portion of the CONTENT_TYPE header
3102
- # without any media type parameters. e.g., when CONTENT_TYPE is
3103
- # "text/plain;charset=utf-8", the media-type is "text/plain".
3104
- #
3105
- # For more information on the use of media types in HTTP, see:
3106
- # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7
3107
- #
3108
- # source://rack//lib/rack/request.rb#441
3109
- def media_type; end
3110
-
3111
- # The media type parameters provided in CONTENT_TYPE as a Hash, or
3112
- # an empty Hash if no CONTENT_TYPE or media-type parameters were
3113
- # provided. e.g., when the CONTENT_TYPE is "text/plain;charset=utf-8",
3114
- # this method responds with the following Hash:
3115
- # { 'charset' => 'utf-8' }
3116
- #
3117
- # source://rack//lib/rack/request.rb#450
3118
- def media_type_params; end
3119
-
3120
- # Checks the HTTP request method (or verb) to see if it was of type OPTIONS
3121
- #
3122
- # @return [Boolean]
3123
- #
3124
- # source://rack//lib/rack/request.rb#229
3125
- def options?; end
3126
-
3127
- # The union of GET and POST data.
3128
- #
3129
- # Note that modifications will not be persisted in the env. Use update_param or delete_param if you want to destructively modify params.
3130
- #
3131
- # source://rack//lib/rack/request.rb#556
3132
- def params; end
3133
-
3134
- # Determine whether the request body contains data by checking
3135
- # the request media_type against registered parse-data media-types
3136
- #
3137
- # @return [Boolean]
3138
- #
3139
- # source://rack//lib/rack/request.rb#479
3140
- def parseable_data?; end
3141
-
3142
- # Checks the HTTP request method (or verb) to see if it was of type PATCH
3143
- #
3144
- # @return [Boolean]
3145
- #
3146
- # source://rack//lib/rack/request.rb#235
3147
- def patch?; end
3148
-
3149
- # source://rack//lib/rack/request.rb#599
3150
- def path; end
3151
-
3152
- # source://rack//lib/rack/request.rb#194
3153
- def path_info; end
3154
-
3155
- # source://rack//lib/rack/request.rb#195
3156
- def path_info=(s); end
3157
-
3158
- # source://rack//lib/rack/request.rb#345
3159
- def port; end
3160
-
3161
- # Checks the HTTP request method (or verb) to see if it was of type POST
3162
- #
3163
- # @return [Boolean]
3164
- #
3165
- # source://rack//lib/rack/request.rb#238
3166
- def post?; end
3167
-
3168
- # Checks the HTTP request method (or verb) to see if it was of type PUT
3169
- #
3170
- # @return [Boolean]
3171
- #
3172
- # source://rack//lib/rack/request.rb#241
3173
- def put?; end
3174
-
3175
- # source://rack//lib/rack/request.rb#198
3176
- def query_string; end
3177
-
3178
- # the referer of the client
3179
- #
3180
- # source://rack//lib/rack/request.rb#204
3181
- def referer; end
3182
-
3183
- # the referer of the client
3184
- #
3185
- # source://rack//lib/rack/request.rb#204
3186
- def referrer; end
3187
-
3188
- # source://rack//lib/rack/request.rb#197
3189
- def request_method; end
3190
-
3191
- # source://rack//lib/rack/request.rb#249
3192
- def scheme; end
3193
-
3194
- # source://rack//lib/rack/request.rb#191
3195
- def script_name; end
3196
-
3197
- # source://rack//lib/rack/request.rb#192
3198
- def script_name=(s); end
3199
-
3200
- # The authority as defined by the `SERVER_NAME` and `SERVER_PORT`
3201
- # variables.
3202
- #
3203
- # source://rack//lib/rack/request.rb#272
3204
- def server_authority; end
3205
-
3206
- # source://rack//lib/rack/request.rb#285
3207
- def server_name; end
3208
-
3209
- # source://rack//lib/rack/request.rb#289
3210
- def server_port; end
3211
-
3212
- # source://rack//lib/rack/request.rb#207
3213
- def session; end
3214
-
3215
- # source://rack//lib/rack/request.rb#213
3216
- def session_options; end
3217
-
3218
- # @return [Boolean]
3219
- #
3220
- # source://rack//lib/rack/request.rb#410
3221
- def ssl?; end
3222
-
3223
- # Checks the HTTP request method (or verb) to see if it was of type TRACE
3224
- #
3225
- # @return [Boolean]
3226
- #
3227
- # source://rack//lib/rack/request.rb#244
3228
- def trace?; end
3229
-
3230
- # @return [Boolean]
3231
- #
3232
- # source://rack//lib/rack/request.rb#615
3233
- def trusted_proxy?(ip); end
3234
-
3235
- # Checks the HTTP request method (or verb) to see if it was of type UNLINK
3236
- #
3237
- # @return [Boolean]
3238
- #
3239
- # source://rack//lib/rack/request.rb#247
3240
- def unlink?; end
3241
-
3242
- # Destructively update a parameter, whether it's in GET and/or POST. Returns nil.
3243
- #
3244
- # 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.
3245
- #
3246
- # <tt>env['rack.input']</tt> is not touched.
3247
- #
3248
- # source://rack//lib/rack/request.rb#565
3249
- def update_param(k, v); end
3250
-
3251
- # Tries to return a remake of the original request URL as a string.
3252
- #
3253
- # source://rack//lib/rack/request.rb#595
3254
- def url; end
3255
-
3256
- # source://rack//lib/rack/request.rb#201
3257
- def user_agent; end
3258
-
3259
- # like Hash#values_at
3260
- #
3261
- # source://rack//lib/rack/request.rb#620
3262
- def values_at(*keys); end
3263
-
3264
- # @return [Boolean]
3265
- #
3266
- # source://rack//lib/rack/request.rb#313
3267
- def xhr?; end
3268
-
3269
- private
3270
-
3271
- # source://rack//lib/rack/request.rb#776
3272
- def allowed_scheme(header); end
3273
-
3274
- # source://rack//lib/rack/request.rb#628
3275
- def default_session; end
3276
-
3277
- # source://rack//lib/rack/request.rb#684
3278
- def expand_param_pairs(pairs, query_parser = T.unsafe(nil)); end
3279
-
3280
- # source://rack//lib/rack/request.rb#780
3281
- def forwarded_priority; end
3282
-
3283
- # source://rack//lib/rack/request.rb#752
3284
- def forwarded_scheme; end
3285
-
3286
- # Get an array of values set in the RFC 7239 `Forwarded` request header.
3287
- #
3288
- # source://rack//lib/rack/request.rb#668
3289
- def get_http_forwarded(token); end
3290
-
3291
- # source://rack//lib/rack/request.rb#644
3292
- def parse_http_accept_header(header); end
3293
-
3294
- # source://rack//lib/rack/request.rb#680
3295
- def parse_multipart; end
3296
-
3297
- # source://rack//lib/rack/request.rb#676
3298
- def parse_query(qs, d = T.unsafe(nil)); end
3299
-
3300
- # source://rack//lib/rack/request.rb#672
3301
- def query_parser; end
3302
-
3303
- # source://rack//lib/rack/request.rb#743
3304
- def reject_trusted_ip_addresses(ip_addresses); end
3305
-
3306
- # source://rack//lib/rack/request.rb#737
3307
- def split_authority(authority); end
3308
-
3309
- # source://rack//lib/rack/request.rb#694
3310
- def split_header(value); end
3311
-
3312
- # Assist with compatibility when processing `X-Forwarded-For`.
3313
- #
3314
- # source://rack//lib/rack/request.rb#631
3315
- def wrap_ipv6(host); end
3316
-
3317
- # source://rack//lib/rack/request.rb#784
3318
- def x_forwarded_proto_priority; end
3319
- end
3320
-
3321
- # source://rack//lib/rack/request.rb#722
3322
- Rack::Request::Helpers::AUTHORITY = T.let(T.unsafe(nil), Regexp)
3323
-
3324
- # Default ports depending on scheme. Used to decide whether or not
3325
- # to include the port in a generated URI.
3326
- #
3327
- # source://rack//lib/rack/request.rb#168
3328
- Rack::Request::Helpers::DEFAULT_PORTS = T.let(T.unsafe(nil), Hash)
3329
-
3330
- # The set of form-data media-types. Requests that do not indicate
3331
- # one of the media types present in this list will not be eligible
3332
- # for form-data / param parsing.
3333
- #
3334
- # source://rack//lib/rack/request.rb#153
3335
- Rack::Request::Helpers::FORM_DATA_MEDIA_TYPES = T.let(T.unsafe(nil), Array)
3336
-
3337
- # source://rack//lib/rack/request.rb#747
3338
- Rack::Request::Helpers::FORWARDED_SCHEME_HEADERS = T.let(T.unsafe(nil), Hash)
3339
-
3340
- # source://rack//lib/rack/request.rb#176
3341
- Rack::Request::Helpers::HTTP_FORWARDED = T.let(T.unsafe(nil), String)
3342
-
3343
- # The address of the client which connected to the proxy.
3344
- #
3345
- # source://rack//lib/rack/request.rb#171
3346
- Rack::Request::Helpers::HTTP_X_FORWARDED_FOR = T.let(T.unsafe(nil), String)
3347
-
3348
- # The contents of the host/:authority header sent to the proxy.
3349
- #
3350
- # source://rack//lib/rack/request.rb#174
3351
- Rack::Request::Helpers::HTTP_X_FORWARDED_HOST = T.let(T.unsafe(nil), String)
3352
-
3353
- # The port used to connect to the proxy.
3354
- #
3355
- # source://rack//lib/rack/request.rb#185
3356
- Rack::Request::Helpers::HTTP_X_FORWARDED_PORT = T.let(T.unsafe(nil), String)
3357
-
3358
- # The protocol used to connect to the proxy.
3359
- #
3360
- # source://rack//lib/rack/request.rb#182
3361
- Rack::Request::Helpers::HTTP_X_FORWARDED_PROTO = T.let(T.unsafe(nil), String)
3362
-
3363
- # The value of the scheme sent to the proxy.
3364
- #
3365
- # source://rack//lib/rack/request.rb#179
3366
- Rack::Request::Helpers::HTTP_X_FORWARDED_SCHEME = T.let(T.unsafe(nil), String)
3367
-
3368
- # Another way for specifying https scheme was used.
3369
- #
3370
- # source://rack//lib/rack/request.rb#188
3371
- Rack::Request::Helpers::HTTP_X_FORWARDED_SSL = T.let(T.unsafe(nil), String)
3372
-
3373
- # The set of media-types. Requests that do not indicate
3374
- # one of the media types present in this list will not be eligible
3375
- # for param parsing like soap attachments or generic multiparts
3376
- #
3377
- # source://rack//lib/rack/request.rb#161
3378
- Rack::Request::Helpers::PARSEABLE_DATA_MEDIA_TYPES = T.let(T.unsafe(nil), Array)
3379
-
3380
- # Rack::Response provides a convenient interface to create a Rack
3381
- # response.
3382
- #
3383
- # It allows setting of headers and cookies, and provides useful
3384
- # defaults (an OK response with empty headers and body).
3385
- #
3386
- # You can use Response#write to iteratively generate your response,
3387
- # but note that this is buffered by Rack::Response until you call
3388
- # +finish+. +finish+ however can take a block inside which calls to
3389
- # +write+ are synchronous with the Rack response.
3390
- #
3391
- # Your application's +call+ should end returning Response#finish.
3392
- #
3393
- # source://rack//lib/rack/response.rb#23
3394
- class Rack::Response
3395
- include ::Rack::Response::Helpers
3396
-
3397
- # Initialize the response object with the specified +body+, +status+
3398
- # and +headers+.
3399
- #
3400
- # If the +body+ is +nil+, construct an empty response object with internal
3401
- # buffering.
3402
- #
3403
- # If the +body+ responds to +to_str+, assume it's a string-like object and
3404
- # construct a buffered response object containing using that string as the
3405
- # initial contents of the buffer.
3406
- #
3407
- # Otherwise it is expected +body+ conforms to the normal requirements of a
3408
- # Rack response body, typically implementing one of +each+ (enumerable
3409
- # body) or +call+ (streaming body).
3410
- #
3411
- # The +status+ defaults to +200+ which is the "OK" HTTP status code. You
3412
- # can provide any other valid status code.
3413
- #
3414
- # The +headers+ must be a +Hash+ of key-value header pairs which conform to
3415
- # the Rack specification for response headers. The key must be a +String+
3416
- # instance and the value can be either a +String+ or +Array+ instance.
3417
- #
3418
- # @return [Response] a new instance of Response
3419
- # @yield [_self]
3420
- # @yieldparam _self [Rack::Response] the object that the method was called on
3421
- #
3422
- # source://rack//lib/rack/response.rb#54
3423
- def initialize(body = T.unsafe(nil), status = T.unsafe(nil), headers = T.unsafe(nil)); end
3424
-
3425
- # @raise [ArgumentError]
3426
- #
3427
- # source://rack//lib/rack/response.rb#164
3428
- def [](key); end
3429
-
3430
- # @raise [ArgumentError]
3431
- #
3432
- # source://rack//lib/rack/response.rb#168
3433
- def []=(key, value); end
3434
-
3435
- # Returns the value of attribute body.
3436
- #
3437
- # source://rack//lib/rack/response.rb#31
3438
- def body; end
3439
-
3440
- # Sets the attribute body
3441
- #
3442
- # @param value the value to set the attribute body to.
3443
- #
3444
- # source://rack//lib/rack/response.rb#31
3445
- def body=(_arg0); end
3446
-
3447
- # @return [Boolean]
3448
- #
3449
- # source://rack//lib/rack/response.rb#95
3450
- def chunked?; end
3451
-
3452
- # source://rack//lib/rack/response.rb#152
3453
- def close; end
3454
-
3455
- # @raise [ArgumentError]
3456
- #
3457
- # source://rack//lib/rack/response.rb#172
3458
- def delete_header(key); end
3459
-
3460
- # source://rack//lib/rack/response.rb#130
3461
- def each(&callback); end
3462
-
3463
- # @return [Boolean]
3464
- #
3465
- # source://rack//lib/rack/response.rb#156
3466
- def empty?; end
3467
-
3468
- # Generate a response array consistent with the requirements of the SPEC.
3469
- # which is suitable to be returned from the middleware `#call(env)` method.
3470
- #
3471
- # @return [Array] a 3-tuple suitable of `[status, headers, body]`
3472
- #
3473
- # source://rack//lib/rack/response.rb#107
3474
- def finish(&block); end
3475
-
3476
- # @raise [ArgumentError]
3477
- #
3478
- # source://rack//lib/rack/response.rb#164
3479
- def get_header(key); end
3480
-
3481
- # @raise [ArgumentError]
3482
- # @return [Boolean]
3483
- #
3484
- # source://rack//lib/rack/response.rb#160
3485
- def has_header?(key); end
3486
-
3487
- # Returns the value of attribute headers.
3488
- #
3489
- # source://rack//lib/rack/response.rb#32
3490
- def headers; end
3491
-
3492
- # Returns the value of attribute length.
3493
- #
3494
- # source://rack//lib/rack/response.rb#31
3495
- def length; end
3496
-
3497
- # Sets the attribute length
3498
- #
3499
- # @param value the value to set the attribute length to.
3500
- #
3501
- # source://rack//lib/rack/response.rb#31
3502
- def length=(_arg0); end
3503
-
3504
- # @return [Boolean]
3505
- #
3506
- # source://rack//lib/rack/response.rb#99
3507
- def no_entity_body?; end
3508
-
3509
- # source://rack//lib/rack/response.rb#90
3510
- def redirect(target, status = T.unsafe(nil)); end
3511
-
3512
- # @raise [ArgumentError]
3513
- #
3514
- # source://rack//lib/rack/response.rb#168
3515
- def set_header(key, value); end
3516
-
3517
- # Returns the value of attribute status.
3518
- #
3519
- # source://rack//lib/rack/response.rb#31
3520
- def status; end
3521
-
3522
- # Sets the attribute status
3523
- #
3524
- # @param value the value to set the attribute status to.
3525
- #
3526
- # source://rack//lib/rack/response.rb#31
3527
- def status=(_arg0); end
3528
-
3529
- # Generate a response array consistent with the requirements of the SPEC.
3530
- # which is suitable to be returned from the middleware `#call(env)` method.
3531
- # For *response
3532
- #
3533
- # @return [Array] a 3-tuple suitable of `[status, headers, body]`
3534
- #
3535
- # source://rack//lib/rack/response.rb#107
3536
- def to_a(&block); end
3537
-
3538
- # Append a chunk to the response body.
3539
- #
3540
- # Converts the response into a buffered response if it wasn't already.
3541
- #
3542
- # NOTE: Do not mix #write and direct #body access!
3543
- #
3544
- # source://rack//lib/rack/response.rb#146
3545
- def write(chunk); end
3546
-
3547
- class << self
3548
- # source://rack//lib/rack/response.rb#24
3549
- def [](status, headers, body); end
3550
- end
3551
- end
3552
-
3553
- # source://rack//lib/rack/response.rb#28
3554
- Rack::Response::CHUNKED = T.let(T.unsafe(nil), String)
3555
-
3556
- # source://rack//lib/rack/response.rb#180
3557
- module Rack::Response::Helpers
3558
- # @return [Boolean]
3559
- #
3560
- # source://rack//lib/rack/response.rb#191
3561
- def accepted?; end
3562
-
3563
- # Add a header that may have multiple values.
3564
- #
3565
- # Example:
3566
- # response.add_header 'vary', 'accept-encoding'
3567
- # response.add_header 'vary', 'cookie'
3568
- #
3569
- # assert_equal 'accept-encoding,cookie', response.get_header('vary')
3570
- #
3571
- # http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2
3572
- #
3573
- # @raise [ArgumentError]
3574
- #
3575
- # source://rack//lib/rack/response.rb#219
3576
- def add_header(key, value); end
3577
-
3578
- # @return [Boolean]
3579
- #
3580
- # source://rack//lib/rack/response.rb#194
3581
- def bad_request?; end
3582
-
3583
- # Specify that the content should be cached.
3584
- #
3585
- # @option directive
3586
- # @param duration [Integer] The number of seconds until the cache expires.
3587
- # @param directive [Hash] a customizable set of options
3588
- #
3589
- # source://rack//lib/rack/response.rb#307
3590
- def cache!(duration = T.unsafe(nil), directive: T.unsafe(nil)); end
3591
-
3592
- # source://rack//lib/rack/response.rb#290
3593
- def cache_control; end
3594
-
3595
- # source://rack//lib/rack/response.rb#294
3596
- def cache_control=(value); end
3597
-
3598
- # @return [Boolean]
3599
- #
3600
- # source://rack//lib/rack/response.rb#186
3601
- def client_error?; end
3602
-
3603
- # source://rack//lib/rack/response.rb#257
3604
- def content_length; end
3605
-
3606
- # Get the content type of the response.
3607
- #
3608
- # source://rack//lib/rack/response.rb#240
3609
- def content_type; end
3610
-
3611
- # Set the content type of the response.
3612
- #
3613
- # source://rack//lib/rack/response.rb#245
3614
- def content_type=(content_type); end
3615
-
3616
- # @return [Boolean]
3617
- #
3618
- # source://rack//lib/rack/response.rb#190
3619
- def created?; end
3620
-
3621
- # source://rack//lib/rack/response.rb#274
3622
- def delete_cookie(key, value = T.unsafe(nil)); end
3623
-
3624
- # Specifies that the content shouldn't be cached. Overrides `cache!` if already called.
3625
- #
3626
- # source://rack//lib/rack/response.rb#299
3627
- def do_not_cache!; end
3628
-
3629
- # source://rack//lib/rack/response.rb#314
3630
- def etag; end
3631
-
3632
- # source://rack//lib/rack/response.rb#318
3633
- def etag=(value); end
3634
-
3635
- # @return [Boolean]
3636
- #
3637
- # source://rack//lib/rack/response.rb#196
3638
- def forbidden?; end
3639
-
3640
- # @return [Boolean]
3641
- #
3642
- # source://rack//lib/rack/response.rb#206
3643
- def include?(header); end
3644
-
3645
- # @return [Boolean]
3646
- #
3647
- # source://rack//lib/rack/response.rb#183
3648
- def informational?; end
3649
-
3650
- # @return [Boolean]
3651
- #
3652
- # source://rack//lib/rack/response.rb#181
3653
- def invalid?; end
3654
-
3655
- # source://rack//lib/rack/response.rb#262
3656
- def location; end
3657
-
3658
- # source://rack//lib/rack/response.rb#266
3659
- def location=(location); end
3660
-
3661
- # source://rack//lib/rack/response.rb#249
3662
- def media_type; end
3663
-
3664
- # source://rack//lib/rack/response.rb#253
3665
- def media_type_params; end
3666
-
3667
- # @return [Boolean]
3668
- #
3669
- # source://rack//lib/rack/response.rb#198
3670
- def method_not_allowed?; end
3671
-
3672
- # @return [Boolean]
3673
- #
3674
- # source://rack//lib/rack/response.rb#193
3675
- def moved_permanently?; end
3676
-
3677
- # @return [Boolean]
3678
- #
3679
- # source://rack//lib/rack/response.rb#192
3680
- def no_content?; end
3681
-
3682
- # @return [Boolean]
3683
- #
3684
- # source://rack//lib/rack/response.rb#199
3685
- def not_acceptable?; end
3686
-
3687
- # @return [Boolean]
3688
- #
3689
- # source://rack//lib/rack/response.rb#197
3690
- def not_found?; end
3691
-
3692
- # @return [Boolean]
3693
- #
3694
- # source://rack//lib/rack/response.rb#189
3695
- def ok?; end
3696
-
3697
- # @return [Boolean]
3698
- #
3699
- # source://rack//lib/rack/response.rb#201
3700
- def precondition_failed?; end
3701
-
3702
- # @return [Boolean]
3703
- #
3704
- # source://rack//lib/rack/response.rb#204
3705
- def redirect?; end
3706
-
3707
- # @return [Boolean]
3708
- #
3709
- # source://rack//lib/rack/response.rb#185
3710
- def redirection?; end
3711
-
3712
- # @return [Boolean]
3713
- #
3714
- # source://rack//lib/rack/response.rb#200
3715
- def request_timeout?; end
3716
-
3717
- # @return [Boolean]
3718
- #
3719
- # source://rack//lib/rack/response.rb#187
3720
- def server_error?; end
3721
-
3722
- # source://rack//lib/rack/response.rb#270
3723
- def set_cookie(key, value); end
3724
-
3725
- # source://rack//lib/rack/response.rb#282
3726
- def set_cookie_header; end
3727
-
3728
- # source://rack//lib/rack/response.rb#286
3729
- def set_cookie_header=(value); end
3730
-
3731
- # @return [Boolean]
3732
- #
3733
- # source://rack//lib/rack/response.rb#184
3734
- def successful?; end
3735
-
3736
- # @return [Boolean]
3737
- #
3738
- # source://rack//lib/rack/response.rb#195
3739
- def unauthorized?; end
3740
-
3741
- # @return [Boolean]
3742
- #
3743
- # source://rack//lib/rack/response.rb#202
3744
- def unprocessable?; end
3745
-
3746
- protected
3747
-
3748
- # source://rack//lib/rack/response.rb#359
3749
- def append(chunk); end
3750
-
3751
- # Convert the body of this response into an internally buffered Array if possible.
3752
- #
3753
- # `@buffered` is a ternary value which indicates whether the body is buffered. It can be:
3754
- # * `nil` - The body has not been buffered yet.
3755
- # * `true` - The body is buffered as an Array instance.
3756
- # * `false` - The body is not buffered and cannot be buffered.
3757
- #
3758
- # @return [Boolean] whether the body is buffered as an Array instance.
3759
- #
3760
- # source://rack//lib/rack/response.rb#332
3761
- def buffered_body!; end
3762
- end
3763
-
3764
- # source://rack//lib/rack/response.rb#375
3765
- class Rack::Response::Raw
3766
- include ::Rack::Response::Helpers
3767
-
3768
- # @return [Raw] a new instance of Raw
3769
- #
3770
- # source://rack//lib/rack/response.rb#381
3771
- def initialize(status, headers); end
3772
-
3773
- # source://rack//lib/rack/response.rb#398
3774
- def delete_header(key); end
3775
-
3776
- # source://rack//lib/rack/response.rb#390
3777
- def get_header(key); end
3778
-
3779
- # @return [Boolean]
3780
- #
3781
- # source://rack//lib/rack/response.rb#386
3782
- def has_header?(key); end
3783
-
3784
- # Returns the value of attribute headers.
3785
- #
3786
- # source://rack//lib/rack/response.rb#378
3787
- def headers; end
3788
-
3789
- # source://rack//lib/rack/response.rb#394
3790
- def set_header(key, value); end
3791
-
3792
- # Returns the value of attribute status.
3793
- #
3794
- # source://rack//lib/rack/response.rb#379
3795
- def status; end
3796
-
3797
- # Sets the attribute status
3798
- #
3799
- # @param value the value to set the attribute status to.
3800
- #
3801
- # source://rack//lib/rack/response.rb#379
3802
- def status=(_arg0); end
3803
- end
3804
-
3805
- # source://rack//lib/rack/response.rb#29
3806
- Rack::Response::STATUS_WITH_NO_ENTITY_BODY = T.let(T.unsafe(nil), Hash)
3807
-
3808
- # Class which can make any IO object rewindable, including non-rewindable ones. It does
3809
- # this by buffering the data into a tempfile, which is rewindable.
3810
- #
3811
- # Don't forget to call #close when you're done. This frees up temporary resources that
3812
- # RewindableInput uses, though it does *not* close the original IO object.
3813
- #
3814
- # source://rack//lib/rack/rewindable_input.rb#14
3815
- class Rack::RewindableInput
3816
- # @return [RewindableInput] a new instance of RewindableInput
3817
- #
3818
- # source://rack//lib/rack/rewindable_input.rb#29
3819
- def initialize(io); end
3820
-
3821
- # Closes this RewindableInput object without closing the originally
3822
- # wrapped IO object. Cleans up any temporary resources that this RewindableInput
3823
- # has created.
3824
- #
3825
- # This method may be called multiple times. It does nothing on subsequent calls.
3826
- #
3827
- # source://rack//lib/rack/rewindable_input.rb#65
3828
- def close; end
3829
-
3830
- # source://rack//lib/rack/rewindable_input.rb#45
3831
- def each(&block); end
3832
-
3833
- # source://rack//lib/rack/rewindable_input.rb#35
3834
- def gets; end
3835
-
3836
- # source://rack//lib/rack/rewindable_input.rb#40
3837
- def read(*args); end
3838
-
3839
- # source://rack//lib/rack/rewindable_input.rb#50
3840
- def rewind; end
3841
-
3842
- # source://rack//lib/rack/rewindable_input.rb#55
3843
- def size; end
3844
-
3845
- private
3846
-
3847
- # @return [Boolean]
3848
- #
3849
- # source://rack//lib/rack/rewindable_input.rb#109
3850
- def filesystem_has_posix_semantics?; end
3851
-
3852
- # source://rack//lib/rack/rewindable_input.rb#78
3853
- def make_rewindable; end
3854
- end
3855
-
3856
- # Makes rack.input rewindable, for compatibility with applications and middleware
3857
- # designed for earlier versions of Rack (where rack.input was required to be
3858
- # rewindable).
3859
- #
3860
- # source://rack//lib/rack/rewindable_input.rb#18
3861
- class Rack::RewindableInput::Middleware
3862
- # @return [Middleware] a new instance of Middleware
3863
- #
3864
- # source://rack//lib/rack/rewindable_input.rb#19
3865
- def initialize(app); end
3866
-
3867
- # source://rack//lib/rack/rewindable_input.rb#23
3868
- def call(env); end
3869
- end
3870
-
3871
- # Sets an "x-runtime" response header, indicating the response
3872
- # time of the request, in seconds
3873
- #
3874
- # You can put it right before the application to see the processing
3875
- # time, or before all the other middlewares to include time for them,
3876
- # too.
3877
- #
3878
- # source://rack//lib/rack/runtime.rb#12
3879
- class Rack::Runtime
3880
- # @return [Runtime] a new instance of Runtime
3881
- #
3882
- # source://rack//lib/rack/runtime.rb#16
3883
- def initialize(app, name = T.unsafe(nil)); end
3884
-
3885
- # source://rack//lib/rack/runtime.rb#22
3886
- def call(env); end
3887
- end
3888
-
3889
- # source://rack//lib/rack/runtime.rb#13
3890
- Rack::Runtime::FORMAT_STRING = T.let(T.unsafe(nil), String)
3891
-
3892
- # source://rack//lib/rack/runtime.rb#14
3893
- Rack::Runtime::HEADER_NAME = T.let(T.unsafe(nil), String)
3894
-
3895
- # source://rack//lib/rack/constants.rb#11
3896
- Rack::SCRIPT_NAME = T.let(T.unsafe(nil), String)
3897
-
3898
- # source://rack//lib/rack/constants.rb#14
3899
- Rack::SERVER_NAME = T.let(T.unsafe(nil), String)
3900
-
3901
- # source://rack//lib/rack/constants.rb#15
3902
- Rack::SERVER_PORT = T.let(T.unsafe(nil), String)
3903
-
3904
- # source://rack//lib/rack/constants.rb#13
3905
- Rack::SERVER_PROTOCOL = T.let(T.unsafe(nil), String)
3906
-
3907
- # source://rack//lib/rack/constants.rb#24
3908
- Rack::SET_COOKIE = T.let(T.unsafe(nil), String)
3909
-
3910
- # = Sendfile
3911
- #
3912
- # The Sendfile middleware intercepts responses whose body is being
3913
- # served from a file and replaces it with a server specific x-sendfile
3914
- # header. The web server is then responsible for writing the file contents
3915
- # to the client. This can dramatically reduce the amount of work required
3916
- # by the Ruby backend and takes advantage of the web server's optimized file
3917
- # delivery code.
3918
- #
3919
- # In order to take advantage of this middleware, the response body must
3920
- # respond to +to_path+ and the request must include an x-sendfile-type
3921
- # header. Rack::Files and other components implement +to_path+ so there's
3922
- # rarely anything you need to do in your application. The x-sendfile-type
3923
- # header is typically set in your web servers configuration. The following
3924
- # sections attempt to document
3925
- #
3926
- # === Nginx
3927
- #
3928
- # Nginx supports the x-accel-redirect header. This is similar to x-sendfile
3929
- # but requires parts of the filesystem to be mapped into a private URL
3930
- # hierarchy.
3931
- #
3932
- # The following example shows the Nginx configuration required to create
3933
- # a private "/files/" area, enable x-accel-redirect, and pass the special
3934
- # x-sendfile-type and x-accel-mapping headers to the backend:
3935
- #
3936
- # location ~ /files/(.*) {
3937
- # internal;
3938
- # alias /var/www/$1;
3939
- # }
3940
- #
3941
- # location / {
3942
- # proxy_redirect off;
3943
- #
3944
- # proxy_set_header Host $host;
3945
- # proxy_set_header X-Real-IP $remote_addr;
3946
- # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
3947
- #
3948
- # proxy_set_header x-sendfile-type x-accel-redirect;
3949
- # proxy_set_header x-accel-mapping /var/www/=/files/;
3950
- #
3951
- # proxy_pass http://127.0.0.1:8080/;
3952
- # }
3953
- #
3954
- # Note that the x-sendfile-type header must be set exactly as shown above.
3955
- # The x-accel-mapping header should specify the location on the file system,
3956
- # followed by an equals sign (=), followed name of the private URL pattern
3957
- # that it maps to. The middleware performs a simple substitution on the
3958
- # resulting path.
3959
- #
3960
- # See Also: https://www.nginx.com/resources/wiki/start/topics/examples/xsendfile
3961
- #
3962
- # === lighttpd
3963
- #
3964
- # Lighttpd has supported some variation of the x-sendfile header for some
3965
- # time, although only recent version support x-sendfile in a reverse proxy
3966
- # configuration.
3967
- #
3968
- # $HTTP["host"] == "example.com" {
3969
- # proxy-core.protocol = "http"
3970
- # proxy-core.balancer = "round-robin"
3971
- # proxy-core.backends = (
3972
- # "127.0.0.1:8000",
3973
- # "127.0.0.1:8001",
3974
- # ...
3975
- # )
3976
- #
3977
- # proxy-core.allow-x-sendfile = "enable"
3978
- # proxy-core.rewrite-request = (
3979
- # "x-sendfile-type" => (".*" => "x-sendfile")
3980
- # )
3981
- # }
3982
- #
3983
- # See Also: http://redmine.lighttpd.net/wiki/lighttpd/Docs:ModProxyCore
3984
- #
3985
- # === Apache
3986
- #
3987
- # x-sendfile is supported under Apache 2.x using a separate module:
3988
- #
3989
- # https://tn123.org/mod_xsendfile/
3990
- #
3991
- # Once the module is compiled and installed, you can enable it using
3992
- # XSendFile config directive:
3993
- #
3994
- # RequestHeader Set x-sendfile-type x-sendfile
3995
- # ProxyPassReverse / http://localhost:8001/
3996
- # XSendFile on
3997
- #
3998
- # === Mapping parameter
3999
- #
4000
- # The third parameter allows for an overriding extension of the
4001
- # x-accel-mapping header. Mappings should be provided in tuples of internal to
4002
- # external. The internal values may contain regular expression syntax, they
4003
- # will be matched with case indifference.
4004
- #
4005
- # source://rack//lib/rack/sendfile.rb#104
4006
- class Rack::Sendfile
4007
- # @return [Sendfile] a new instance of Sendfile
4008
- #
4009
- # source://rack//lib/rack/sendfile.rb#105
4010
- def initialize(app, variation = T.unsafe(nil), mappings = T.unsafe(nil)); end
4011
-
4012
- # source://rack//lib/rack/sendfile.rb#113
4013
- def call(env); end
4014
-
4015
- private
4016
-
4017
- # source://rack//lib/rack/sendfile.rb#154
4018
- def map_accel_path(env, path); end
4019
-
4020
- # source://rack//lib/rack/sendfile.rb#148
4021
- def variation(env); end
4022
- end
4023
-
4024
- # Rack::ShowExceptions catches all exceptions raised from the app it
4025
- # wraps. It shows a useful backtrace with the sourcefile and
4026
- # clickable context, the whole Rack environment and the request
4027
- # data.
4028
- #
4029
- # Be careful when you use this on public-facing sites as it could
4030
- # reveal information helpful to attackers.
4031
- #
4032
- # source://rack//lib/rack/show_exceptions.rb#18
4033
- class Rack::ShowExceptions
4034
- # @return [ShowExceptions] a new instance of ShowExceptions
4035
- #
4036
- # source://rack//lib/rack/show_exceptions.rb#26
4037
- def initialize(app); end
4038
-
4039
- # source://rack//lib/rack/show_exceptions.rb#30
4040
- def call(env); end
4041
-
4042
- # source://rack//lib/rack/show_exceptions.rb#65
4043
- def dump_exception(exception); end
4044
-
4045
- # source://rack//lib/rack/show_exceptions.rb#116
4046
- def h(obj); end
4047
-
4048
- # @return [Boolean]
4049
- #
4050
- # source://rack//lib/rack/show_exceptions.rb#56
4051
- def prefers_plaintext?(env); end
4052
-
4053
- # source://rack//lib/rack/show_exceptions.rb#76
4054
- def pretty(env, exception); end
4055
-
4056
- # source://rack//lib/rack/show_exceptions.rb#112
4057
- def template; end
4058
-
4059
- private
4060
-
4061
- # @return [Boolean]
4062
- #
4063
- # source://rack//lib/rack/show_exceptions.rb#60
4064
- def accepts_html?(env); end
4065
- end
4066
-
4067
- # source://rack//lib/rack/show_exceptions.rb#19
4068
- Rack::ShowExceptions::CONTEXT = T.let(T.unsafe(nil), Integer)
4069
-
4070
- # source://rack//lib/rack/show_exceptions.rb#21
4071
- class Rack::ShowExceptions::Frame < ::Struct
4072
- # Returns the value of attribute context_line
4073
- #
4074
- # @return [Object] the current value of context_line
4075
- def context_line; end
4076
-
4077
- # Sets the attribute context_line
4078
- #
4079
- # @param value [Object] the value to set the attribute context_line to.
4080
- # @return [Object] the newly set value
4081
- def context_line=(_); end
4082
-
4083
- # Returns the value of attribute filename
4084
- #
4085
- # @return [Object] the current value of filename
4086
- def filename; end
4087
-
4088
- # Sets the attribute filename
4089
- #
4090
- # @param value [Object] the value to set the attribute filename to.
4091
- # @return [Object] the newly set value
4092
- def filename=(_); end
4093
-
4094
- # Returns the value of attribute function
4095
- #
4096
- # @return [Object] the current value of function
4097
- def function; end
4098
-
4099
- # Sets the attribute function
4100
- #
4101
- # @param value [Object] the value to set the attribute function to.
4102
- # @return [Object] the newly set value
4103
- def function=(_); end
4104
-
4105
- # Returns the value of attribute lineno
4106
- #
4107
- # @return [Object] the current value of lineno
4108
- def lineno; end
4109
-
4110
- # Sets the attribute lineno
4111
- #
4112
- # @param value [Object] the value to set the attribute lineno to.
4113
- # @return [Object] the newly set value
4114
- def lineno=(_); end
4115
-
4116
- # Returns the value of attribute post_context
4117
- #
4118
- # @return [Object] the current value of post_context
4119
- def post_context; end
4120
-
4121
- # Sets the attribute post_context
4122
- #
4123
- # @param value [Object] the value to set the attribute post_context to.
4124
- # @return [Object] the newly set value
4125
- def post_context=(_); end
4126
-
4127
- # Returns the value of attribute post_context_lineno
4128
- #
4129
- # @return [Object] the current value of post_context_lineno
4130
- def post_context_lineno; end
4131
-
4132
- # Sets the attribute post_context_lineno
4133
- #
4134
- # @param value [Object] the value to set the attribute post_context_lineno to.
4135
- # @return [Object] the newly set value
4136
- def post_context_lineno=(_); end
4137
-
4138
- # Returns the value of attribute pre_context
4139
- #
4140
- # @return [Object] the current value of pre_context
4141
- def pre_context; end
4142
-
4143
- # Sets the attribute pre_context
4144
- #
4145
- # @param value [Object] the value to set the attribute pre_context to.
4146
- # @return [Object] the newly set value
4147
- def pre_context=(_); end
4148
-
4149
- # Returns the value of attribute pre_context_lineno
4150
- #
4151
- # @return [Object] the current value of pre_context_lineno
4152
- def pre_context_lineno; end
4153
-
4154
- # Sets the attribute pre_context_lineno
4155
- #
4156
- # @param value [Object] the value to set the attribute pre_context_lineno to.
4157
- # @return [Object] the newly set value
4158
- def pre_context_lineno=(_); end
4159
-
4160
- class << self
4161
- def [](*_arg0); end
4162
- def inspect; end
4163
- def keyword_init?; end
4164
- def members; end
4165
- def new(*_arg0); end
4166
- end
4167
- end
4168
-
4169
- # source://rack//lib/rack/show_exceptions.rb#131
4170
- Rack::ShowExceptions::TEMPLATE = T.let(T.unsafe(nil), ERB)
4171
-
4172
- # Rack::ShowStatus catches all empty responses and replaces them
4173
- # with a site explaining the error.
4174
- #
4175
- # Additional details can be put into <tt>rack.showstatus.detail</tt>
4176
- # and will be shown as HTML. If such details exist, the error page
4177
- # is always rendered, even if the reply was not empty.
4178
- #
4179
- # source://rack//lib/rack/show_status.rb#18
4180
- class Rack::ShowStatus
4181
- # @return [ShowStatus] a new instance of ShowStatus
4182
- #
4183
- # source://rack//lib/rack/show_status.rb#19
4184
- def initialize(app); end
4185
-
4186
- # source://rack//lib/rack/show_status.rb#24
4187
- def call(env); end
4188
-
4189
- # source://rack//lib/rack/show_status.rb#54
4190
- def h(obj); end
4191
- end
4192
-
4193
- # source://rack//lib/rack/show_status.rb#69
4194
- Rack::ShowStatus::TEMPLATE = T.let(T.unsafe(nil), String)
4195
-
4196
- # The Rack::Static middleware intercepts requests for static files
4197
- # (javascript files, images, stylesheets, etc) based on the url prefixes or
4198
- # route mappings passed in the options, and serves them using a Rack::Files
4199
- # object. This allows a Rack stack to serve both static and dynamic content.
4200
- #
4201
- # Examples:
4202
- #
4203
- # Serve all requests beginning with /media from the "media" folder located
4204
- # in the current directory (ie media/*):
4205
- #
4206
- # use Rack::Static, :urls => ["/media"]
4207
- #
4208
- # Same as previous, but instead of returning 404 for missing files under
4209
- # /media, call the next middleware:
4210
- #
4211
- # use Rack::Static, :urls => ["/media"], :cascade => true
4212
- #
4213
- # Serve all requests beginning with /css or /images from the folder "public"
4214
- # in the current directory (ie public/css/* and public/images/*):
4215
- #
4216
- # use Rack::Static, :urls => ["/css", "/images"], :root => "public"
4217
- #
4218
- # Serve all requests to / with "index.html" from the folder "public" in the
4219
- # current directory (ie public/index.html):
4220
- #
4221
- # use Rack::Static, :urls => {"/" => 'index.html'}, :root => 'public'
4222
- #
4223
- # Serve all requests normally from the folder "public" in the current
4224
- # directory but uses index.html as default route for "/"
4225
- #
4226
- # use Rack::Static, :urls => [""], :root => 'public', :index =>
4227
- # 'index.html'
4228
- #
4229
- # Set custom HTTP Headers for based on rules:
4230
- #
4231
- # use Rack::Static, :root => 'public',
4232
- # :header_rules => [
4233
- # [rule, {header_field => content, header_field => content}],
4234
- # [rule, {header_field => content}]
4235
- # ]
4236
- #
4237
- # Rules for selecting files:
4238
- #
4239
- # 1) All files
4240
- # Provide the :all symbol
4241
- # :all => Matches every file
4242
- #
4243
- # 2) Folders
4244
- # Provide the folder path as a string
4245
- # '/folder' or '/folder/subfolder' => Matches files in a certain folder
4246
- #
4247
- # 3) File Extensions
4248
- # Provide the file extensions as an array
4249
- # ['css', 'js'] or %w(css js) => Matches files ending in .css or .js
4250
- #
4251
- # 4) Regular Expressions / Regexp
4252
- # Provide a regular expression
4253
- # %r{\.(?:css|js)\z} => Matches files ending in .css or .js
4254
- # /\.(?:eot|ttf|otf|woff2|woff|svg)\z/ => Matches files ending in
4255
- # the most common web font formats (.eot, .ttf, .otf, .woff2, .woff, .svg)
4256
- # Note: This Regexp is available as a shortcut, using the :fonts rule
4257
- #
4258
- # 5) Font Shortcut
4259
- # Provide the :fonts symbol
4260
- # :fonts => Uses the Regexp rule stated right above to match all common web font endings
4261
- #
4262
- # Rule Ordering:
4263
- # Rules are applied in the order that they are provided.
4264
- # List rather general rules above special ones.
4265
- #
4266
- # Complete example use case including HTTP header rules:
4267
- #
4268
- # use Rack::Static, :root => 'public',
4269
- # :header_rules => [
4270
- # # Cache all static files in public caches (e.g. Rack::Cache)
4271
- # # as well as in the browser
4272
- # [:all, {'cache-control' => 'public, max-age=31536000'}],
4273
- #
4274
- # # Provide web fonts with cross-origin access-control-headers
4275
- # # Firefox requires this when serving assets using a Content Delivery Network
4276
- # [:fonts, {'access-control-allow-origin' => '*'}]
4277
- # ]
4278
- #
4279
- # source://rack//lib/rack/static.rb#92
4280
- class Rack::Static
4281
- # @return [Static] a new instance of Static
4282
- #
4283
- # source://rack//lib/rack/static.rb#93
4284
- def initialize(app, options = T.unsafe(nil)); end
4285
-
4286
- # @return [Boolean]
4287
- #
4288
- # source://rack//lib/rack/static.rb#109
4289
- def add_index_root?(path); end
4290
-
4291
- # Convert HTTP header rules to HTTP headers
4292
- #
4293
- # source://rack//lib/rack/static.rb#166
4294
- def applicable_rules(path); end
4295
-
4296
- # source://rack//lib/rack/static.rb#125
4297
- def call(env); end
4298
-
4299
- # source://rack//lib/rack/static.rb#121
4300
- def can_serve(path); end
4301
-
4302
- # source://rack//lib/rack/static.rb#113
4303
- def overwrite_file_path(path); end
4304
-
4305
- # source://rack//lib/rack/static.rb#117
4306
- def route_file(path); end
4307
- end
4308
-
4309
- # source://rack//lib/rack/constants.rb#38
4310
- Rack::TRACE = T.let(T.unsafe(nil), String)
4311
-
4312
- # source://rack//lib/rack/constants.rb#25
4313
- Rack::TRANSFER_ENCODING = T.let(T.unsafe(nil), String)
4314
-
4315
- # Middleware tracks and cleans Tempfiles created throughout a request (i.e. Rack::Multipart)
4316
- # Ideas/strategy based on posts by Eric Wong and Charles Oliver Nutter
4317
- # https://groups.google.com/forum/#!searchin/rack-devel/temp/rack-devel/brK8eh-MByw/sw61oJJCGRMJ
4318
- #
4319
- # source://rack//lib/rack/tempfile_reaper.rb#11
4320
- class Rack::TempfileReaper
4321
- # @return [TempfileReaper] a new instance of TempfileReaper
4322
- #
4323
- # source://rack//lib/rack/tempfile_reaper.rb#12
4324
- def initialize(app); end
4325
-
4326
- # source://rack//lib/rack/tempfile_reaper.rb#16
4327
- def call(env); end
4328
- end
4329
-
4330
- # source://rack//lib/rack/constants.rb#37
4331
- Rack::UNLINK = T.let(T.unsafe(nil), String)
4332
-
4333
- # Rack::URLMap takes a hash mapping urls or paths to apps, and
4334
- # dispatches accordingly. Support for HTTP/1.1 host names exists if
4335
- # the URLs start with <tt>http://</tt> or <tt>https://</tt>.
4336
- #
4337
- # URLMap modifies the SCRIPT_NAME and PATH_INFO such that the part
4338
- # relevant for dispatch is in the SCRIPT_NAME, and the rest in the
4339
- # PATH_INFO. This should be taken care of when you need to
4340
- # reconstruct the URL in order to create links.
4341
- #
4342
- # URLMap dispatches in such a way that the longest paths are tried
4343
- # first, since they are most specific.
4344
- #
4345
- # source://rack//lib/rack/urlmap.rb#20
4346
- class Rack::URLMap
4347
- # @return [URLMap] a new instance of URLMap
4348
- #
4349
- # source://rack//lib/rack/urlmap.rb#21
4350
- def initialize(map = T.unsafe(nil)); end
4351
-
4352
- # source://rack//lib/rack/urlmap.rb#48
4353
- def call(env); end
4354
-
4355
- # source://rack//lib/rack/urlmap.rb#25
4356
- def remap(map); end
4357
-
4358
- private
4359
-
4360
- # @return [Boolean]
4361
- #
4362
- # source://rack//lib/rack/urlmap.rb#87
4363
- def casecmp?(v1, v2); end
4364
- end
4365
-
4366
- # Rack::Utils contains a grab-bag of useful methods for writing web
4367
- # applications adopted from all kinds of Ruby libraries.
4368
- #
4369
- # source://rack//lib/rack/utils.rb#20
4370
- module Rack::Utils
4371
- private
4372
-
4373
- # Return best accept value to use, based on the algorithm
4374
- # in RFC 2616 Section 14. If there are multiple best
4375
- # matches (same specificity and quality), the value returned
4376
- # is arbitrary.
4377
- #
4378
- # source://rack//lib/rack/utils.rb#167
4379
- def best_q_match(q_value_header, available_mimes); end
4380
-
4381
- # source://rack//lib/rack/utils.rb#120
4382
- def build_nested_query(value, prefix = T.unsafe(nil)); end
4383
-
4384
- # source://rack//lib/rack/utils.rb#110
4385
- def build_query(params); end
4386
-
4387
- # Parses the "Range:" header, if present, into an array of Range objects.
4388
- # Returns nil if the header is missing or syntactically invalid.
4389
- # Returns an empty array if none of the ranges are satisfiable.
4390
- #
4391
- # source://rack//lib/rack/utils.rb#409
4392
- def byte_ranges(env, size); end
4393
-
4394
- # source://rack//lib/rack/utils.rb#609
4395
- def clean_path_info(path_info); end
4396
-
4397
- # :nocov:
4398
- #
4399
- # source://rack//lib/rack/utils.rb#91
4400
- def clock_time; end
4401
-
4402
- # source://rack//lib/rack/utils.rb#367
4403
- def delete_cookie_header!(headers, key, value = T.unsafe(nil)); end
4404
-
4405
- # :call-seq:
4406
- # delete_set_cookie_header(key, value = {}) -> encoded string
4407
- #
4408
- # Generate an encoded string based on the given +key+ and +value+ using
4409
- # set_cookie_header for the purpose of causing the specified cookie to be
4410
- # deleted. The +value+ may be an instance of +Hash+ and can include
4411
- # attributes as outlined by set_cookie_header. The encoded cookie will have
4412
- # a +max_age+ of 0 seconds, an +expires+ date in the past and an empty
4413
- # +value+. When used with the +set-cookie+ header, it will cause the client
4414
- # to *remove* any matching cookie.
4415
- #
4416
- # delete_set_cookie_header("myname")
4417
- # # => "myname=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"
4418
- #
4419
- # source://rack//lib/rack/utils.rb#363
4420
- def delete_set_cookie_header(key, value = T.unsafe(nil)); end
4421
-
4422
- # :call-seq:
4423
- # delete_set_cookie_header!(header, key, value = {}) -> header value
4424
- #
4425
- # Set an expired cookie in the specified headers with the given cookie
4426
- # +key+ and +value+ using delete_set_cookie_header. This causes
4427
- # the client to immediately delete the specified cookie.
4428
- #
4429
- # delete_set_cookie_header!(nil, "mycookie")
4430
- # # => "mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"
4431
- #
4432
- # If the header is non-nil, it will be modified in place.
4433
- #
4434
- # header = []
4435
- # delete_set_cookie_header!(header, "mycookie")
4436
- # # => ["mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"]
4437
- # header
4438
- # # => ["mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"]
4439
- #
4440
- # source://rack//lib/rack/utils.rb#391
4441
- def delete_set_cookie_header!(header, key, value = T.unsafe(nil)); end
4442
-
4443
- # URI escapes. (CGI style space to +)
4444
- #
4445
- # source://rack//lib/rack/utils.rb#40
4446
- def escape(s); end
4447
-
4448
- # source://rack//lib/rack/utils.rb#262
4449
- def escape_cookie_key(key); end
4450
-
4451
- # Escape ampersands, brackets and quotes to their HTML/XML entities.
4452
- def escape_html(_arg0); end
4453
-
4454
- # Like URI escaping, but with %20 instead of +. Strictly speaking this is
4455
- # true URI escaping.
4456
- #
4457
- # source://rack//lib/rack/utils.rb#46
4458
- def escape_path(s); end
4459
-
4460
- # source://rack//lib/rack/utils.rb#149
4461
- def forwarded_values(forwarded_header); end
4462
-
4463
- # source://rack//lib/rack/utils.rb#413
4464
- def get_byte_ranges(http_range, size); end
4465
-
4466
- # :call-seq:
4467
- # parse_cookies(env) -> hash
4468
- #
4469
- # Parse cookies from the provided request environment using
4470
- # parse_cookies_header. Returns a map of cookie +key+ to cookie +value+.
4471
- #
4472
- # parse_cookies({'HTTP_COOKIE' => 'myname=myvalue'})
4473
- # # => {'myname' => 'myvalue'}
4474
- #
4475
- # source://rack//lib/rack/utils.rb#253
4476
- def parse_cookies(env); end
4477
-
4478
- # :call-seq:
4479
- # parse_cookies_header(value) -> hash
4480
- #
4481
- # Parse cookies from the provided header +value+ according to RFC6265. The
4482
- # syntax for cookie headers only supports semicolons. Returns a map of
4483
- # cookie +key+ to cookie +value+.
4484
- #
4485
- # parse_cookies_header('myname=myvalue; max-age=0')
4486
- # # => {"myname"=>"myvalue", "max-age"=>"0"}
4487
- #
4488
- # source://rack//lib/rack/utils.rb#234
4489
- def parse_cookies_header(value); end
4490
-
4491
- # source://rack//lib/rack/utils.rb#106
4492
- def parse_nested_query(qs, d = T.unsafe(nil)); end
4493
-
4494
- # source://rack//lib/rack/utils.rb#102
4495
- def parse_query(qs, d = T.unsafe(nil), &unescaper); end
4496
-
4497
- # source://rack//lib/rack/utils.rb#138
4498
- def q_values(q_value_header); end
4499
-
4500
- # source://rack//lib/rack/utils.rb#402
4501
- def rfc2822(time); end
4502
-
4503
- # :nocov:
4504
- #
4505
- # source://rack//lib/rack/utils.rb#455
4506
- def secure_compare(a, b); end
4507
-
4508
- # source://rack//lib/rack/utils.rb#192
4509
- def select_best_encoding(available_encodings, accept_encoding); end
4510
-
4511
- # :call-seq:
4512
- # set_cookie_header(key, value) -> encoded string
4513
- #
4514
- # Generate an encoded string using the provided +key+ and +value+ suitable
4515
- # for the +set-cookie+ header according to RFC6265. The +value+ may be an
4516
- # instance of either +String+ or +Hash+.
4517
- #
4518
- # If the cookie +value+ is an instance of +Hash+, it considers the following
4519
- # cookie attribute keys: +domain+, +max_age+, +expires+ (must be instance
4520
- # of +Time+), +secure+, +http_only+, +same_site+ and +value+. For more
4521
- # details about the interpretation of these fields, consult
4522
- # [RFC6265 Section 5.2](https://datatracker.ietf.org/doc/html/rfc6265#section-5.2).
4523
- #
4524
- # An extra cookie attribute +escape_key+ can be provided to control whether
4525
- # or not the cookie key is URL encoded. If explicitly set to +false+, the
4526
- # cookie key name will not be url encoded (escaped). The default is +true+.
4527
- #
4528
- # set_cookie_header("myname", "myvalue")
4529
- # # => "myname=myvalue"
4530
- #
4531
- # set_cookie_header("myname", {value: "myvalue", max_age: 10})
4532
- # # => "myname=myvalue; max-age=10"
4533
- #
4534
- # source://rack//lib/rack/utils.rb#294
4535
- def set_cookie_header(key, value); end
4536
-
4537
- # :call-seq:
4538
- # set_cookie_header!(headers, key, value) -> header value
4539
- #
4540
- # Append a cookie in the specified headers with the given cookie +key+ and
4541
- # +value+ using set_cookie_header.
4542
- #
4543
- # If the headers already contains a +set-cookie+ key, it will be converted
4544
- # to an +Array+ if not already, and appended to.
4545
- #
4546
- # source://rack//lib/rack/utils.rb#337
4547
- def set_cookie_header!(headers, key, value); end
4548
-
4549
- # source://rack//lib/rack/utils.rb#589
4550
- def status_code(status); end
4551
-
4552
- # Unescapes a URI escaped string with +encoding+. +encoding+ will be the
4553
- # target encoding of the string returned, and it defaults to UTF-8
4554
- #
4555
- # source://rack//lib/rack/utils.rb#58
4556
- def unescape(s, encoding = T.unsafe(nil)); end
4557
-
4558
- # Unescapes the **path** component of a URI. See Rack::Utils.unescape for
4559
- # unescaping query parameters or form components.
4560
- #
4561
- # source://rack//lib/rack/utils.rb#52
4562
- def unescape_path(s); end
4563
-
4564
- # source://rack//lib/rack/utils.rb#626
4565
- def valid_path?(path); end
4566
-
4567
- class << self
4568
- # Return best accept value to use, based on the algorithm
4569
- # in RFC 2616 Section 14. If there are multiple best
4570
- # matches (same specificity and quality), the value returned
4571
- # is arbitrary.
4572
- #
4573
- # source://rack//lib/rack/utils.rb#167
4574
- def best_q_match(q_value_header, available_mimes); end
4575
-
4576
- # source://rack//lib/rack/utils.rb#120
4577
- def build_nested_query(value, prefix = T.unsafe(nil)); end
4578
-
4579
- # source://rack//lib/rack/utils.rb#110
4580
- def build_query(params); end
4581
-
4582
- # Parses the "Range:" header, if present, into an array of Range objects.
4583
- # Returns nil if the header is missing or syntactically invalid.
4584
- # Returns an empty array if none of the ranges are satisfiable.
4585
- #
4586
- # source://rack//lib/rack/utils.rb#409
4587
- def byte_ranges(env, size); end
4588
-
4589
- # source://rack//lib/rack/utils.rb#609
4590
- def clean_path_info(path_info); end
4591
-
4592
- # source://rack//lib/rack/utils.rb#91
4593
- def clock_time; end
4594
-
4595
- # Returns the value of attribute default_query_parser.
4596
- #
4597
- # source://rack//lib/rack/utils.rb#30
4598
- def default_query_parser; end
4599
-
4600
- # Sets the attribute default_query_parser
4601
- #
4602
- # @param value the value to set the attribute default_query_parser to.
4603
- #
4604
- # source://rack//lib/rack/utils.rb#30
4605
- def default_query_parser=(_arg0); end
4606
-
4607
- # source://rack//lib/rack/utils.rb#367
4608
- def delete_cookie_header!(headers, key, value = T.unsafe(nil)); end
4609
-
4610
- # :call-seq:
4611
- # delete_set_cookie_header(key, value = {}) -> encoded string
4612
- #
4613
- # Generate an encoded string based on the given +key+ and +value+ using
4614
- # set_cookie_header for the purpose of causing the specified cookie to be
4615
- # deleted. The +value+ may be an instance of +Hash+ and can include
4616
- # attributes as outlined by set_cookie_header. The encoded cookie will have
4617
- # a +max_age+ of 0 seconds, an +expires+ date in the past and an empty
4618
- # +value+. When used with the +set-cookie+ header, it will cause the client
4619
- # to *remove* any matching cookie.
4620
- #
4621
- # delete_set_cookie_header("myname")
4622
- # # => "myname=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"
4623
- #
4624
- # source://rack//lib/rack/utils.rb#363
4625
- def delete_set_cookie_header(key, value = T.unsafe(nil)); end
4626
-
4627
- # :call-seq:
4628
- # delete_set_cookie_header!(header, key, value = {}) -> header value
4629
- #
4630
- # Set an expired cookie in the specified headers with the given cookie
4631
- # +key+ and +value+ using delete_set_cookie_header. This causes
4632
- # the client to immediately delete the specified cookie.
4633
- #
4634
- # delete_set_cookie_header!(nil, "mycookie")
4635
- # # => "mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"
4636
- #
4637
- # If the header is non-nil, it will be modified in place.
4638
- #
4639
- # header = []
4640
- # delete_set_cookie_header!(header, "mycookie")
4641
- # # => ["mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"]
4642
- # header
4643
- # # => ["mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"]
4644
- #
4645
- # source://rack//lib/rack/utils.rb#391
4646
- def delete_set_cookie_header!(header, key, value = T.unsafe(nil)); end
4647
-
4648
- # URI escapes. (CGI style space to +)
4649
- #
4650
- # source://rack//lib/rack/utils.rb#40
4651
- def escape(s); end
4652
-
4653
- # source://rack//lib/rack/utils.rb#262
4654
- def escape_cookie_key(key); end
4655
-
4656
- def escape_html(_arg0); end
4657
-
4658
- # Like URI escaping, but with %20 instead of +. Strictly speaking this is
4659
- # true URI escaping.
4660
- #
4661
- # source://rack//lib/rack/utils.rb#46
4662
- def escape_path(s); end
4663
-
4664
- # source://rack//lib/rack/utils.rb#149
4665
- def forwarded_values(forwarded_header); end
4666
-
4667
- # source://rack//lib/rack/utils.rb#413
4668
- def get_byte_ranges(http_range, size); end
4669
-
4670
- # Returns the value of attribute multipart_file_limit.
4671
- #
4672
- # source://rack//lib/rack/utils.rb#65
4673
- def multipart_file_limit; end
4674
-
4675
- # Sets the attribute multipart_file_limit
4676
- #
4677
- # @param value the value to set the attribute multipart_file_limit to.
4678
- #
4679
- # source://rack//lib/rack/utils.rb#65
4680
- def multipart_file_limit=(_arg0); end
4681
-
4682
- # Returns the value of attribute multipart_file_limit.
4683
- # multipart_part_limit is the original name of multipart_file_limit, but
4684
- # the limit only counts parts with filenames.
4685
- #
4686
- # source://rack//lib/rack/utils.rb#65
4687
- def multipart_part_limit; end
4688
-
4689
- # Sets the attribute multipart_file_limit
4690
- #
4691
- # @param value the value to set the attribute multipart_file_limit to.
4692
- #
4693
- # source://rack//lib/rack/utils.rb#65
4694
- def multipart_part_limit=(_arg0); end
4695
-
4696
- # Returns the value of attribute multipart_total_part_limit.
4697
- #
4698
- # source://rack//lib/rack/utils.rb#63
4699
- def multipart_total_part_limit; end
4700
-
4701
- # Sets the attribute multipart_total_part_limit
4702
- #
4703
- # @param value the value to set the attribute multipart_total_part_limit to.
4704
- #
4705
- # source://rack//lib/rack/utils.rb#63
4706
- def multipart_total_part_limit=(_arg0); end
4707
-
4708
- # source://rack//lib/rack/utils.rb#82
4709
- def param_depth_limit; end
4710
-
4711
- # source://rack//lib/rack/utils.rb#86
4712
- def param_depth_limit=(v); end
4713
-
4714
- # :call-seq:
4715
- # parse_cookies(env) -> hash
4716
- #
4717
- # Parse cookies from the provided request environment using
4718
- # parse_cookies_header. Returns a map of cookie +key+ to cookie +value+.
4719
- #
4720
- # parse_cookies({'HTTP_COOKIE' => 'myname=myvalue'})
4721
- # # => {'myname' => 'myvalue'}
4722
- #
4723
- # source://rack//lib/rack/utils.rb#253
4724
- def parse_cookies(env); end
4725
-
4726
- # :call-seq:
4727
- # parse_cookies_header(value) -> hash
4728
- #
4729
- # Parse cookies from the provided header +value+ according to RFC6265. The
4730
- # syntax for cookie headers only supports semicolons. Returns a map of
4731
- # cookie +key+ to cookie +value+.
4732
- #
4733
- # parse_cookies_header('myname=myvalue; max-age=0')
4734
- # # => {"myname"=>"myvalue", "max-age"=>"0"}
4735
- #
4736
- # source://rack//lib/rack/utils.rb#234
4737
- def parse_cookies_header(value); end
4738
-
4739
- # source://rack//lib/rack/utils.rb#106
4740
- def parse_nested_query(qs, d = T.unsafe(nil)); end
4741
-
4742
- # source://rack//lib/rack/utils.rb#102
4743
- def parse_query(qs, d = T.unsafe(nil), &unescaper); end
4744
-
4745
- # source://rack//lib/rack/utils.rb#138
4746
- def q_values(q_value_header); end
4747
-
4748
- # source://rack//lib/rack/utils.rb#402
4749
- def rfc2822(time); end
4750
-
4751
- # source://rack//lib/rack/utils.rb#455
4752
- def secure_compare(a, b); end
4753
-
4754
- # source://rack//lib/rack/utils.rb#192
4755
- def select_best_encoding(available_encodings, accept_encoding); end
4756
-
4757
- # :call-seq:
4758
- # set_cookie_header(key, value) -> encoded string
4759
- #
4760
- # Generate an encoded string using the provided +key+ and +value+ suitable
4761
- # for the +set-cookie+ header according to RFC6265. The +value+ may be an
4762
- # instance of either +String+ or +Hash+.
4763
- #
4764
- # If the cookie +value+ is an instance of +Hash+, it considers the following
4765
- # cookie attribute keys: +domain+, +max_age+, +expires+ (must be instance
4766
- # of +Time+), +secure+, +http_only+, +same_site+ and +value+. For more
4767
- # details about the interpretation of these fields, consult
4768
- # [RFC6265 Section 5.2](https://datatracker.ietf.org/doc/html/rfc6265#section-5.2).
4769
- #
4770
- # An extra cookie attribute +escape_key+ can be provided to control whether
4771
- # or not the cookie key is URL encoded. If explicitly set to +false+, the
4772
- # cookie key name will not be url encoded (escaped). The default is +true+.
4773
- #
4774
- # set_cookie_header("myname", "myvalue")
4775
- # # => "myname=myvalue"
4776
- #
4777
- # set_cookie_header("myname", {value: "myvalue", max_age: 10})
4778
- # # => "myname=myvalue; max-age=10"
4779
- #
4780
- # source://rack//lib/rack/utils.rb#294
4781
- def set_cookie_header(key, value); end
4782
-
4783
- # :call-seq:
4784
- # set_cookie_header!(headers, key, value) -> header value
4785
- #
4786
- # Append a cookie in the specified headers with the given cookie +key+ and
4787
- # +value+ using set_cookie_header.
4788
- #
4789
- # If the headers already contains a +set-cookie+ key, it will be converted
4790
- # to an +Array+ if not already, and appended to.
4791
- #
4792
- # source://rack//lib/rack/utils.rb#337
4793
- def set_cookie_header!(headers, key, value); end
4794
-
4795
- # source://rack//lib/rack/utils.rb#589
4796
- def status_code(status); end
4797
-
4798
- # Unescapes a URI escaped string with +encoding+. +encoding+ will be the
4799
- # target encoding of the string returned, and it defaults to UTF-8
4800
- #
4801
- # source://rack//lib/rack/utils.rb#58
4802
- def unescape(s, encoding = T.unsafe(nil)); end
4803
-
4804
- # Unescapes the **path** component of a URI. See Rack::Utils.unescape for
4805
- # unescaping query parameters or form components.
4806
- #
4807
- # source://rack//lib/rack/utils.rb#52
4808
- def unescape_path(s); end
4809
-
4810
- # @return [Boolean]
4811
- #
4812
- # source://rack//lib/rack/utils.rb#626
4813
- def valid_path?(path); end
4814
- end
4815
- end
4816
-
4817
- # source://rack//lib/rack/utils.rb#25
4818
- Rack::Utils::COMMON_SEP = T.let(T.unsafe(nil), Hash)
4819
-
4820
- # Context allows the use of a compatible middleware at different points
4821
- # in a request handling stack. A compatible middleware must define
4822
- # #context which should take the arguments env and app. The first of which
4823
- # would be the request environment. The second of which would be the rack
4824
- # application that the request would be forwarded to.
4825
- #
4826
- # source://rack//lib/rack/utils.rb#478
4827
- class Rack::Utils::Context
4828
- # @return [Context] a new instance of Context
4829
- #
4830
- # source://rack//lib/rack/utils.rb#481
4831
- def initialize(app_f, app_r); end
4832
-
4833
- # Returns the value of attribute app.
4834
- #
4835
- # source://rack//lib/rack/utils.rb#479
4836
- def app; end
4837
-
4838
- # source://rack//lib/rack/utils.rb#486
4839
- def call(env); end
4840
-
4841
- # source://rack//lib/rack/utils.rb#494
4842
- def context(env, app = T.unsafe(nil)); end
4843
-
4844
- # Returns the value of attribute for.
4845
- #
4846
- # source://rack//lib/rack/utils.rb#479
4847
- def for; end
4848
-
4849
- # source://rack//lib/rack/utils.rb#490
4850
- def recontext(app); end
4851
- end
4852
-
4853
- # source://rack//lib/rack/utils.rb#24
4854
- Rack::Utils::DEFAULT_SEP = T.let(T.unsafe(nil), Regexp)
4855
-
4856
- # Every standard HTTP code mapped to the appropriate message.
4857
- # Generated with:
4858
- # curl -s https://www.iana.org/assignments/http-status-codes/http-status-codes-1.csv \
4859
- # | ruby -rcsv -e "puts CSV.parse(STDIN, headers: true) \
4860
- # .reject {|v| v['Description'] == 'Unassigned' or v['Description'].include? '(' } \
4861
- # .map {|v| %Q/#{v['Value']} => '#{v['Description']}'/ }.join(','+?\n)"
4862
- #
4863
- # source://rack//lib/rack/utils.rb#505
4864
- Rack::Utils::HTTP_STATUS_CODES = T.let(T.unsafe(nil), Hash)
4865
-
4866
- # source://rack//lib/rack/utils.rb#22
4867
- Rack::Utils::InvalidParameterError = Rack::QueryParser::InvalidParameterError
4868
-
4869
- # source://rack//lib/rack/utils.rb#26
4870
- Rack::Utils::KeySpaceConstrainedParams = Rack::QueryParser::Params
4871
-
4872
- # source://rack//lib/rack/utils.rb#624
4873
- Rack::Utils::NULL_BYTE = T.let(T.unsafe(nil), String)
4874
-
4875
- # source://rack//lib/rack/utils.rb#575
4876
- Rack::Utils::OBSOLETE_SYMBOLS_TO_STATUS_CODES = T.let(T.unsafe(nil), Hash)
4877
-
4878
- # source://rack//lib/rack/utils.rb#583
4879
- Rack::Utils::OBSOLETE_SYMBOL_MAPPINGS = T.let(T.unsafe(nil), Hash)
4880
-
4881
- # source://rack//lib/rack/utils.rb#607
4882
- Rack::Utils::PATH_SEPS = T.let(T.unsafe(nil), Regexp)
4883
-
4884
- # source://rack//lib/rack/utils.rb#21
4885
- Rack::Utils::ParameterTypeError = Rack::QueryParser::ParameterTypeError
4886
-
4887
- # source://rack//lib/rack/utils.rb#23
4888
- Rack::Utils::ParamsTooDeepError = Rack::QueryParser::ParamsTooDeepError
4889
-
4890
- # Responses with HTTP status codes that should not have an entity body
4891
- #
4892
- # source://rack//lib/rack/utils.rb#569
4893
- Rack::Utils::STATUS_WITH_NO_ENTITY_BODY = T.let(T.unsafe(nil), Hash)
4894
-
4895
- # source://rack//lib/rack/utils.rb#571
4896
- Rack::Utils::SYMBOL_TO_STATUS_CODE = T.let(T.unsafe(nil), Hash)
4897
-
4898
- # source://rack//lib/rack/utils.rb#27
4899
- Rack::Utils::URI_PARSER = T.let(T.unsafe(nil), URI::RFC2396_Parser)
4900
-
4901
- # A valid cookie key according to RFC2616.
4902
- # 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: ( ) < > @ , ; : \ " / [ ] ? = { }.
4903
- #
4904
- # source://rack//lib/rack/utils.rb#259
4905
- Rack::Utils::VALID_COOKIE_KEY = T.let(T.unsafe(nil), Regexp)