rack 3.0.0.beta1 → 3.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rack might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -1
- data/README.md +9 -3
- data/SPEC.rdoc +9 -2
- data/lib/rack/constants.rb +1 -0
- data/lib/rack/lint.rb +20 -5
- data/lib/rack/mock_response.rb +4 -2
- data/lib/rack/version.rb +1 -1
- metadata +6 -14
- data/Rakefile +0 -163
- data/contrib/LICENSE.md +0 -7
- data/contrib/logo.webp +0 -0
- 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/rack.gemspec +0 -46
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05554b16a9e707fa8e767de13d087767607e6e859877943d7a2bb012842e844f
|
4
|
+
data.tar.gz: baf8751ad8fcf5e7483ef04a6da4c8859c6db48bd94c1b85000b024cc7585972
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5162477fbd4fbc89a2529903b1eb53426644c430bc82e1eda48ee9f6d9107cd6e0a4d092c8fab10f27c80a7371ff6f426bcc1dcdf4f7f0df07f6590e30e9b212
|
7
|
+
data.tar.gz: df717015157b4acc8e5b927ea5903ed0a85b3ebdc62987f383411089e964337ab4459eca65b27a8c7e5ed109ae3737853b9bfaf2e3be6a60ea7278e96ca31376
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file. For info on how to format all future additions to this file please reference [Keep A Changelog](https://keepachangelog.com/en/1.0.0/).
|
4
4
|
|
5
|
+
## [3.0.0.rc1] - 2022-09-04
|
6
|
+
|
7
|
+
### SPEC Changes
|
8
|
+
|
9
|
+
- Stream argument must implement `<<` https://github.com/rack/rack/pull/1959
|
10
|
+
- `close` may be called on `rack.input` https://github.com/rack/rack/pull/1956
|
11
|
+
- `rack.response_finished` may be used for executing code after the response has been finished https://github.com/rack/rack/pull/1952
|
12
|
+
|
5
13
|
## [3.0.0.beta1] - 2022-08-08
|
6
14
|
|
7
15
|
### Security
|
@@ -19,9 +27,12 @@ All notable changes to this project will be documented in this file. For info on
|
|
19
27
|
- Middleware must no longer call `#each` on the body, but they can call `#to_ary` on the body if it responds to `#to_ary`.
|
20
28
|
- `rack.input` is no longer required to be rewindable.
|
21
29
|
- `rack.multithread`/`rack.multiprocess`/`rack.run_once`/`rack.version` are no longer required environment keys.
|
22
|
-
- `SERVER_PROTOCOL` is now a required key, matching the HTTP protocol used in the request.
|
30
|
+
- `SERVER_PROTOCOL` is now a required environment key, matching the HTTP protocol used in the request.
|
23
31
|
- `rack.hijack?` (partial hijack) and `rack.hijack` (full hijack) are now independently optional.
|
24
32
|
- `rack.hijack_io` has been removed completely.
|
33
|
+
- `rack.response_finished` is an optional environment key which contains an array of callable objects that must accept `#call(env, status, headers, error)` and are invoked after the response is finished (either successfully or unsucessfully).
|
34
|
+
- It is okay to call `#close` on `rack.input` to indicate that you no longer need or care about the input.
|
35
|
+
- The stream argument supplied to the streaming body and hijack must support `#<<` for writing output.
|
25
36
|
|
26
37
|
### Removed
|
27
38
|
|
@@ -41,6 +52,8 @@ All notable changes to this project will be documented in this file. For info on
|
|
41
52
|
- Allow response headers to contain array of values. ([#1598](https://github.com/rack/rack/issues/1598), [@ioquatix])
|
42
53
|
- Support callable body for explicit streaming support and clarify streaming response body behaviour. ([#1745](https://github.com/rack/rack/pull/1745), [@ioquatix], [#1748](https://github.com/rack/rack/pull/1748), [@wjordan])
|
43
54
|
- Allow `Rack::Builder#run` to take a block instead of an argument. ([#1942](https://github.com/rack/rack/pull/1942), [@ioquatix])
|
55
|
+
- Add `rack.response_finished` to `Rack::Lint`. ([#1802](https://github.com/rack/rack/pull/1802), [@BlakeWilliams], [#1952](https://github.com/rack/rack/pull/1952), [@ioquatix])
|
56
|
+
- The stream argument must implement `#<<`. ([#1959](https://github.com/rack/rack/pull/1959), [@ioquatix])
|
44
57
|
|
45
58
|
### Changed
|
46
59
|
|
@@ -64,6 +77,7 @@ All notable changes to this project will be documented in this file. For info on
|
|
64
77
|
- Use lower case cookie attributes when creating cookies, and fold cookie attributes to lower case when reading cookies (specifically impacting `secure` and `httponly` attributes). ([#1849](https://github.com/rack/rack/pull/1849), [@ioquatix])
|
65
78
|
- The response array must now be mutable (non-frozen) so middleware can modify it without allocating a new Array,therefore reducing object allocations. ([#1887](https://github.com/rack/rack/pull/1887), [#1927](https://github.com/rack/rack/pull/1927), [@amatsuda], [@ioquatix])
|
66
79
|
- `rack.hijack?` (partial hijack) and `rack.hijack` (full hijack) are now independently optional. `rack.hijack_io` is no longer required/specified. ([#1939](https://github.com/rack/rack/pull/1939), [@ioquatix])
|
80
|
+
- Allow calling close on `rack.input`. ([#1956](https://github.com/rack/rack/pull/1956), [@ioquatix])
|
67
81
|
|
68
82
|
### Fixed
|
69
83
|
|
@@ -787,3 +801,4 @@ Items below this line are from the previously maintained HISTORY.md and NEWS.md
|
|
787
801
|
[@jeremyevans]: https://github.com/jeremyevans "Jeremy Evans"
|
788
802
|
[@amatsuda]: https://github.com/amatsuda "Akira Matsuda"
|
789
803
|
[@wjordan]: https://github.com/wjordan "Will Jordan"
|
804
|
+
[@BlakeWilliams]: https://github.com/BlakeWilliams "Blake Williams"
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# ![Rack](contrib/logo.webp)
|
2
2
|
|
3
|
-
> **_NOTE:_** Rack v3.0.
|
3
|
+
> **_NOTE:_** Rack v3.0.0.beta1 was recently released. Please check the [Upgrade
|
4
4
|
> Guide](UPGRADE-GUIDE.md) for more details about migrating your existing
|
5
5
|
> servers, middlewares and applications. For detailed information on specific
|
6
6
|
> changes, check the [Change Log](CHANGELOG.md).
|
@@ -20,10 +20,16 @@ by a [supported web framework](#supported-web-frameworks):
|
|
20
20
|
|
21
21
|
```bash
|
22
22
|
# Install it generally:
|
23
|
-
$ gem install rack
|
23
|
+
$ gem install rack --pre
|
24
24
|
|
25
25
|
# or, add it to your current application gemfile:
|
26
|
-
$ bundle add rack
|
26
|
+
$ bundle add rack --version 3.0.0.beta1
|
27
|
+
```
|
28
|
+
|
29
|
+
If you need features from `Rack::Session` or `bin/rackup` please add those gems separately.
|
30
|
+
|
31
|
+
```bash
|
32
|
+
$ gem install rack-session rackup
|
27
33
|
```
|
28
34
|
|
29
35
|
## Usage
|
data/SPEC.rdoc
CHANGED
@@ -132,6 +132,12 @@ There are the following restrictions:
|
|
132
132
|
set. <tt>PATH_INFO</tt> should be <tt>/</tt> if
|
133
133
|
<tt>SCRIPT_NAME</tt> is empty.
|
134
134
|
<tt>SCRIPT_NAME</tt> never should be <tt>/</tt>, but instead be empty.
|
135
|
+
<tt>rack.response_finished</tt>:: An array of callables run by the server after the response has been
|
136
|
+
processed. This would typically be invoked after sending the response to the client, but it could also be
|
137
|
+
invoked if an error occurs while generating the response or sending the response; in that case, the error
|
138
|
+
argument will be a subclass of +Exception+.
|
139
|
+
The callables are invoked with +env, status, headers, error+ arguments and should not raise any
|
140
|
+
exceptions. They should be invoked in reverse order of registration.
|
135
141
|
|
136
142
|
=== The Input Stream
|
137
143
|
|
@@ -160,7 +166,8 @@ The input stream must respond to +gets+, +each+, and +read+.
|
|
160
166
|
If +buffer+ is given, then the read data will be placed
|
161
167
|
into +buffer+ instead of a newly created String object.
|
162
168
|
* +each+ must be called without arguments and only yield Strings.
|
163
|
-
* +close+
|
169
|
+
* +close+ can be called on the input stream to indicate that the
|
170
|
+
any remaining input is not needed.
|
164
171
|
|
165
172
|
=== The Error Stream
|
166
173
|
|
@@ -320,7 +327,7 @@ It must not be called after being closed.
|
|
320
327
|
It takes a +stream+ argument.
|
321
328
|
|
322
329
|
The +stream+ argument must implement:
|
323
|
-
<tt>read, write, flush, close, close_read, close_write, closed?</tt>
|
330
|
+
<tt>read, write, <<, flush, close, close_read, close_write, closed?</tt>
|
324
331
|
|
325
332
|
The semantics of these IO methods must be a best effort match to
|
326
333
|
those of a normal Ruby IO or Socket object, using standard arguments
|
data/lib/rack/constants.rb
CHANGED
@@ -51,6 +51,7 @@ module Rack
|
|
51
51
|
RACK_RECURSIVE_INCLUDE = 'rack.recursive.include'
|
52
52
|
RACK_MULTIPART_BUFFER_SIZE = 'rack.multipart.buffer_size'
|
53
53
|
RACK_MULTIPART_TEMPFILE_FACTORY = 'rack.multipart.tempfile_factory'
|
54
|
+
RACK_RESPONSE_FINISHED = 'rack.response_finished'
|
54
55
|
RACK_REQUEST_FORM_INPUT = 'rack.request.form_input'
|
55
56
|
RACK_REQUEST_FORM_HASH = 'rack.request.form_hash'
|
56
57
|
RACK_REQUEST_FORM_VARS = 'rack.request.form_vars'
|
data/lib/rack/lint.rb
CHANGED
@@ -363,6 +363,20 @@ module Rack
|
|
363
363
|
unless env[SCRIPT_NAME] != "/"
|
364
364
|
raise LintError, "SCRIPT_NAME cannot be '/', make it '' and PATH_INFO '/'"
|
365
365
|
end
|
366
|
+
|
367
|
+
## <tt>rack.response_finished</tt>:: An array of callables run by the server after the response has been
|
368
|
+
## processed. This would typically be invoked after sending the response to the client, but it could also be
|
369
|
+
## invoked if an error occurs while generating the response or sending the response; in that case, the error
|
370
|
+
## argument will be a subclass of +Exception+.
|
371
|
+
## The callables are invoked with +env, status, headers, error+ arguments and should not raise any
|
372
|
+
## exceptions. They should be invoked in reverse order of registration.
|
373
|
+
if callables = env[RACK_RESPONSE_FINISHED]
|
374
|
+
raise LintError, "rack.response_finished must be an array of callable objects" unless callables.is_a?(Array)
|
375
|
+
|
376
|
+
callables.each do |callable|
|
377
|
+
raise LintError, "rack.response_finished values must respond to call(env, status, headers, error)" unless callable.respond_to?(:call)
|
378
|
+
end
|
379
|
+
end
|
366
380
|
end
|
367
381
|
|
368
382
|
##
|
@@ -464,9 +478,10 @@ module Rack
|
|
464
478
|
}
|
465
479
|
end
|
466
480
|
|
467
|
-
## * +close+
|
481
|
+
## * +close+ can be called on the input stream to indicate that the
|
482
|
+
## any remaining input is not needed.
|
468
483
|
def close(*args)
|
469
|
-
|
484
|
+
@input.close(*args)
|
470
485
|
end
|
471
486
|
end
|
472
487
|
|
@@ -582,7 +597,7 @@ module Rack
|
|
582
597
|
## ignore the +body+ part of the response tuple when the
|
583
598
|
## +rack.hijack+ response header is present. Using an empty +Array+
|
584
599
|
## instance is recommended.
|
585
|
-
else
|
600
|
+
else
|
586
601
|
##
|
587
602
|
## The special response header +rack.hijack+ must only be set
|
588
603
|
## if the request +env+ has a truthy +rack.hijack?+.
|
@@ -846,7 +861,7 @@ module Rack
|
|
846
861
|
## It takes a +stream+ argument.
|
847
862
|
##
|
848
863
|
## The +stream+ argument must implement:
|
849
|
-
## <tt>read, write, flush, close, close_read, close_write, closed?</tt>
|
864
|
+
## <tt>read, write, <<, flush, close, close_read, close_write, closed?</tt>
|
850
865
|
##
|
851
866
|
@body.call(StreamWrapper.new(stream))
|
852
867
|
end
|
@@ -860,7 +875,7 @@ module Rack
|
|
860
875
|
## pass on real IO objects, although it is recognized that this approach
|
861
876
|
## is not directly compatible with HTTP/2.
|
862
877
|
REQUIRED_METHODS = [
|
863
|
-
:read, :write, :flush, :close,
|
878
|
+
:read, :write, :<<, :flush, :close,
|
864
879
|
:close_read, :close_write, :closed?
|
865
880
|
]
|
866
881
|
|
data/lib/rack/mock_response.rb
CHANGED
@@ -45,6 +45,8 @@ module Rack
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def body
|
48
|
+
return @buffered_body if defined?(@buffered_body)
|
49
|
+
|
48
50
|
# FIXME: apparently users of MockResponse expect the return value of
|
49
51
|
# MockResponse#body to be a string. However, the real response object
|
50
52
|
# returns the body as a list.
|
@@ -55,9 +57,9 @@ module Rack
|
|
55
57
|
# ...
|
56
58
|
# res.body.should == "foo!"
|
57
59
|
# end
|
58
|
-
buffer = String.new
|
60
|
+
buffer = @buffered_body = String.new
|
59
61
|
|
60
|
-
|
62
|
+
@body.each do |chunk|
|
61
63
|
buffer << chunk
|
62
64
|
end
|
63
65
|
|
data/lib/rack/version.rb
CHANGED
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: 3.0.0.
|
4
|
+
version: 3.0.0.rc1
|
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: 2022-
|
11
|
+
date: 2022-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -84,14 +84,7 @@ files:
|
|
84
84
|
- CONTRIBUTING.md
|
85
85
|
- MIT-LICENSE
|
86
86
|
- README.md
|
87
|
-
- Rakefile
|
88
87
|
- SPEC.rdoc
|
89
|
-
- contrib/LICENSE.md
|
90
|
-
- contrib/logo.webp
|
91
|
-
- contrib/rdoc.css
|
92
|
-
- example/lobster.ru
|
93
|
-
- example/protectedlobster.rb
|
94
|
-
- example/protectedlobster.ru
|
95
88
|
- lib/rack.rb
|
96
89
|
- lib/rack/auth/abstract/handler.rb
|
97
90
|
- lib/rack/auth/abstract/request.rb
|
@@ -148,7 +141,6 @@ files:
|
|
148
141
|
- lib/rack/urlmap.rb
|
149
142
|
- lib/rack/utils.rb
|
150
143
|
- lib/rack/version.rb
|
151
|
-
- rack.gemspec
|
152
144
|
homepage: https://github.com/rack/rack
|
153
145
|
licenses:
|
154
146
|
- MIT
|
@@ -157,7 +149,7 @@ metadata:
|
|
157
149
|
changelog_uri: https://github.com/rack/rack/blob/main/CHANGELOG.md
|
158
150
|
documentation_uri: https://rubydoc.info/github/rack/rack
|
159
151
|
source_code_uri: https://github.com/rack/rack
|
160
|
-
post_install_message:
|
152
|
+
post_install_message:
|
161
153
|
rdoc_options: []
|
162
154
|
require_paths:
|
163
155
|
- lib
|
@@ -172,8 +164,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
172
164
|
- !ruby/object:Gem::Version
|
173
165
|
version: 1.3.1
|
174
166
|
requirements: []
|
175
|
-
rubygems_version: 3.
|
176
|
-
signing_key:
|
167
|
+
rubygems_version: 3.0.3.1
|
168
|
+
signing_key:
|
177
169
|
specification_version: 4
|
178
170
|
summary: A modular Ruby webserver interface.
|
179
171
|
test_files: []
|
data/Rakefile
DELETED
@@ -1,163 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "bundler/gem_tasks"
|
4
|
-
require "rake/testtask"
|
5
|
-
|
6
|
-
desc "Run all the tests"
|
7
|
-
task default: :test
|
8
|
-
|
9
|
-
desc "Install gem dependencies"
|
10
|
-
task :deps do
|
11
|
-
require 'rubygems'
|
12
|
-
spec = Gem::Specification.load('rack.gemspec')
|
13
|
-
spec.dependencies.each do |dep|
|
14
|
-
reqs = dep.requirements_list
|
15
|
-
reqs = (["-v"] * reqs.size).zip(reqs).flatten
|
16
|
-
# Use system over sh, because we want to ignore errors!
|
17
|
-
system Gem.ruby, "-S", "gem", "install", '--conservative', dep.name, *reqs
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
desc "Make an archive as .tar.gz"
|
22
|
-
task dist: %w[chmod changelog spec rdoc] do
|
23
|
-
sh "git archive --format=tar --prefix=#{release}/ HEAD^{tree} >#{release}.tar"
|
24
|
-
sh "pax -waf #{release}.tar -s ':^:#{release}/:' SPEC.rdoc ChangeLog doc rack.gemspec"
|
25
|
-
sh "gzip -f -9 #{release}.tar"
|
26
|
-
end
|
27
|
-
|
28
|
-
desc "Make an official release"
|
29
|
-
task :officialrelease do
|
30
|
-
puts "Official build for #{release}..."
|
31
|
-
sh "rm -rf stage"
|
32
|
-
sh "git clone --shared . stage"
|
33
|
-
sh "cd stage && rake officialrelease_really"
|
34
|
-
sh "mv stage/#{release}.tar.gz stage/#{release}.gem ."
|
35
|
-
end
|
36
|
-
|
37
|
-
task officialrelease_really: %w[spec dist gem] do
|
38
|
-
sh "shasum #{release}.tar.gz #{release}.gem"
|
39
|
-
end
|
40
|
-
|
41
|
-
def release
|
42
|
-
"rack-" + File.read('lib/rack/version.rb')[/RELEASE += +([\"\'])([\d][\w\.]+)\1/, 2]
|
43
|
-
end
|
44
|
-
|
45
|
-
desc "Make binaries executable"
|
46
|
-
task :chmod do
|
47
|
-
Dir["bin/*"].each { |binary| File.chmod(0755, binary) }
|
48
|
-
Dir["test/cgi/test*"].each { |binary| File.chmod(0755, binary) }
|
49
|
-
end
|
50
|
-
|
51
|
-
desc "Generate a ChangeLog"
|
52
|
-
task changelog: "ChangeLog"
|
53
|
-
|
54
|
-
file '.git/index'
|
55
|
-
file "ChangeLog" => '.git/index' do
|
56
|
-
File.open("ChangeLog", "w") { |out|
|
57
|
-
log = `git log -z`
|
58
|
-
log.force_encoding(Encoding::BINARY)
|
59
|
-
log.split("\0").map { |chunk|
|
60
|
-
author = chunk[/Author: (.*)/, 1].strip
|
61
|
-
date = chunk[/Date: (.*)/, 1].strip
|
62
|
-
desc, detail = $'.strip.split("\n", 2)
|
63
|
-
detail ||= ""
|
64
|
-
detail = detail.gsub(/.*darcs-hash:.*/, '')
|
65
|
-
detail.rstrip!
|
66
|
-
out.puts "#{date} #{author}"
|
67
|
-
out.puts " * #{desc.strip}"
|
68
|
-
out.puts detail unless detail.empty?
|
69
|
-
out.puts
|
70
|
-
}
|
71
|
-
}
|
72
|
-
end
|
73
|
-
|
74
|
-
desc "Generate Rack Specification"
|
75
|
-
task spec: "SPEC.rdoc"
|
76
|
-
|
77
|
-
file 'lib/rack/lint.rb'
|
78
|
-
file "SPEC.rdoc" => 'lib/rack/lint.rb' do
|
79
|
-
File.open("SPEC.rdoc", "wb") { |file|
|
80
|
-
IO.foreach("lib/rack/lint.rb") { |line|
|
81
|
-
if line =~ /^\s*## ?(.*)/
|
82
|
-
file.puts $1
|
83
|
-
end
|
84
|
-
}
|
85
|
-
}
|
86
|
-
end
|
87
|
-
|
88
|
-
Rake::TestTask.new("test:regular") do |t|
|
89
|
-
t.libs << "test"
|
90
|
-
t.test_files = FileList["test/**/*_test.rb", "test/**/spec_*.rb", "test/gemloader.rb"]
|
91
|
-
t.warning = false
|
92
|
-
t.verbose = true
|
93
|
-
end
|
94
|
-
|
95
|
-
desc "Run tests with coverage"
|
96
|
-
task "test_cov" do
|
97
|
-
ENV['COVERAGE'] = '1'
|
98
|
-
Rake::Task['test:regular'].invoke
|
99
|
-
end
|
100
|
-
|
101
|
-
desc "Run separate tests for each test file, to test directly requiring components"
|
102
|
-
task "test:separate" do
|
103
|
-
fails = []
|
104
|
-
FileList["test/**/spec_*.rb"].each do |file|
|
105
|
-
puts "#{FileUtils::RUBY} -w #{file}"
|
106
|
-
fails << file unless system({'SEPARATE'=>'1'}, FileUtils::RUBY, '-w', file)
|
107
|
-
end
|
108
|
-
if fails.empty?
|
109
|
-
puts 'All test files passed'
|
110
|
-
else
|
111
|
-
puts "Failures in the following test files:"
|
112
|
-
puts fails
|
113
|
-
raise "At least one separate test failed"
|
114
|
-
end
|
115
|
-
end
|
116
|
-
|
117
|
-
desc "Run all the fast + platform agnostic tests"
|
118
|
-
task test: %w[spec test:regular test:separate]
|
119
|
-
|
120
|
-
desc "Run all the tests we run on CI"
|
121
|
-
task ci: :test
|
122
|
-
|
123
|
-
task gem: :spec do
|
124
|
-
sh "gem build rack.gemspec"
|
125
|
-
end
|
126
|
-
|
127
|
-
task doc: :rdoc
|
128
|
-
|
129
|
-
desc "Generate RDoc documentation"
|
130
|
-
task rdoc: %w[changelog spec] do
|
131
|
-
sh(*%w{rdoc --line-numbers --main README.rdoc
|
132
|
-
--title 'Rack\ Documentation' --charset utf-8 -U -o doc} +
|
133
|
-
%w{README.rdoc KNOWN-ISSUES SPEC.rdoc ChangeLog} +
|
134
|
-
`git ls-files lib/\*\*/\*.rb`.strip.split)
|
135
|
-
cp "contrib/rdoc.css", "doc/rdoc.css"
|
136
|
-
end
|
137
|
-
|
138
|
-
def clone_and_test(url, name, command)
|
139
|
-
path = "external/#{name}"
|
140
|
-
FileUtils.rm_rf path
|
141
|
-
FileUtils.mkdir_p path
|
142
|
-
|
143
|
-
sh("git clone #{url} #{path}")
|
144
|
-
|
145
|
-
# I tried using `bundle config --local local.async ../` but it simply doesn't work.
|
146
|
-
File.open("#{path}/Gemfile", "a") do |file|
|
147
|
-
file.puts("gem 'rack', path: '../../'")
|
148
|
-
file.puts("gem 'rack-session', github: 'rack/rack-session'") if name == 'rack-attack'
|
149
|
-
end
|
150
|
-
|
151
|
-
sh("cd #{path} && bundle install && #{command}")
|
152
|
-
end
|
153
|
-
|
154
|
-
task :external do
|
155
|
-
# In order not to interfere with external tests: rename our config file
|
156
|
-
FileUtils.mv ".rubocop.yml", ".rack.rubocop.yml.disabled"
|
157
|
-
|
158
|
-
Bundler.with_clean_env do
|
159
|
-
clone_and_test("https://github.com/rack/rack-attack", "rack-attack", "bundle exec rake test")
|
160
|
-
clone_and_test("https://github.com/rack/rack-cache", "rack-cache", "bundle exec rake")
|
161
|
-
clone_and_test("https://github.com/socketry/falcon", "falcon", "bundle exec rspec")
|
162
|
-
end
|
163
|
-
end
|
data/contrib/LICENSE.md
DELETED
data/contrib/logo.webp
DELETED
Binary file
|
data/contrib/rdoc.css
DELETED
@@ -1,412 +0,0 @@
|
|
1
|
-
/* Forked from the Darkfish templates rdoc.css file, much hacked, probably
|
2
|
-
* imperfect */
|
3
|
-
|
4
|
-
html { max-width: 960px; margin: 0 auto; }
|
5
|
-
body {
|
6
|
-
font: 14px "Helvetica Neue", Helvetica, Tahoma, sans-serif;
|
7
|
-
}
|
8
|
-
body.file-popup {
|
9
|
-
font-size: 90%;
|
10
|
-
margin-left: 0;
|
11
|
-
}
|
12
|
-
|
13
|
-
h1 {
|
14
|
-
color: #4183C4;
|
15
|
-
}
|
16
|
-
|
17
|
-
:link,
|
18
|
-
:visited {
|
19
|
-
color: #4183C4;
|
20
|
-
text-decoration: none;
|
21
|
-
}
|
22
|
-
:link:hover,
|
23
|
-
:visited:hover {
|
24
|
-
border-bottom: 1px dotted #4183C4;
|
25
|
-
}
|
26
|
-
|
27
|
-
pre, pre.description {
|
28
|
-
font: 12px Monaco,"Courier New","DejaVu Sans Mono","Bitstream Vera Sans Mono",monospace;
|
29
|
-
padding: 1em;
|
30
|
-
overflow: auto;
|
31
|
-
line-height: 1.4;
|
32
|
-
}
|
33
|
-
|
34
|
-
/* @group Generic Classes */
|
35
|
-
|
36
|
-
.initially-hidden {
|
37
|
-
display: none;
|
38
|
-
}
|
39
|
-
|
40
|
-
#search-field {
|
41
|
-
width: 98%;
|
42
|
-
}
|
43
|
-
|
44
|
-
.missing-docs {
|
45
|
-
font-size: 120%;
|
46
|
-
background: white url(images/wrench_orange.png) no-repeat 4px center;
|
47
|
-
color: #ccc;
|
48
|
-
line-height: 2em;
|
49
|
-
border: 1px solid #d00;
|
50
|
-
opacity: 1;
|
51
|
-
text-indent: 24px;
|
52
|
-
letter-spacing: 3px;
|
53
|
-
font-weight: bold;
|
54
|
-
-webkit-border-radius: 5px;
|
55
|
-
-moz-border-radius: 5px;
|
56
|
-
}
|
57
|
-
|
58
|
-
.target-section {
|
59
|
-
border: 2px solid #dcce90;
|
60
|
-
border-left-width: 8px;
|
61
|
-
background: #fff3c2;
|
62
|
-
}
|
63
|
-
|
64
|
-
/* @end */
|
65
|
-
|
66
|
-
/* @group Index Page, Standalone file pages */
|
67
|
-
.indexpage ul {
|
68
|
-
line-height: 160%;
|
69
|
-
list-style: none;
|
70
|
-
}
|
71
|
-
.indexpage ul :link,
|
72
|
-
.indexpage ul :visited {
|
73
|
-
font-size: 16px;
|
74
|
-
}
|
75
|
-
|
76
|
-
.indexpage li {
|
77
|
-
padding-left: 20px;
|
78
|
-
}
|
79
|
-
|
80
|
-
.indexpage ul > li {
|
81
|
-
background: url(images/bullet_black.png) no-repeat left 4px;
|
82
|
-
}
|
83
|
-
.indexpage li.method {
|
84
|
-
background: url(images/plugin.png) no-repeat left 4px;
|
85
|
-
}
|
86
|
-
.indexpage li.module {
|
87
|
-
background: url(images/package.png) no-repeat left 4px;
|
88
|
-
}
|
89
|
-
.indexpage li.class {
|
90
|
-
background: url(images/ruby.png) no-repeat left 4px;
|
91
|
-
}
|
92
|
-
.indexpage li.file {
|
93
|
-
background: url(images/page_white_text.png) no-repeat left 4px;
|
94
|
-
}
|
95
|
-
.indexpage li li {
|
96
|
-
background: url(images/tag_blue.png) no-repeat left 4px;
|
97
|
-
}
|
98
|
-
.indexpage li .toc-toggle {
|
99
|
-
width: 16px;
|
100
|
-
height: 16px;
|
101
|
-
background: url(images/add.png) no-repeat;
|
102
|
-
}
|
103
|
-
|
104
|
-
.indexpage li .toc-toggle.open {
|
105
|
-
background: url(images/delete.png) no-repeat;
|
106
|
-
}
|
107
|
-
|
108
|
-
/* @end */
|
109
|
-
|
110
|
-
/* @group Top-Level Structure */
|
111
|
-
|
112
|
-
.project-section, #file-metadata, #class-metadata {
|
113
|
-
display: block;
|
114
|
-
background: #f5f5f5;
|
115
|
-
margin-bottom: 1em;
|
116
|
-
padding: 0.5em;
|
117
|
-
}
|
118
|
-
.project-section h3, #file-metadata h3, #class-metadata h3 {
|
119
|
-
margin: 0;
|
120
|
-
}
|
121
|
-
|
122
|
-
#metadata {
|
123
|
-
float: left;
|
124
|
-
width: 280px;
|
125
|
-
}
|
126
|
-
|
127
|
-
#documentation {
|
128
|
-
margin: 2em 1em 2em 300px;
|
129
|
-
}
|
130
|
-
|
131
|
-
#validator-badges {
|
132
|
-
clear: both;
|
133
|
-
margin: 1em 1em 2em;
|
134
|
-
font-size: smaller;
|
135
|
-
}
|
136
|
-
|
137
|
-
/* @end */
|
138
|
-
|
139
|
-
/* @group Metadata Section */
|
140
|
-
|
141
|
-
#metadata ul,
|
142
|
-
#metadata dl,
|
143
|
-
#metadata p {
|
144
|
-
padding: 0px;
|
145
|
-
list-style: none;
|
146
|
-
}
|
147
|
-
|
148
|
-
dl.svninfo {
|
149
|
-
color: #666;
|
150
|
-
margin: 0;
|
151
|
-
}
|
152
|
-
dl.svninfo dt {
|
153
|
-
font-weight: bold;
|
154
|
-
}
|
155
|
-
|
156
|
-
ul.link-list li {
|
157
|
-
white-space: nowrap;
|
158
|
-
}
|
159
|
-
ul.link-list .type {
|
160
|
-
font-size: 8px;
|
161
|
-
text-transform: uppercase;
|
162
|
-
color: white;
|
163
|
-
background: #969696;
|
164
|
-
}
|
165
|
-
|
166
|
-
/* @end */
|
167
|
-
|
168
|
-
/* @group Documentation Section */
|
169
|
-
|
170
|
-
.note-list {
|
171
|
-
margin: 8px 0;
|
172
|
-
}
|
173
|
-
|
174
|
-
.label-list {
|
175
|
-
margin: 8px 1.5em;
|
176
|
-
border: 1px solid #ccc;
|
177
|
-
}
|
178
|
-
.description .label-list {
|
179
|
-
font-size: 14px;
|
180
|
-
}
|
181
|
-
|
182
|
-
.note-list dt {
|
183
|
-
font-weight: bold;
|
184
|
-
}
|
185
|
-
.note-list dd {
|
186
|
-
}
|
187
|
-
|
188
|
-
.label-list dt {
|
189
|
-
font-weight: bold;
|
190
|
-
background: #ddd;
|
191
|
-
}
|
192
|
-
.label-list dd {
|
193
|
-
}
|
194
|
-
.label-list dd + dt,
|
195
|
-
.note-list dd + dt {
|
196
|
-
margin-top: 0.7em;
|
197
|
-
}
|
198
|
-
|
199
|
-
#documentation .section {
|
200
|
-
font-size: 90%;
|
201
|
-
}
|
202
|
-
|
203
|
-
#documentation h2.section-header {
|
204
|
-
color: #333;
|
205
|
-
font-size: 175%;
|
206
|
-
}
|
207
|
-
|
208
|
-
.documentation-section-title {
|
209
|
-
position: relative;
|
210
|
-
}
|
211
|
-
.documentation-section-title .section-click-top {
|
212
|
-
position: absolute;
|
213
|
-
top: 6px;
|
214
|
-
right: 12px;
|
215
|
-
font-size: 10px;
|
216
|
-
visibility: hidden;
|
217
|
-
}
|
218
|
-
|
219
|
-
.documentation-section-title:hover .section-click-top {
|
220
|
-
visibility: visible;
|
221
|
-
}
|
222
|
-
|
223
|
-
#documentation h3.section-header {
|
224
|
-
color: #333;
|
225
|
-
font-size: 150%;
|
226
|
-
}
|
227
|
-
|
228
|
-
#constants-list > dl,
|
229
|
-
#attributes-list > dl {
|
230
|
-
margin: 1em 0 2em;
|
231
|
-
border: 0;
|
232
|
-
}
|
233
|
-
#constants-list > dl dt,
|
234
|
-
#attributes-list > dl dt {
|
235
|
-
font-weight: bold;
|
236
|
-
font-family: Monaco, "Andale Mono";
|
237
|
-
background: inherit;
|
238
|
-
}
|
239
|
-
#constants-list > dl dt a,
|
240
|
-
#attributes-list > dl dt a {
|
241
|
-
color: inherit;
|
242
|
-
}
|
243
|
-
#constants-list > dl dd,
|
244
|
-
#attributes-list > dl dd {
|
245
|
-
margin: 0 0 1em 0;
|
246
|
-
color: #666;
|
247
|
-
}
|
248
|
-
|
249
|
-
.documentation-section h2 {
|
250
|
-
position: relative;
|
251
|
-
}
|
252
|
-
|
253
|
-
.documentation-section h2 a {
|
254
|
-
position: absolute;
|
255
|
-
top: 8px;
|
256
|
-
right: 10px;
|
257
|
-
font-size: 12px;
|
258
|
-
color: #9b9877;
|
259
|
-
visibility: hidden;
|
260
|
-
}
|
261
|
-
|
262
|
-
.documentation-section h2:hover a {
|
263
|
-
visibility: visible;
|
264
|
-
}
|
265
|
-
|
266
|
-
/* @group Method Details */
|
267
|
-
|
268
|
-
#documentation .method-source-code {
|
269
|
-
display: none;
|
270
|
-
}
|
271
|
-
|
272
|
-
#documentation .method-detail {
|
273
|
-
margin: 0.2em 0.2em;
|
274
|
-
padding: 0.5em;
|
275
|
-
}
|
276
|
-
#documentation .method-detail:hover {
|
277
|
-
background-color: #f5f5f5;
|
278
|
-
}
|
279
|
-
#documentation .method-heading {
|
280
|
-
cursor: pointer;
|
281
|
-
position: relative;
|
282
|
-
font-size: 125%;
|
283
|
-
line-height: 125%;
|
284
|
-
font-weight: bold;
|
285
|
-
color: #333;
|
286
|
-
background: url(images/brick.png) no-repeat left bottom;
|
287
|
-
padding-left: 20px;
|
288
|
-
}
|
289
|
-
#documentation .method-heading :link,
|
290
|
-
#documentation .method-heading :visited {
|
291
|
-
color: inherit;
|
292
|
-
}
|
293
|
-
#documentation .method-click-advice {
|
294
|
-
position: absolute;
|
295
|
-
right: 5px;
|
296
|
-
font-size: 10px;
|
297
|
-
color: #aaa;
|
298
|
-
visibility: hidden;
|
299
|
-
background: url(images/zoom.png) no-repeat right 5px;
|
300
|
-
padding-right: 20px;
|
301
|
-
overflow: show;
|
302
|
-
}
|
303
|
-
#documentation .method-heading:hover .method-click-advice {
|
304
|
-
visibility: visible;
|
305
|
-
}
|
306
|
-
|
307
|
-
#documentation .method-alias .method-heading {
|
308
|
-
color: #666;
|
309
|
-
background: url(images/brick_link.png) no-repeat left bottom;
|
310
|
-
}
|
311
|
-
|
312
|
-
#documentation .method-description,
|
313
|
-
#documentation .aliases {
|
314
|
-
margin: 0 20px;
|
315
|
-
color: #666;
|
316
|
-
}
|
317
|
-
|
318
|
-
#documentation .method-description p,
|
319
|
-
#documentation .aliases p {
|
320
|
-
line-height: 1.2em;
|
321
|
-
}
|
322
|
-
|
323
|
-
#documentation .aliases {
|
324
|
-
font-style: italic;
|
325
|
-
cursor: default;
|
326
|
-
}
|
327
|
-
#documentation .method-description p {
|
328
|
-
margin-bottom: 0.5em;
|
329
|
-
}
|
330
|
-
#documentation .method-description ul {
|
331
|
-
margin-left: 1.5em;
|
332
|
-
}
|
333
|
-
|
334
|
-
#documentation .attribute-method-heading {
|
335
|
-
background: url(images/tag_green.png) no-repeat left bottom;
|
336
|
-
}
|
337
|
-
#documentation #attribute-method-details .method-detail:hover {
|
338
|
-
background-color: transparent;
|
339
|
-
cursor: default;
|
340
|
-
}
|
341
|
-
#documentation .attribute-access-type {
|
342
|
-
font-size: 60%;
|
343
|
-
text-transform: uppercase;
|
344
|
-
vertical-align: super;
|
345
|
-
}
|
346
|
-
|
347
|
-
.method-section .method-source-code {
|
348
|
-
background: white;
|
349
|
-
}
|
350
|
-
|
351
|
-
/* @group Source Code */
|
352
|
-
|
353
|
-
.ruby-constant .ruby-keyword .ruby-ivar .ruby-operator .ruby-identifier
|
354
|
-
.ruby-node .ruby-comment .ruby-regexp .ruby-value {
|
355
|
-
background: transparent;
|
356
|
-
}
|
357
|
-
|
358
|
-
/* Thanks GitHub!!! */
|
359
|
-
.ruby-constant { color: #458; font-weight: bold; }
|
360
|
-
.ruby-keyword { color: black; font-weight: bold; }
|
361
|
-
.ruby-ivar { color: teal; }
|
362
|
-
.ruby-operator { color: #000; }
|
363
|
-
.ruby-identifier { color: black; }
|
364
|
-
.ruby-node { color: red; }
|
365
|
-
.ruby-comment { color: #998; font-weight: bold; }
|
366
|
-
.ruby-regexp { color: #009926; }
|
367
|
-
.ruby-value { color: #099; }
|
368
|
-
.ruby-string { color: red; }
|
369
|
-
|
370
|
-
/* @group search results */
|
371
|
-
|
372
|
-
#search-section .section-header {
|
373
|
-
margin: 0;
|
374
|
-
padding: 0;
|
375
|
-
}
|
376
|
-
|
377
|
-
#search-results {
|
378
|
-
width: 100%;
|
379
|
-
list-style: none;
|
380
|
-
margin: 0;
|
381
|
-
padding: 0;
|
382
|
-
}
|
383
|
-
|
384
|
-
#search-results h1 {
|
385
|
-
font-size: 1em;
|
386
|
-
font-weight: normal;
|
387
|
-
text-shadow: none;
|
388
|
-
}
|
389
|
-
|
390
|
-
#search-results .current {
|
391
|
-
background: #eee;
|
392
|
-
}
|
393
|
-
|
394
|
-
#search-results li {
|
395
|
-
list-style: none;
|
396
|
-
line-height: 1em;
|
397
|
-
padding: 0.5em;
|
398
|
-
border-bottom: 1px solid black;
|
399
|
-
}
|
400
|
-
|
401
|
-
#search-results .search-namespace {
|
402
|
-
font-weight: bold;
|
403
|
-
}
|
404
|
-
|
405
|
-
#search-results li em {
|
406
|
-
background: yellow;
|
407
|
-
font-style: normal;
|
408
|
-
}
|
409
|
-
|
410
|
-
#search-results pre {
|
411
|
-
margin: 0.5em;
|
412
|
-
}
|
data/example/lobster.ru
DELETED
data/example/protectedlobster.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'rack'
|
4
|
-
require 'rack/lobster'
|
5
|
-
|
6
|
-
lobster = Rack::Lobster.new
|
7
|
-
|
8
|
-
protected_lobster = Rack::Auth::Basic.new(lobster) do |username, password|
|
9
|
-
Rack::Utils.secure_compare('secret', password)
|
10
|
-
end
|
11
|
-
|
12
|
-
protected_lobster.realm = 'Lobster 2.0'
|
13
|
-
|
14
|
-
pretty_protected_lobster = Rack::ShowStatus.new(Rack::ShowExceptions.new(protected_lobster))
|
15
|
-
|
16
|
-
Rack::Server.start app: pretty_protected_lobster, Port: 9292
|
data/example/protectedlobster.ru
DELETED
data/rack.gemspec
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative 'lib/rack/version'
|
4
|
-
|
5
|
-
Gem::Specification.new do |s|
|
6
|
-
s.name = "rack"
|
7
|
-
s.version = Rack::RELEASE
|
8
|
-
s.platform = Gem::Platform::RUBY
|
9
|
-
s.summary = "A modular Ruby webserver interface."
|
10
|
-
s.license = "MIT"
|
11
|
-
|
12
|
-
s.description = <<~EOF
|
13
|
-
Rack provides a minimal, modular and adaptable interface for developing
|
14
|
-
web applications in Ruby. By wrapping HTTP requests and responses in
|
15
|
-
the simplest way possible, it unifies and distills the API for web
|
16
|
-
servers, web frameworks, and software in between (the so-called
|
17
|
-
middleware) into a single method call.
|
18
|
-
EOF
|
19
|
-
|
20
|
-
s.files = Dir['{bin/*,contrib/*,example/*,lib/**/*}'] +
|
21
|
-
%w(MIT-LICENSE rack.gemspec Rakefile README.md SPEC.rdoc)
|
22
|
-
|
23
|
-
s.bindir = 'bin'
|
24
|
-
s.require_path = 'lib'
|
25
|
-
s.extra_rdoc_files = ['README.md', 'CHANGELOG.md', 'CONTRIBUTING.md']
|
26
|
-
|
27
|
-
s.author = 'Leah Neukirchen'
|
28
|
-
s.email = 'leah@vuxu.org'
|
29
|
-
|
30
|
-
s.homepage = 'https://github.com/rack/rack'
|
31
|
-
|
32
|
-
s.required_ruby_version = '>= 2.4.0'
|
33
|
-
|
34
|
-
s.metadata = {
|
35
|
-
"bug_tracker_uri" => "https://github.com/rack/rack/issues",
|
36
|
-
"changelog_uri" => "https://github.com/rack/rack/blob/main/CHANGELOG.md",
|
37
|
-
"documentation_uri" => "https://rubydoc.info/github/rack/rack",
|
38
|
-
"source_code_uri" => "https://github.com/rack/rack"
|
39
|
-
}
|
40
|
-
|
41
|
-
s.add_development_dependency 'minitest', "~> 5.0"
|
42
|
-
s.add_development_dependency 'minitest-global_expectations'
|
43
|
-
|
44
|
-
s.add_development_dependency 'bundler'
|
45
|
-
s.add_development_dependency 'rake'
|
46
|
-
end
|