Skip to content

Commit

Permalink
Prevent with rack 3
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeDupuis committed May 28, 2023
1 parent 3a6ea4f commit 377c1ac
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ gem "rake-compiler", "~> 1.1.1"

gem "json", "~> 2.3"
gem "nio4r", "~> 2.0"
gem "rack", ">= 1.6.13"
gem "rack", ">= 1.6.13", "<3.0.0"
gem "minitest", "~> 5.11"
gem "minitest-retry"
gem "minitest-proveit"
Expand Down
2 changes: 2 additions & 0 deletions lib/puma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
require 'puma/detect'
require 'puma/json_serialization'

require 'rack/version_restriction'

module Puma
autoload :Const, 'puma/const'
autoload :Server, 'puma/server'
Expand Down
5 changes: 5 additions & 0 deletions lib/rack/version_restriction.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require 'rack'

if Gem::Version.new(Rack.release) >= Gem::Version.new("3.0.0")
raise StandardError.new "Puma 5 is not compatible with rack 3, please upgrade to Puma 6 or higher."
end

0 comments on commit 377c1ac

Please sign in to comment.