whoosh 1.3.1 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 99edefedd7d17b1c477fcd07d7ba72b317560d670706ec1361c197df013a9834
4
- data.tar.gz: d94a866bf3e588e64591b1e1e32e62db4b5fae74511420b5942e42a04eb1dc8a
3
+ metadata.gz: '058f9e32f51902477b54086f0b13891fb7dd4b3a33fbcef71387d2556af05ebe'
4
+ data.tar.gz: abdfab2e7f266bd8d32f7357d531a7847a7087c30a508d1de955edddd1564383
5
5
  SHA512:
6
- metadata.gz: c2d1793270458869874e09f720c053eb3625b2943323bd1ff24a9e9620bebd3cbe9705fb1bde81cfe60211084f8d7a0862407548f1699a5f5a25c4bb392f764b
7
- data.tar.gz: f86e8837a57fcbee513a514d6bf32d2901833187f038cd64d0b8bfb71897a97507c65ee5297af3ce92e940ee697d0443165efeda980a8fb1d8b3cb334a4ae89b
6
+ metadata.gz: 4e2f5bc134e5e2f32eb0c21258f240646abb0d140dfc8834e113d1f52a43d9919266ede8f36ba0750791ee98641d94d6059380d82274a171a8fb610ad9b0f963
7
+ data.tar.gz: 3e0ce60dd666d57c6aa84804a2f5a0cf5af34bd2a215faf3d31705d4d535489de8c01a979c03144d1784a61526af8ea3e3941cacd1fee623ef9aae0bf3e7d276
@@ -85,9 +85,39 @@ module Whoosh
85
85
  rack_app = whoosh_app.to_rack
86
86
  end
87
87
 
88
- # Start server try Falcon first, then Puma, then WEBrick
88
+ # Auto-detect server based on platform
89
+ # macOS: Puma (threads) — Falcon forks crash due to ObjC runtime + native C extensions
90
+ # Linux: Falcon (fibers) — faster async I/O, no fork issue
89
91
  require "rackup"
90
- Rackup::Server.start(app: rack_app, Port: port, Host: host)
92
+ server_opts = { app: rack_app, Port: port, Host: host }
93
+
94
+ if RUBY_PLATFORM.include?("darwin")
95
+ # Force Puma on macOS to avoid fork crashes
96
+ begin
97
+ require "puma"
98
+ server_opts[:server] = "puma"
99
+ puts "=> Using Puma (macOS — Falcon forks are unsafe here)"
100
+ rescue LoadError
101
+ puts "=> Using default server (install puma for best macOS experience)"
102
+ end
103
+ else
104
+ # Linux: prefer Falcon for performance
105
+ begin
106
+ require "falcon"
107
+ server_opts[:server] = "falcon"
108
+ puts "=> Using Falcon (Linux — async fibers for best performance)"
109
+ rescue LoadError
110
+ begin
111
+ require "puma"
112
+ server_opts[:server] = "puma"
113
+ puts "=> Using Puma"
114
+ rescue LoadError
115
+ puts "=> Using default server"
116
+ end
117
+ end
118
+ end
119
+
120
+ Rackup::Server.start(**server_opts)
91
121
  end
92
122
 
93
123
  desc "routes", "List all registered routes"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Whoosh
4
- VERSION = "1.3.1"
4
+ VERSION = "1.3.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whoosh
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johannes Dwi Cahyo