Sha256: cd4176e7bee0575c2b2b0bf992e22b92003fb216f155d04b93f1fe360414cb25

Contents?: true

Size: 858 Bytes

Versions: 7

Compression:

Stored size: 858 Bytes

Contents

require "rack/handler/puma"

module ActionDispatch
  module SystemTesting
    class Server # :nodoc:
      class << self
        attr_accessor :silence_puma
      end

      self.silence_puma = false

      def run
        register
        setup
      end

      private
        def register
          Capybara.register_server :rails_puma do |app, port, host|
            Rack::Handler::Puma.run(
              app,
              Port: port,
              Threads: "0:1",
              workers: 0,
              daemon: false,
              Silent: self.class.silence_puma
            )
          end
        end

        def setup
          set_server
          set_port
        end

        def set_server
          Capybara.server = :rails_puma
        end

        def set_port
          Capybara.always_include_port = true
        end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
actionpack-5.1.7 lib/action_dispatch/system_testing/server.rb
actionpack-5.1.7.rc1 lib/action_dispatch/system_testing/server.rb
actionpack-5.1.6.2 lib/action_dispatch/system_testing/server.rb
actionpack-5.1.6.1 lib/action_dispatch/system_testing/server.rb
actionpack-5.1.6 lib/action_dispatch/system_testing/server.rb
actionpack-5.1.5 lib/action_dispatch/system_testing/server.rb
actionpack-5.1.5.rc1 lib/action_dispatch/system_testing/server.rb