Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove detect_rack_handler #1652

Merged
merged 1 commit into from Oct 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 1 addition & 12 deletions lib/sinatra/base.rb
Expand Up @@ -1488,7 +1488,7 @@ def quit!
def run!(options = {}, &block)
return if running?
set options
handler = detect_rack_handler
handler = Rack::Handler.pick(server)
handler_name = handler.name.gsub(/.*::/, '')
server_settings = settings.respond_to?(:server_settings) ? settings.server_settings : {}
server_settings.merge!(:Port => port, :Host => bind)
Expand Down Expand Up @@ -1742,17 +1742,6 @@ def setup_sessions(builder)
builder.use session_store, options
end

def detect_rack_handler
servers = Array(server)
servers.each do |server_name|
begin
return Rack::Handler.get(server_name.to_s)
rescue LoadError, NameError
end
end
fail "Server handler (#{servers.join(',')}) not found."
end

def inherited(subclass)
subclass.reset!
subclass.set :app_file, caller_files.first unless subclass.app_file?
Expand Down