diff --git a/README.md b/README.md index 785fbc5e6..ee7b851f0 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,7 @@ end Install the gems needed: ```shell -gem install sinatra -gem install rackup -gem install puma # or any other server (optional step) +gem install sinatra rackup puma ``` And run with: @@ -2087,12 +2085,8 @@ set :protection, :session => true
server_settings
- If you are using a WEBrick web server, presumably for your development - environment, you can pass a hash of options to server_settings, - such as SSLEnable or SSLVerifyClient. However, web - servers such as Puma do not support this, so you can set - server_settings by defining it as a method when you call - configure. + You can pass a hash of options to server_settings, + such as Host or Port.
sessions
@@ -2813,7 +2807,7 @@ _Paraphrasing from by Konstantin_ Sinatra doesn't impose any concurrency model but leaves that to the -underlying Rack handler (server) like Puma or WEBrick. Sinatra +underlying Rack handler (server) like Puma or Falcon. Sinatra itself is thread-safe, so there won't be any problem if the Rack handler uses a threaded model of concurrency. diff --git a/lib/sinatra/base.rb b/lib/sinatra/base.rb index 97f6f8d08..9b37a6c4b 100644 --- a/lib/sinatra/base.rb +++ b/lib/sinatra/base.rb @@ -1600,20 +1600,20 @@ def quit! alias stop! quit! # Run the Sinatra app as a self-hosted server using - # Puma, Falcon, or WEBrick (in that order). If given a block, will call + # Puma, Falcon (in that order). If given a block, will call # with the constructed handler once we have taken the stage. def run!(options = {}, &block) unless defined?(Rackup::Handler) rackup_warning = <<~MISSING_RACKUP - Sinatra could not start, the "rackup" gem was not found! + Sinatra could not start, the required gems weren't found! - Add it to your bundle with: + Add them to your bundle with: - bundle add rackup + bundle add rackup puma - or install it with: + or install them with: - gem install rackup + gem install rackup puma MISSING_RACKUP warn rackup_warning @@ -1963,7 +1963,7 @@ class << self set :running_server, nil set :handler_name, nil set :traps, true - set :server, %w[HTTP webrick] + set :server, %w[] set :bind, proc { development? ? 'localhost' : '0.0.0.0' } set :port, Integer(ENV['PORT'] && !ENV['PORT'].empty? ? ENV['PORT'] : 4567) set :quiet, false diff --git a/rack-protection/lib/rack/protection/authenticity_token.rb b/rack-protection/lib/rack/protection/authenticity_token.rb index ffc612665..a56de1cac 100644 --- a/rack-protection/lib/rack/protection/authenticity_token.rb +++ b/rack-protection/lib/rack/protection/authenticity_token.rb @@ -46,15 +46,15 @@ module Protection # Install the gem, then run the program: # # gem install 'rack-protection' - # ruby server.rb + # puma server.ru # - # Here is server.rb: + # Here is server.ru: # # require 'rack/protection' # require 'rack/session' # # app = Rack::Builder.app do - # use Rack::Session::Cookie, secret: 'secret' + # use Rack::Session::Cookie, secret: 'CHANGEMEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' # use Rack::Protection::AuthenticityToken # # run -> (env) do @@ -88,7 +88,7 @@ module Protection # end # end # - # Rack::Handler::WEBrick.run app + # run app # # == Example: Customize which POST parameter holds the token # diff --git a/test/integration_helper.rb b/test/integration_helper.rb index 33841a49b..3056360f7 100644 --- a/test/integration_helper.rb +++ b/test/integration_helper.rb @@ -78,10 +78,6 @@ def command end end - def webrick? - name.to_s == "webrick" - end - def puma? name.to_s == "puma" end diff --git a/test/integration_start_test.rb b/test/integration_start_test.rb index 8863edf69..29cad9879 100644 --- a/test/integration_start_test.rb +++ b/test/integration_start_test.rb @@ -22,7 +22,7 @@ def test_app_start_without_rackup env = { "BUNDLE_GEMFILE" => gem_file } with_process(command: command, env: env) do |process, read_io| - assert wait_for_output(read_io, /Sinatra could not start, the "rackup" gem was not found/) + assert wait_for_output(read_io, /Sinatra could not start, the required gems weren't found/) end end diff --git a/test/integration_test.rb b/test/integration_test.rb index 167e3bf8d..4e424e090 100644 --- a/test/integration_test.rb +++ b/test/integration_test.rb @@ -19,15 +19,13 @@ class IntegrationTest < Minitest::Test count = server.log.scan("GET /ping?x=#{random}").count if server.net_http_server? assert_equal 0, count - elsif server.webrick? - assert(count > 0) else assert_equal(1, count) end end it 'streams' do - next if server.webrick? or server.trinidad? + next if server.trinidad? times, chunks = [Process.clock_gettime(Process::CLOCK_MONOTONIC)], [] server.get_stream do |chunk| next if chunk.empty? diff --git a/test/settings_test.rb b/test/settings_test.rb index a85e7d2c0..f5c07bcb5 100644 --- a/test/settings_test.rb +++ b/test/settings_test.rb @@ -479,11 +479,6 @@ def pub; end end describe 'server' do - it 'includes webrick' do - assert @base.server.include?('webrick') - assert @application.server.include?('webrick') - end - it 'includes puma' do assert @base.server.include?('puma') assert @application.server.include?('puma')