rack-test_server 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/rack/test_server/version.rb +1 -1
- data/lib/rack/test_server.rb +7 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 335efdff6c7d5e4a5be51002462ca17c92ac11e667011eee6d2b1d21195d555d
|
4
|
+
data.tar.gz: e1dbadcb0ecf680e4077ad67e6b796efbe00329de6c75e7aeff0210b1fc03940
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb914169d7cbd83015dbf3beb3f14163a514b69f7aa3b27100f567436c27c91d523b4a6292ac3b455e4ddeab85ae3ef5d626cd70216f44058826e0659cebd032
|
7
|
+
data.tar.gz: 4443827d97045b7bec5a905ed9991b0c78601bcc66dfea8b1bd94ba6d11b17fb9860bfd93008bb0a3d8d762c8a33c3f050a4cf3dac0c224e9cce53a0414732c6
|
data/README.md
CHANGED
@@ -49,7 +49,7 @@ require 'rack/test_server'
|
|
49
49
|
|
50
50
|
# Configure Rack server
|
51
51
|
#
|
52
|
-
# options for
|
52
|
+
# options for Rackup::Server
|
53
53
|
# @see https://github.com/rack/rack/blob/2.2.3/lib/rack/server.rb#L173
|
54
54
|
# options for Rack::Handler::Puma
|
55
55
|
# @see https://github.com/puma/puma/blob/v5.4.0/lib/rack/handler/puma.rb#L84
|
data/lib/rack/test_server.rb
CHANGED
@@ -8,7 +8,7 @@ require 'rack/test_server/puma_signal_trap_interceptor'
|
|
8
8
|
require 'rack/test_server/signal_trap_interceptor'
|
9
9
|
|
10
10
|
module Rack
|
11
|
-
# An utility class for launching HTTP server with
|
11
|
+
# An utility class for launching HTTP server with Rackup::Server#start
|
12
12
|
# and waiting for the server available with checking a healthcheck endpoint with net/http.
|
13
13
|
#
|
14
14
|
# The most typical usage is:
|
@@ -28,7 +28,11 @@ module Rack
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
-
|
31
|
+
begin
|
32
|
+
@server = Rackup::Server.new(app: testapp, **options)
|
33
|
+
rescue NameError
|
34
|
+
@server = Rack::Server.new(app: testapp, **options)
|
35
|
+
end
|
32
36
|
@host = @server.options[:Host] || @server.default_options[:Host]
|
33
37
|
@port = @server.options[:Port] || @server.default_options[:Port]
|
34
38
|
end
|
@@ -46,7 +50,7 @@ module Rack
|
|
46
50
|
#
|
47
51
|
# @note This method will block the thread, and in most cases {#start_async} is suitable.
|
48
52
|
def start
|
49
|
-
# Disable SIGINT handler in
|
53
|
+
# Disable SIGINT handler in Rackup::Server.
|
50
54
|
# https://github.com/rack/rack/blob/2.2.3/lib/rack/server.rb#L319
|
51
55
|
SignalTrapInterceptor.enable
|
52
56
|
@server.start do |server|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-test_server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- YusukeIwaki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|