rack 2.1.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rack might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +377 -16
- data/CONTRIBUTING.md +144 -0
- data/MIT-LICENSE +1 -1
- data/README.md +328 -0
- data/SPEC.rdoc +365 -0
- data/lib/rack/auth/abstract/handler.rb +3 -1
- data/lib/rack/auth/abstract/request.rb +2 -2
- data/lib/rack/auth/basic.rb +4 -7
- data/lib/rack/bad_request.rb +8 -0
- data/lib/rack/body_proxy.rb +34 -12
- data/lib/rack/builder.rb +162 -59
- data/lib/rack/cascade.rb +24 -10
- data/lib/rack/common_logger.rb +43 -28
- data/lib/rack/conditional_get.rb +30 -25
- data/lib/rack/constants.rb +66 -0
- data/lib/rack/content_length.rb +10 -16
- data/lib/rack/content_type.rb +9 -7
- data/lib/rack/deflater.rb +78 -50
- data/lib/rack/directory.rb +86 -63
- data/lib/rack/etag.rb +14 -22
- data/lib/rack/events.rb +18 -17
- data/lib/rack/files.rb +99 -61
- data/lib/rack/head.rb +8 -9
- data/lib/rack/headers.rb +238 -0
- data/lib/rack/lint.rb +868 -642
- data/lib/rack/lock.rb +2 -6
- data/lib/rack/logger.rb +3 -0
- data/lib/rack/media_type.rb +9 -4
- data/lib/rack/method_override.rb +6 -2
- data/lib/rack/mime.rb +14 -5
- data/lib/rack/mock.rb +1 -253
- data/lib/rack/mock_request.rb +171 -0
- data/lib/rack/mock_response.rb +124 -0
- data/lib/rack/multipart/generator.rb +15 -8
- data/lib/rack/multipart/parser.rb +238 -107
- data/lib/rack/multipart/uploaded_file.rb +17 -7
- data/lib/rack/multipart.rb +54 -42
- data/lib/rack/null_logger.rb +9 -0
- data/lib/rack/query_parser.rb +87 -105
- data/lib/rack/recursive.rb +3 -1
- data/lib/rack/reloader.rb +0 -4
- data/lib/rack/request.rb +366 -135
- data/lib/rack/response.rb +186 -68
- data/lib/rack/rewindable_input.rb +24 -6
- data/lib/rack/runtime.rb +8 -7
- data/lib/rack/sendfile.rb +29 -27
- data/lib/rack/show_exceptions.rb +27 -12
- data/lib/rack/show_status.rb +21 -13
- data/lib/rack/static.rb +19 -12
- data/lib/rack/tempfile_reaper.rb +14 -5
- data/lib/rack/urlmap.rb +5 -6
- data/lib/rack/utils.rb +274 -260
- data/lib/rack/version.rb +21 -0
- data/lib/rack.rb +18 -103
- metadata +25 -52
- data/README.rdoc +0 -262
- data/Rakefile +0 -123
- data/SPEC +0 -263
- data/bin/rackup +0 -5
- data/contrib/rack.png +0 -0
- data/contrib/rack.svg +0 -150
- data/contrib/rack_logo.svg +0 -164
- data/contrib/rdoc.css +0 -412
- data/example/lobster.ru +0 -6
- data/example/protectedlobster.rb +0 -16
- data/example/protectedlobster.ru +0 -10
- data/lib/rack/auth/digest/md5.rb +0 -131
- data/lib/rack/auth/digest/nonce.rb +0 -54
- data/lib/rack/auth/digest/params.rb +0 -54
- data/lib/rack/auth/digest/request.rb +0 -43
- data/lib/rack/chunked.rb +0 -92
- data/lib/rack/core_ext/regexp.rb +0 -14
- data/lib/rack/file.rb +0 -8
- data/lib/rack/handler/cgi.rb +0 -62
- data/lib/rack/handler/fastcgi.rb +0 -102
- data/lib/rack/handler/lsws.rb +0 -63
- data/lib/rack/handler/scgi.rb +0 -73
- data/lib/rack/handler/thin.rb +0 -38
- data/lib/rack/handler/webrick.rb +0 -122
- data/lib/rack/handler.rb +0 -104
- data/lib/rack/lobster.rb +0 -72
- data/lib/rack/server.rb +0 -467
- data/lib/rack/session/abstract/id.rb +0 -528
- data/lib/rack/session/cookie.rb +0 -205
- data/lib/rack/session/memcache.rb +0 -10
- data/lib/rack/session/pool.rb +0 -85
- data/rack.gemspec +0 -44
data/lib/rack/version.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (C) 2007-2019 Leah Neukirchen <http://leahneukirchen.org/infopage.html>
|
4
|
+
#
|
5
|
+
# Rack is freely distributable under the terms of an MIT-style license.
|
6
|
+
# See MIT-LICENSE or https://opensource.org/licenses/MIT.
|
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
|
+
module Rack
|
15
|
+
RELEASE = "3.1.0"
|
16
|
+
|
17
|
+
# Return the Rack release as a dotted string.
|
18
|
+
def self.release
|
19
|
+
RELEASE
|
20
|
+
end
|
21
|
+
end
|
data/lib/rack.rb
CHANGED
@@ -11,140 +11,55 @@
|
|
11
11
|
# All modules meant for use in your application are <tt>autoload</tt>ed here,
|
12
12
|
# so it should be enough just to <tt>require 'rack'</tt> in your code.
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
VERSION = [1, 3]
|
17
|
-
|
18
|
-
# Return the Rack protocol version as a dotted string.
|
19
|
-
def self.version
|
20
|
-
VERSION.join(".")
|
21
|
-
end
|
22
|
-
|
23
|
-
RELEASE = "2.1.0"
|
24
|
-
|
25
|
-
# Return the Rack release as a dotted string.
|
26
|
-
def self.release
|
27
|
-
RELEASE
|
28
|
-
end
|
29
|
-
|
30
|
-
HTTP_HOST = 'HTTP_HOST'
|
31
|
-
HTTP_VERSION = 'HTTP_VERSION'
|
32
|
-
HTTPS = 'HTTPS'
|
33
|
-
PATH_INFO = 'PATH_INFO'
|
34
|
-
REQUEST_METHOD = 'REQUEST_METHOD'
|
35
|
-
REQUEST_PATH = 'REQUEST_PATH'
|
36
|
-
SCRIPT_NAME = 'SCRIPT_NAME'
|
37
|
-
QUERY_STRING = 'QUERY_STRING'
|
38
|
-
SERVER_PROTOCOL = 'SERVER_PROTOCOL'
|
39
|
-
SERVER_NAME = 'SERVER_NAME'
|
40
|
-
SERVER_ADDR = 'SERVER_ADDR'
|
41
|
-
SERVER_PORT = 'SERVER_PORT'
|
42
|
-
CACHE_CONTROL = 'Cache-Control'
|
43
|
-
CONTENT_LENGTH = 'Content-Length'
|
44
|
-
CONTENT_TYPE = 'Content-Type'
|
45
|
-
SET_COOKIE = 'Set-Cookie'
|
46
|
-
TRANSFER_ENCODING = 'Transfer-Encoding'
|
47
|
-
HTTP_COOKIE = 'HTTP_COOKIE'
|
48
|
-
ETAG = 'ETag'
|
14
|
+
require_relative 'rack/version'
|
15
|
+
require_relative 'rack/constants'
|
49
16
|
|
50
|
-
|
51
|
-
|
52
|
-
POST = 'POST'
|
53
|
-
PUT = 'PUT'
|
54
|
-
PATCH = 'PATCH'
|
55
|
-
DELETE = 'DELETE'
|
56
|
-
HEAD = 'HEAD'
|
57
|
-
OPTIONS = 'OPTIONS'
|
58
|
-
LINK = 'LINK'
|
59
|
-
UNLINK = 'UNLINK'
|
60
|
-
TRACE = 'TRACE'
|
61
|
-
|
62
|
-
# Rack environment variables
|
63
|
-
RACK_VERSION = 'rack.version'
|
64
|
-
RACK_TEMPFILES = 'rack.tempfiles'
|
65
|
-
RACK_ERRORS = 'rack.errors'
|
66
|
-
RACK_LOGGER = 'rack.logger'
|
67
|
-
RACK_INPUT = 'rack.input'
|
68
|
-
RACK_SESSION = 'rack.session'
|
69
|
-
RACK_SESSION_OPTIONS = 'rack.session.options'
|
70
|
-
RACK_SHOWSTATUS_DETAIL = 'rack.showstatus.detail'
|
71
|
-
RACK_MULTITHREAD = 'rack.multithread'
|
72
|
-
RACK_MULTIPROCESS = 'rack.multiprocess'
|
73
|
-
RACK_RUNONCE = 'rack.run_once'
|
74
|
-
RACK_URL_SCHEME = 'rack.url_scheme'
|
75
|
-
RACK_HIJACK = 'rack.hijack'
|
76
|
-
RACK_IS_HIJACK = 'rack.hijack?'
|
77
|
-
RACK_HIJACK_IO = 'rack.hijack_io'
|
78
|
-
RACK_RECURSIVE_INCLUDE = 'rack.recursive.include'
|
79
|
-
RACK_MULTIPART_BUFFER_SIZE = 'rack.multipart.buffer_size'
|
80
|
-
RACK_MULTIPART_TEMPFILE_FACTORY = 'rack.multipart.tempfile_factory'
|
81
|
-
RACK_REQUEST_FORM_INPUT = 'rack.request.form_input'
|
82
|
-
RACK_REQUEST_FORM_HASH = 'rack.request.form_hash'
|
83
|
-
RACK_REQUEST_FORM_VARS = 'rack.request.form_vars'
|
84
|
-
RACK_REQUEST_COOKIE_HASH = 'rack.request.cookie_hash'
|
85
|
-
RACK_REQUEST_COOKIE_STRING = 'rack.request.cookie_string'
|
86
|
-
RACK_REQUEST_QUERY_HASH = 'rack.request.query_hash'
|
87
|
-
RACK_REQUEST_QUERY_STRING = 'rack.request.query_string'
|
88
|
-
RACK_METHODOVERRIDE_ORIGINAL_METHOD = 'rack.methodoverride.original_method'
|
89
|
-
RACK_SESSION_UNPACKED_COOKIE_DATA = 'rack.session.unpacked_cookie_data'
|
90
|
-
|
91
|
-
autoload :Builder, "rack/builder"
|
17
|
+
module Rack
|
18
|
+
autoload :BadRequest, "rack/bad_request"
|
92
19
|
autoload :BodyProxy, "rack/body_proxy"
|
20
|
+
autoload :Builder, "rack/builder"
|
93
21
|
autoload :Cascade, "rack/cascade"
|
94
|
-
autoload :Chunked, "rack/chunked"
|
95
22
|
autoload :CommonLogger, "rack/common_logger"
|
96
23
|
autoload :ConditionalGet, "rack/conditional_get"
|
97
24
|
autoload :Config, "rack/config"
|
98
25
|
autoload :ContentLength, "rack/content_length"
|
99
26
|
autoload :ContentType, "rack/content_type"
|
100
|
-
autoload :ETag, "rack/etag"
|
101
|
-
autoload :File, "rack/file"
|
102
|
-
autoload :Files, "rack/files"
|
103
27
|
autoload :Deflater, "rack/deflater"
|
104
28
|
autoload :Directory, "rack/directory"
|
29
|
+
autoload :ETag, "rack/etag"
|
30
|
+
autoload :Events, "rack/events"
|
31
|
+
autoload :Files, "rack/files"
|
105
32
|
autoload :ForwardRequest, "rack/recursive"
|
106
|
-
autoload :Handler, "rack/handler"
|
107
33
|
autoload :Head, "rack/head"
|
34
|
+
autoload :Headers, "rack/headers"
|
108
35
|
autoload :Lint, "rack/lint"
|
109
36
|
autoload :Lock, "rack/lock"
|
110
37
|
autoload :Logger, "rack/logger"
|
38
|
+
autoload :MediaType, "rack/media_type"
|
111
39
|
autoload :MethodOverride, "rack/method_override"
|
112
40
|
autoload :Mime, "rack/mime"
|
41
|
+
autoload :MockRequest, "rack/mock_request"
|
42
|
+
autoload :MockResponse, "rack/mock_response"
|
43
|
+
autoload :Multipart, "rack/multipart"
|
113
44
|
autoload :NullLogger, "rack/null_logger"
|
45
|
+
autoload :QueryParser, "rack/query_parser"
|
114
46
|
autoload :Recursive, "rack/recursive"
|
115
47
|
autoload :Reloader, "rack/reloader"
|
48
|
+
autoload :Request, "rack/request"
|
49
|
+
autoload :Response, "rack/response"
|
50
|
+
autoload :RewindableInput, "rack/rewindable_input"
|
116
51
|
autoload :Runtime, "rack/runtime"
|
117
52
|
autoload :Sendfile, "rack/sendfile"
|
118
|
-
autoload :Server, "rack/server"
|
119
53
|
autoload :ShowExceptions, "rack/show_exceptions"
|
120
54
|
autoload :ShowStatus, "rack/show_status"
|
121
55
|
autoload :Static, "rack/static"
|
122
56
|
autoload :TempfileReaper, "rack/tempfile_reaper"
|
123
57
|
autoload :URLMap, "rack/urlmap"
|
124
58
|
autoload :Utils, "rack/utils"
|
125
|
-
autoload :Multipart, "rack/multipart"
|
126
|
-
|
127
|
-
autoload :MockRequest, "rack/mock"
|
128
|
-
autoload :MockResponse, "rack/mock"
|
129
|
-
|
130
|
-
autoload :Request, "rack/request"
|
131
|
-
autoload :Response, "rack/response"
|
132
59
|
|
133
60
|
module Auth
|
134
61
|
autoload :Basic, "rack/auth/basic"
|
135
|
-
autoload :AbstractRequest, "rack/auth/abstract/request"
|
136
62
|
autoload :AbstractHandler, "rack/auth/abstract/handler"
|
137
|
-
|
138
|
-
autoload :MD5, "rack/auth/digest/md5"
|
139
|
-
autoload :Nonce, "rack/auth/digest/nonce"
|
140
|
-
autoload :Params, "rack/auth/digest/params"
|
141
|
-
autoload :Request, "rack/auth/digest/request"
|
142
|
-
end
|
143
|
-
end
|
144
|
-
|
145
|
-
module Session
|
146
|
-
autoload :Cookie, "rack/session/cookie"
|
147
|
-
autoload :Pool, "rack/session/pool"
|
148
|
-
autoload :Memcache, "rack/session/memcache"
|
63
|
+
autoload :AbstractRequest, "rack/auth/abstract/request"
|
149
64
|
end
|
150
65
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leah Neukirchen
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '5.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name: minitest-
|
28
|
+
name: minitest-global_expectations
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
@@ -68,73 +68,53 @@ dependencies:
|
|
68
68
|
version: '0'
|
69
69
|
description: |
|
70
70
|
Rack provides a minimal, modular and adaptable interface for developing
|
71
|
-
web applications in Ruby.
|
71
|
+
web applications in Ruby. By wrapping HTTP requests and responses in
|
72
72
|
the simplest way possible, it unifies and distills the API for web
|
73
73
|
servers, web frameworks, and software in between (the so-called
|
74
74
|
middleware) into a single method call.
|
75
|
-
|
76
|
-
Also see https://rack.github.io/.
|
77
75
|
email: leah@vuxu.org
|
78
|
-
executables:
|
79
|
-
- rackup
|
76
|
+
executables: []
|
80
77
|
extensions: []
|
81
78
|
extra_rdoc_files:
|
82
|
-
- README.
|
79
|
+
- README.md
|
83
80
|
- CHANGELOG.md
|
81
|
+
- CONTRIBUTING.md
|
84
82
|
files:
|
85
83
|
- CHANGELOG.md
|
84
|
+
- CONTRIBUTING.md
|
86
85
|
- MIT-LICENSE
|
87
|
-
- README.
|
88
|
-
-
|
89
|
-
- SPEC
|
90
|
-
- bin/rackup
|
91
|
-
- contrib/rack.png
|
92
|
-
- contrib/rack.svg
|
93
|
-
- contrib/rack_logo.svg
|
94
|
-
- contrib/rdoc.css
|
95
|
-
- example/lobster.ru
|
96
|
-
- example/protectedlobster.rb
|
97
|
-
- example/protectedlobster.ru
|
86
|
+
- README.md
|
87
|
+
- SPEC.rdoc
|
98
88
|
- lib/rack.rb
|
99
89
|
- lib/rack/auth/abstract/handler.rb
|
100
90
|
- lib/rack/auth/abstract/request.rb
|
101
91
|
- lib/rack/auth/basic.rb
|
102
|
-
- lib/rack/
|
103
|
-
- lib/rack/auth/digest/nonce.rb
|
104
|
-
- lib/rack/auth/digest/params.rb
|
105
|
-
- lib/rack/auth/digest/request.rb
|
92
|
+
- lib/rack/bad_request.rb
|
106
93
|
- lib/rack/body_proxy.rb
|
107
94
|
- lib/rack/builder.rb
|
108
95
|
- lib/rack/cascade.rb
|
109
|
-
- lib/rack/chunked.rb
|
110
96
|
- lib/rack/common_logger.rb
|
111
97
|
- lib/rack/conditional_get.rb
|
112
98
|
- lib/rack/config.rb
|
99
|
+
- lib/rack/constants.rb
|
113
100
|
- lib/rack/content_length.rb
|
114
101
|
- lib/rack/content_type.rb
|
115
|
-
- lib/rack/core_ext/regexp.rb
|
116
102
|
- lib/rack/deflater.rb
|
117
103
|
- lib/rack/directory.rb
|
118
104
|
- lib/rack/etag.rb
|
119
105
|
- lib/rack/events.rb
|
120
|
-
- lib/rack/file.rb
|
121
106
|
- lib/rack/files.rb
|
122
|
-
- lib/rack/handler.rb
|
123
|
-
- lib/rack/handler/cgi.rb
|
124
|
-
- lib/rack/handler/fastcgi.rb
|
125
|
-
- lib/rack/handler/lsws.rb
|
126
|
-
- lib/rack/handler/scgi.rb
|
127
|
-
- lib/rack/handler/thin.rb
|
128
|
-
- lib/rack/handler/webrick.rb
|
129
107
|
- lib/rack/head.rb
|
108
|
+
- lib/rack/headers.rb
|
130
109
|
- lib/rack/lint.rb
|
131
|
-
- lib/rack/lobster.rb
|
132
110
|
- lib/rack/lock.rb
|
133
111
|
- lib/rack/logger.rb
|
134
112
|
- lib/rack/media_type.rb
|
135
113
|
- lib/rack/method_override.rb
|
136
114
|
- lib/rack/mime.rb
|
137
115
|
- lib/rack/mock.rb
|
116
|
+
- lib/rack/mock_request.rb
|
117
|
+
- lib/rack/mock_response.rb
|
138
118
|
- lib/rack/multipart.rb
|
139
119
|
- lib/rack/multipart/generator.rb
|
140
120
|
- lib/rack/multipart/parser.rb
|
@@ -148,29 +128,22 @@ files:
|
|
148
128
|
- lib/rack/rewindable_input.rb
|
149
129
|
- lib/rack/runtime.rb
|
150
130
|
- lib/rack/sendfile.rb
|
151
|
-
- lib/rack/server.rb
|
152
|
-
- lib/rack/session/abstract/id.rb
|
153
|
-
- lib/rack/session/cookie.rb
|
154
|
-
- lib/rack/session/memcache.rb
|
155
|
-
- lib/rack/session/pool.rb
|
156
131
|
- lib/rack/show_exceptions.rb
|
157
132
|
- lib/rack/show_status.rb
|
158
133
|
- lib/rack/static.rb
|
159
134
|
- lib/rack/tempfile_reaper.rb
|
160
135
|
- lib/rack/urlmap.rb
|
161
136
|
- lib/rack/utils.rb
|
162
|
-
- rack.
|
163
|
-
homepage: https://
|
137
|
+
- lib/rack/version.rb
|
138
|
+
homepage: https://github.com/rack/rack
|
164
139
|
licenses:
|
165
140
|
- MIT
|
166
141
|
metadata:
|
167
142
|
bug_tracker_uri: https://github.com/rack/rack/issues
|
168
|
-
changelog_uri: https://github.com/rack/rack/blob/
|
143
|
+
changelog_uri: https://github.com/rack/rack/blob/main/CHANGELOG.md
|
169
144
|
documentation_uri: https://rubydoc.info/github/rack/rack
|
170
|
-
homepage_uri: https://rack.github.io
|
171
|
-
mailing_list_uri: https://groups.google.com/forum/#!forum/rack-devel
|
172
145
|
source_code_uri: https://github.com/rack/rack
|
173
|
-
post_install_message:
|
146
|
+
post_install_message:
|
174
147
|
rdoc_options: []
|
175
148
|
require_paths:
|
176
149
|
- lib
|
@@ -178,15 +151,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
178
151
|
requirements:
|
179
152
|
- - ">="
|
180
153
|
- !ruby/object:Gem::Version
|
181
|
-
version: 2.
|
154
|
+
version: 2.4.0
|
182
155
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
183
156
|
requirements:
|
184
157
|
- - ">="
|
185
158
|
- !ruby/object:Gem::Version
|
186
159
|
version: '0'
|
187
160
|
requirements: []
|
188
|
-
rubygems_version: 3.
|
189
|
-
signing_key:
|
161
|
+
rubygems_version: 3.5.9
|
162
|
+
signing_key:
|
190
163
|
specification_version: 4
|
191
|
-
summary:
|
164
|
+
summary: A modular Ruby webserver interface.
|
192
165
|
test_files: []
|
data/README.rdoc
DELETED
@@ -1,262 +0,0 @@
|
|
1
|
-
= \Rack, a modular Ruby webserver interface
|
2
|
-
|
3
|
-
{<img src="https://rack.github.io/logo.png" width="400" alt="rack powers web applications" />}[https://rack.github.io/]
|
4
|
-
|
5
|
-
{<img src="https://circleci.com/gh/rack/rack.svg?style=svg" alt="CircleCI" />}[https://circleci.com/gh/rack/rack]
|
6
|
-
{<img src="https://badge.fury.io/rb/rack.svg" alt="Gem Version" />}[http://badge.fury.io/rb/rack]
|
7
|
-
{<img src="https://api.dependabot.com/badges/compatibility_score?dependency-name=rack&package-manager=bundler&version-scheme=semver" alt="SemVer Stability" />}[https://dependabot.com/compatibility-score.html?dependency-name=rack&package-manager=bundler&version-scheme=semver]
|
8
|
-
|
9
|
-
\Rack provides a minimal, modular, and adaptable interface for developing
|
10
|
-
web applications in Ruby. By wrapping HTTP requests and responses in
|
11
|
-
the simplest way possible, it unifies and distills the API for web
|
12
|
-
servers, web frameworks, and software in between (the so-called
|
13
|
-
middleware) into a single method call.
|
14
|
-
|
15
|
-
The exact details of this are described in the \Rack specification,
|
16
|
-
which all \Rack applications should conform to.
|
17
|
-
|
18
|
-
== Supported web servers
|
19
|
-
|
20
|
-
The included *handlers* connect all kinds of web servers to \Rack:
|
21
|
-
|
22
|
-
* WEBrick[https://github.com/ruby/webrick]
|
23
|
-
* FCGI
|
24
|
-
* CGI
|
25
|
-
* SCGI
|
26
|
-
* LiteSpeed[https://www.litespeedtech.com/]
|
27
|
-
* Thin[https://rubygems.org/gems/thin]
|
28
|
-
|
29
|
-
These web servers include \Rack handlers in their distributions:
|
30
|
-
|
31
|
-
* Agoo[https://github.com/ohler55/agoo]
|
32
|
-
* Falcon[https://github.com/socketry/falcon]
|
33
|
-
* {NGINX Unit}[https://unit.nginx.org/]
|
34
|
-
* {Phusion Passenger}[https://www.phusionpassenger.com/] (which is mod_rack for Apache and for nginx)
|
35
|
-
* Puma[https://puma.io/]
|
36
|
-
* Unicorn[https://bogomips.org/unicorn/]
|
37
|
-
* uWSGI[https://uwsgi-docs.readthedocs.io/en/latest/]
|
38
|
-
|
39
|
-
Any valid \Rack app will run the same on all these handlers, without
|
40
|
-
changing anything.
|
41
|
-
|
42
|
-
== Supported web frameworks
|
43
|
-
|
44
|
-
These frameworks include \Rack adapters in their distributions:
|
45
|
-
|
46
|
-
* Camping[http://www.ruby-camping.com/]
|
47
|
-
* Coset[http://leahneukirchen.org/repos/coset/]
|
48
|
-
* Hanami[https://hanamirb.org/]
|
49
|
-
* Padrino[http://padrinorb.com/]
|
50
|
-
* Racktools::SimpleApplication
|
51
|
-
* Ramaze[http://ramaze.net/]
|
52
|
-
* Roda[https://github.com/jeremyevans/roda]
|
53
|
-
* {Ruby on Rails}[https://rubyonrails.org/]
|
54
|
-
* Rum[https://github.com/leahneukirchen/rum]
|
55
|
-
* Sinatra[http://sinatrarb.com/]
|
56
|
-
* Utopia[https://github.com/socketry/utopia]
|
57
|
-
* WABuR[https://github.com/ohler55/wabur]
|
58
|
-
* ... and many others.
|
59
|
-
|
60
|
-
== Available middleware
|
61
|
-
|
62
|
-
Between the server and the framework, \Rack can be customized to your
|
63
|
-
applications needs using middleware, for example:
|
64
|
-
|
65
|
-
* Rack::URLMap, to route to multiple applications inside the same process.
|
66
|
-
* Rack::CommonLogger, for creating Apache-style logfiles.
|
67
|
-
* Rack::ShowException, for catching unhandled exceptions and
|
68
|
-
presenting them in a nice and helpful way with clickable backtrace.
|
69
|
-
* Rack::Files, for serving static files.
|
70
|
-
* ...many others!
|
71
|
-
|
72
|
-
All these components use the same interface, which is described in
|
73
|
-
detail in the \Rack specification. These optional components can be
|
74
|
-
used in any way you wish.
|
75
|
-
|
76
|
-
== Convenience
|
77
|
-
|
78
|
-
If you want to develop outside of existing frameworks, implement your
|
79
|
-
own ones, or develop middleware, \Rack provides many helpers to create
|
80
|
-
\Rack applications quickly and without doing the same web stuff all
|
81
|
-
over:
|
82
|
-
|
83
|
-
* Rack::Request, which also provides query string parsing and
|
84
|
-
multipart handling.
|
85
|
-
* Rack::Response, for convenient generation of HTTP replies and
|
86
|
-
cookie handling.
|
87
|
-
* Rack::MockRequest and Rack::MockResponse for efficient and quick
|
88
|
-
testing of \Rack application without real HTTP round-trips.
|
89
|
-
|
90
|
-
== rack-contrib
|
91
|
-
|
92
|
-
The plethora of useful middleware created the need for a project that
|
93
|
-
collects fresh \Rack middleware. rack-contrib includes a variety of
|
94
|
-
add-on components for \Rack and it is easy to contribute new modules.
|
95
|
-
|
96
|
-
* https://github.com/rack/rack-contrib
|
97
|
-
|
98
|
-
== rackup
|
99
|
-
|
100
|
-
rackup is a useful tool for running \Rack applications, which uses the
|
101
|
-
Rack::Builder DSL to configure middleware and build up applications
|
102
|
-
easily.
|
103
|
-
|
104
|
-
rackup automatically figures out the environment it is run in, and
|
105
|
-
runs your application as FastCGI, CGI, or WEBrick---all from the
|
106
|
-
same configuration.
|
107
|
-
|
108
|
-
== Quick start
|
109
|
-
|
110
|
-
Try the lobster!
|
111
|
-
|
112
|
-
Either with the embedded WEBrick starter:
|
113
|
-
|
114
|
-
ruby -Ilib lib/rack/lobster.rb
|
115
|
-
|
116
|
-
Or with rackup:
|
117
|
-
|
118
|
-
bin/rackup -Ilib example/lobster.ru
|
119
|
-
|
120
|
-
By default, the lobster is found at http://localhost:9292.
|
121
|
-
|
122
|
-
== Installing with RubyGems
|
123
|
-
|
124
|
-
A Gem of \Rack is available at {rubygems.org}[https://rubygems.org/gems/rack]. You can install it with:
|
125
|
-
|
126
|
-
gem install rack
|
127
|
-
|
128
|
-
== Running the tests
|
129
|
-
|
130
|
-
Testing \Rack requires the bacon testing framework:
|
131
|
-
|
132
|
-
bundle install --without extra # to be able to run the fast tests
|
133
|
-
|
134
|
-
Or:
|
135
|
-
|
136
|
-
bundle install # this assumes that you have installed native extensions!
|
137
|
-
|
138
|
-
There is a rake-based test task:
|
139
|
-
|
140
|
-
rake test # tests all the tests
|
141
|
-
|
142
|
-
The testsuite has no dependencies outside of the core Ruby
|
143
|
-
installation and bacon.
|
144
|
-
|
145
|
-
To run the test suite completely, you need:
|
146
|
-
|
147
|
-
* fcgi
|
148
|
-
* dalli
|
149
|
-
* thin
|
150
|
-
|
151
|
-
To test Memcache sessions, you need memcached (will be
|
152
|
-
run on port 11211) and dalli installed.
|
153
|
-
|
154
|
-
== Configuration
|
155
|
-
|
156
|
-
Several parameters can be modified on Rack::Utils to configure \Rack behaviour.
|
157
|
-
|
158
|
-
e.g:
|
159
|
-
|
160
|
-
Rack::Utils.key_space_limit = 128
|
161
|
-
|
162
|
-
=== key_space_limit
|
163
|
-
|
164
|
-
The default number of bytes to allow a single parameter key to take up.
|
165
|
-
This helps prevent a rogue client from flooding a Request.
|
166
|
-
|
167
|
-
Default to 65536 characters (4 kiB in worst case).
|
168
|
-
|
169
|
-
=== multipart_part_limit
|
170
|
-
|
171
|
-
The maximum number of parts a request can contain.
|
172
|
-
Accepting too many part can lead to the server running out of file handles.
|
173
|
-
|
174
|
-
The default is 128, which means that a single request can't upload more than 128 files at once.
|
175
|
-
|
176
|
-
Set to 0 for no limit.
|
177
|
-
|
178
|
-
Can also be set via the +RACK_MULTIPART_PART_LIMIT+ environment variable.
|
179
|
-
|
180
|
-
== Changelog
|
181
|
-
|
182
|
-
See {CHANGELOG.md}[https://github.com/rack/rack/blob/master/CHANGELOG.md].
|
183
|
-
|
184
|
-
== Contact
|
185
|
-
|
186
|
-
Please post bugs, suggestions and patches to
|
187
|
-
the bug tracker at {issues}[https://github.com/rack/rack/issues].
|
188
|
-
|
189
|
-
Please post security related bugs and suggestions to the core team at
|
190
|
-
<https://groups.google.com/forum/#!forum/rack-core> or rack-core@googlegroups.com. This
|
191
|
-
list is not public. Due to wide usage of the library, it is strongly preferred
|
192
|
-
that we manage timing in order to provide viable patches at the time of
|
193
|
-
disclosure. Your assistance in this matter is greatly appreciated.
|
194
|
-
|
195
|
-
Mailing list archives are available at
|
196
|
-
<https://groups.google.com/forum/#!forum/rack-devel>.
|
197
|
-
|
198
|
-
Git repository (send Git patches to the mailing list):
|
199
|
-
|
200
|
-
* https://github.com/rack/rack
|
201
|
-
* http://git.vuxu.org/cgi-bin/gitweb.cgi?p=rack-github.git
|
202
|
-
|
203
|
-
You are also welcome to join the #rack channel on irc.freenode.net.
|
204
|
-
|
205
|
-
== Thanks
|
206
|
-
|
207
|
-
The \Rack Core Team, consisting of
|
208
|
-
|
209
|
-
* Leah Neukirchen (leahneukirchen[https://github.com/leahneukirchen])
|
210
|
-
* James Tucker (raggi[https://github.com/raggi])
|
211
|
-
* Josh Peek (josh[https://github.com/josh])
|
212
|
-
* José Valim (josevalim[https://github.com/josevalim])
|
213
|
-
* Michael Fellinger (manveru[https://github.com/manveru])
|
214
|
-
* Aaron Patterson (tenderlove[https://github.com/tenderlove])
|
215
|
-
* Santiago Pastorino (spastorino[https://github.com/spastorino])
|
216
|
-
* Konstantin Haase (rkh[https://github.com/rkh])
|
217
|
-
|
218
|
-
and the \Rack Alumnis
|
219
|
-
|
220
|
-
* Ryan Tomayko (rtomayko[https://github.com/rtomayko])
|
221
|
-
* Scytrin dai Kinthra (scytrin[https://github.com/scytrin])
|
222
|
-
|
223
|
-
would like to thank:
|
224
|
-
|
225
|
-
* Adrian Madrid, for the LiteSpeed handler.
|
226
|
-
* Christoffer Sawicki, for the first Rails adapter and Rack::Deflater.
|
227
|
-
* Tim Fletcher, for the HTTP authentication code.
|
228
|
-
* Luc Heinrich for the Cookie sessions, the static file handler and bugfixes.
|
229
|
-
* Armin Ronacher, for the logo and racktools.
|
230
|
-
* Alex Beregszaszi, Alexander Kahn, Anil Wadghule, Aredridel, Ben
|
231
|
-
Alpert, Dan Kubb, Daniel Roethlisberger, Matt Todd, Tom Robinson,
|
232
|
-
Phil Hagelberg, S. Brent Faulkner, Bosko Milekic, Daniel Rodríguez
|
233
|
-
Troitiño, Genki Takiuchi, Geoffrey Grosenbach, Julien Sanchez, Kamal
|
234
|
-
Fariz Mahyuddin, Masayoshi Takahashi, Patrick Aljordm, Mig, Kazuhiro
|
235
|
-
Nishiyama, Jon Bardin, Konstantin Haase, Larry Siden, Matias
|
236
|
-
Korhonen, Sam Ruby, Simon Chiang, Tim Connor, Timur Batyrshin, and
|
237
|
-
Zach Brock for bug fixing and other improvements.
|
238
|
-
* Eric Wong, Hongli Lai, Jeremy Kemper for their continuous support
|
239
|
-
and API improvements.
|
240
|
-
* Yehuda Katz and Carl Lerche for refactoring rackup.
|
241
|
-
* Brian Candler, for Rack::ContentType.
|
242
|
-
* Graham Batty, for improved handler loading.
|
243
|
-
* Stephen Bannasch, for bug reports and documentation.
|
244
|
-
* Gary Wright, for proposing a better Rack::Response interface.
|
245
|
-
* Jonathan Buch, for improvements regarding Rack::Response.
|
246
|
-
* Armin Röhrl, for tracking down bugs in the Cookie generator.
|
247
|
-
* Alexander Kellett for testing the Gem and reviewing the announcement.
|
248
|
-
* Marcus Rückert, for help with configuring and debugging lighttpd.
|
249
|
-
* The WSGI team for the well-done and documented work they've done and
|
250
|
-
\Rack builds up on.
|
251
|
-
* All bug reporters and patch contributors not mentioned above.
|
252
|
-
|
253
|
-
== Links
|
254
|
-
|
255
|
-
\Rack:: <https://rack.github.io/>
|
256
|
-
Official \Rack repositories:: <https://github.com/rack>
|
257
|
-
\Rack Bug Tracking:: <https://github.com/rack/rack/issues>
|
258
|
-
rack-devel mailing list:: <https://groups.google.com/forum/#!forum/rack-devel>
|
259
|
-
|
260
|
-
== License
|
261
|
-
|
262
|
-
\Rack is released under the {MIT License}[https://opensource.org/licenses/MIT].
|