rackup 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rack/handler.rb +5 -0
- data/lib/rack/server.rb +5 -0
- data/lib/rackup/handler.rb +23 -10
- data/lib/rackup/version.rb +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c239e669891dd32bd5459cc09851002a3053efcef6b1e0b2273b59a0ecde2ca
|
4
|
+
data.tar.gz: 36a8f1702ab1ad684761a12a16b54139b7b817eccaab1c4ee1598b4f2d5e9b6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 793c6af71f771f2faf322f4d138b2cea8dcbf40a4a99fdb582b71f58768f3a727e20021c2a5c7a09040e9af2b2ae4ae9c3f2a6b5e2578983cbbaba94b337fc3e
|
7
|
+
data.tar.gz: f8af38a1f3839bafb9cd765256a0e1eed88506cd8a785eb387e173253b78402175c666a3227d7e9c06e5b09c4e9f969e25dfe64c169ce7cdd56027f3a0f539c6
|
data/lib/rack/handler.rb
ADDED
data/lib/rack/server.rb
ADDED
data/lib/rackup/handler.rb
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'rack/handler'
|
4
|
-
|
5
3
|
module Rackup
|
6
4
|
# *Handlers* connect web servers with Rack.
|
7
5
|
#
|
@@ -11,9 +9,26 @@ module Rackup
|
|
11
9
|
# A second optional hash can be passed to include server-specific
|
12
10
|
# configuration.
|
13
11
|
module Handler
|
12
|
+
@handlers = {}
|
13
|
+
|
14
|
+
# Register a named handler class.
|
15
|
+
def self.register(name, klass)
|
16
|
+
if klass.is_a?(String)
|
17
|
+
warn "Calling Rackup::Handler.register with a string is deprecated, use the class/module itself.", uplevel: 1
|
18
|
+
|
19
|
+
klass = self.const_get(klass, false)
|
20
|
+
end
|
21
|
+
|
22
|
+
name = name.to_sym
|
23
|
+
|
24
|
+
@handlers[name] = klass
|
25
|
+
end
|
26
|
+
|
14
27
|
def self.[](name)
|
28
|
+
name = name.to_sym
|
29
|
+
|
15
30
|
begin
|
16
|
-
|
31
|
+
@handlers[name] || self.const_get(name, false)
|
17
32
|
rescue NameError
|
18
33
|
# Ignore.
|
19
34
|
end
|
@@ -28,17 +43,15 @@ module Rackup
|
|
28
43
|
return server
|
29
44
|
end
|
30
45
|
|
31
|
-
|
46
|
+
begin
|
47
|
+
require_handler("rackup/handler", name)
|
48
|
+
rescue LoadError
|
49
|
+
require_handler("rack/handler", name)
|
50
|
+
end
|
32
51
|
|
33
52
|
return self[name]
|
34
53
|
end
|
35
54
|
|
36
|
-
def self.register(name, klass)
|
37
|
-
name = name.to_sym
|
38
|
-
|
39
|
-
Rack::Handler.register(name, klass)
|
40
|
-
end
|
41
|
-
|
42
55
|
RACK_HANDLER = 'RACK_HANDLER'
|
43
56
|
RACKUP_HANDLER = 'RACKUP_HANDLER'
|
44
57
|
|
data/lib/rackup/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rackup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rack Contributors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 3.0.0.beta1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 3.0.0.beta1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: webrick
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -115,6 +115,8 @@ extensions: []
|
|
115
115
|
extra_rdoc_files: []
|
116
116
|
files:
|
117
117
|
- bin/rackup
|
118
|
+
- lib/rack/handler.rb
|
119
|
+
- lib/rack/server.rb
|
118
120
|
- lib/rackup.rb
|
119
121
|
- lib/rackup/handler.rb
|
120
122
|
- lib/rackup/handler/cgi.rb
|