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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd4dbc5493600c8a866575bf35aa8647cfc7db2bac5567facea21049349f37a8
4
- data.tar.gz: 7abbb603d5f8939fdde602fda10358d74e3e52f5fc9027d941158900246831f8
3
+ metadata.gz: 335efdff6c7d5e4a5be51002462ca17c92ac11e667011eee6d2b1d21195d555d
4
+ data.tar.gz: e1dbadcb0ecf680e4077ad67e6b796efbe00329de6c75e7aeff0210b1fc03940
5
5
  SHA512:
6
- metadata.gz: 3457708296eb15462157ebcd56b4baea71b335881d917a86f3612448e9a1cdf9908ab1eafb1f1a65cfc09db8760b2ba94fd52557c2d8ae687a3554ec32290a6f
7
- data.tar.gz: a848bd023e20be3b4685b1655bcc9073d4d34532b0382a0f98760a80c2091a8480a832689cfe1901b510b0eafb2c74384a1576e8015fe93fede763ec48ebb606
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 Rack::Server
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rack
4
4
  class TestServer
5
- VERSION = '0.2.0'
5
+ VERSION = '0.2.1'
6
6
  end
7
7
  end
@@ -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 Rack::Server#start
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
- @server = Rack::Server.new(app: testapp, **options)
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 Rack::Server.
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.0
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-02-19 00:00:00.000000000 Z
11
+ date: 2024-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack