Skip to content

Commit

Permalink
Merge pull request #1652 from ceclinux/remove_detect_rack_handler
Browse files Browse the repository at this point in the history
remove detect_rack_handler
  • Loading branch information
jkowens committed Oct 14, 2020
2 parents 0aa8d50 + 2ddb1e0 commit 578c1a6
Showing 1 changed file with 1 addition and 12 deletions.
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

0 comments on commit 578c1a6

Please sign in to comment.