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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a8147a54f57ff6cc1143ffb8b1d56284e4a587ca63aeeb21e491d83348d9dfcd
4
- data.tar.gz: 438c92e88aee281963b9a796c716feab222e6a16d34533f89278c42f8be1c34f
3
+ metadata.gz: 3c239e669891dd32bd5459cc09851002a3053efcef6b1e0b2273b59a0ecde2ca
4
+ data.tar.gz: 36a8f1702ab1ad684761a12a16b54139b7b817eccaab1c4ee1598b4f2d5e9b6b
5
5
  SHA512:
6
- metadata.gz: 918d8410462f54b58b63defeb39b95fae57ae7da05f19dfee0479718d0b4422909b13a00c1a9f3e19f7e5fb4328b4240db0f7bbbc89d77f0df5e2d8a8e8b94f4
7
- data.tar.gz: c821f8a16afb6946aea5dee3bb0a9b070f782df68dfd979772c612dab61d5c983b3fceb32567ce24fac5aff4627157dfea35fee643170bf4ac75d92497308b52
6
+ metadata.gz: 793c6af71f771f2faf322f4d138b2cea8dcbf40a4a99fdb582b71f58768f3a727e20021c2a5c7a09040e9af2b2ae4ae9c3f2a6b5e2578983cbbaba94b337fc3e
7
+ data.tar.gz: f8af38a1f3839bafb9cd765256a0e1eed88506cd8a785eb387e173253b78402175c666a3227d7e9c06e5b09c4e9f969e25dfe64c169ce7cdd56027f3a0f539c6
@@ -0,0 +1,5 @@
1
+ warn "Rack::Handler is deprecated and replaced by Rackup::Handler"
2
+ require_relative '../rackup/handler'
3
+ module Rack
4
+ Handler = ::Rackup::Handler
5
+ end
@@ -0,0 +1,5 @@
1
+ warn "Rack::Server is deprecated and replaced by Rackup::Server"
2
+ require_relative '../rackup/server'
3
+ module Rack
4
+ Server = ::Rackup::Server
5
+ end
@@ -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
- Rack::Handler[name] || self.const_get(name, false)
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
- require_handler("rack/handler", name)
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
 
@@ -21,5 +21,5 @@
21
21
  # THE SOFTWARE.
22
22
 
23
23
  module Rackup
24
- VERSION = "0.1.0"
24
+ VERSION = "0.2.0"
25
25
  end
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.1.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-03 00:00:00.000000000 Z
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: '0'
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: '0'
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